From 52356edd69ef4dc3ffb9ba350aa62813ed97e366 Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Mon, 4 Nov 2024 14:40:33 +0000 Subject: [PATCH] Analytics updates --- CHANGELOG.md | 3 + README.md | 6 +- api/openapi.yaml | 384 +++++++++++++++++- build.gradle | 2 +- ...alyticsAggregatedMetricsResponseContext.md | 13 +- docs/AnalyticsApi.md | 72 +++- ...nalyticsMetricsBreakdownResponseContext.md | 15 +- docs/AnalyticsMetricsOverTimeResponse.md | 2 +- ...AnalyticsMetricsOverTimeResponseContext.md | 16 +- docs/FilterBy.md | 1 + docs/FilterBy1.md | 1 + docs/FilterBy2.md | 1 + pom.xml | 2 +- .../java/video/api/client/api/ApiClient.java | 2 +- .../api/client/api/clients/AnalyticsApi.java | 300 +++++++++++--- ...yticsAggregatedMetricsResponseContext.java | 30 +- ...lyticsMetricsBreakdownResponseContext.java | 34 +- .../AnalyticsMetricsOverTimeResponse.java | 4 +- ...alyticsMetricsOverTimeResponseContext.java | 36 +- .../video/api/client/api/models/FilterBy.java | 43 +- .../api/client/api/models/FilterBy1.java | 43 +- .../api/client/api/models/FilterBy2.java | 43 +- .../getAggregatedMetrics/responses/400-2.json | 7 + .../getAggregatedMetrics/responses/400-3.json | 7 + .../getMetricsBreakdown/responses/400-2.json | 7 + .../getMetricsBreakdown/responses/400-3.json | 7 + .../getMetricsOverTime/responses/400-2.json | 7 + .../getMetricsOverTime/responses/400-3.json | 7 + .../getMetricsOverTime/responses/400-4.json | 7 + .../getMetricsOverTime/responses/400-5.json | 7 + 30 files changed, 971 insertions(+), 138 deletions(-) create mode 100644 src/test/resources/payloads/analytics/getAggregatedMetrics/responses/400-2.json create mode 100644 src/test/resources/payloads/analytics/getAggregatedMetrics/responses/400-3.json create mode 100644 src/test/resources/payloads/analytics/getMetricsBreakdown/responses/400-2.json create mode 100644 src/test/resources/payloads/analytics/getMetricsBreakdown/responses/400-3.json create mode 100644 src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-2.json create mode 100644 src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-3.json create mode 100644 src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-4.json create mode 100644 src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-5.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 26dd051..82fe425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.4.6] - 2024-11-04 +- Analytics updates (ccv, views, ...) + ## [1.4.5] - 2024-10-21 - Add summary feature diff --git a/README.md b/README.md index 556dc4c..98ca37e 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Add this dependency to your project's POM: video.api java-api-client - 1.4.5 + 1.4.6 compile ``` @@ -80,7 +80,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -implementation "video.api:java-api-client:1.4.5" +implementation "video.api:java-api-client:1.4.6" ``` #### Others @@ -93,7 +93,7 @@ mvn clean package Then manually install the following JARs: -* `target/java-api-client-1.4.5.jar` +* `target/java-api-client-1.4.6.jar` * `target/lib/*.jar` ### Code sample diff --git a/api/openapi.yaml b/api/openapi.yaml index 99fdd4b..2f4c60c 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -12823,6 +12823,8 @@ paths: - `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. + - `ccv`: is the number of concurrent viewers, or users watching at the same time. + - `view`: the total number of viewers until this point in time. explode: false in: path name: metric @@ -12835,6 +12837,8 @@ paths: - impression - impression-time - watch-time + - ccv + - view type: string style: simple - description: "Use this path parameter to define a way of collecting data for\ @@ -12844,7 +12848,11 @@ paths: \ This aggregation can be used only with the `play` metric.\n- `total` calculates\ \ the total number of events for the `play` metric. \n- `average` calculates\ \ an average value for the selected metric.\n- `sum` adds up the total value\ - \ of the select metric.\n" + \ of the select metric.\n- `peak` shows the highest value of the `ccv` metric\ + \ in the timeframe of your request. You can use this aggregation only with\ + \ the `ccv` metric.\n- `live` shows the highest value of the `ccv` metric\ + \ from the last 20 seconds. You can use this aggregation only with the `ccv`\ + \ metric.\n" explode: false in: path name: aggregation @@ -12856,6 +12864,8 @@ paths: - total - average - sum + - peak + - live type: string style: simple - description: | @@ -12889,6 +12899,40 @@ paths: format: date-time type: string style: form + - description: "Use this query parameter to control how viewer data is counted:\n\ + \n- `true` means that a single user watching multiple times counts as 1\ + \ unique viewer\n- `false` means that all views count, even if from the\ + \ same user.\n\nThe API accepts this parameter only when you use the `ccv`\ + \ or `view` metric. \n\nViewers are unique for 1 day.\n\nThe API\ + \ determines uniqueness based on a viewer's `user-agent` and IP address.\ + \ This means that the API can filter viewers using multiple tabs to watch\ + \ the same video multiple times, but cannot filter for viewers who use multiple\ + \ browsers to watch the same content multiple times.\n" + example: true + explode: false + in: query + name: unique + required: false + schema: + type: boolean + style: form + - description: "Use this query parameter to define how many seconds a view has\ + \ to last to be counted in analytics data.\n\n- You can only use this parameter\ + \ with the `view` metric.\n- The accepted values are `3s`, `5s`, `10s`,\ + \ and `30s`. \n- If you do not set this parameter, the API defaults to `5s`.\n" + example: 5s + explode: false + in: query + name: viewDuration + required: false + schema: + enum: + - 3s + - 5s + - 10s + - 30s + type: string + style: form - $ref: '#/components/parameters/filterBy_2' description: "Use this parameter to filter the API's response based on different\ \ data dimensions. You can serialize filters in your query to receive more\ @@ -12915,7 +12959,10 @@ paths: \ on the browser used by the viewers. Response values can include `chrome`,\ \ `firefox`, `edge`, `opera`.\n- `tag`: Returns analytics for videos using\ \ this tag. This filter only accepts a single value and is case sensitive.\ - \ Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).\n" + \ Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).\n\ + - `referrer`: Filters data based on the URL where the view is originating\ + \ from. Accepts an empty string as a value to filter view events where no\ + \ referrer is available.\n" example: filterBy[country]=FR&filterBy[operatingSystem]=windows&filterBy[browser][]=firefox&filterBy[browser][]=chrome&filterBy[tag]=Cool videos explode: true @@ -12997,6 +13044,19 @@ paths: tagging your videos [here](https://docs.api.video/vod/tags-metadata). example: Cool videos type: string + referrer: + description: |- + Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + + - The API filters for exact matches. Include the trailing `/` characters if needed. + - The URLs you add must be URL encoded. + example: + - https%3A%2F%2Fmy-awesome-videos.com + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true style: deepObject @@ -13063,6 +13123,24 @@ paths: status: 400 detail: This field was not expected. name: from:2024-05-20T09:15:05+02:00 + Referrer too long: + description: Occurs when the value of `referrer` in your query is + too long. + value: + type: https://docs.api.video/reference/request-invalid-query-parameter + title: A query parameter is invalid. + status: 400 + detail: This value should not contain more than 2048 characters. + name: filterBy[referrer] + Invalid view duration: + description: Occurs when the value of `viewDuration` is incorrect. + value: + type: https://docs.api.video/reference/request-invalid-query-parameter + title: A query parameter is invalid. + status: 400 + detail: This view duration is invalid. Use one of "3s", "5s", + "10s", "30s". + name: viewDuration schema: $ref: '#/components/schemas/analytics-plays-400-error' description: Bad request error @@ -13240,6 +13318,9 @@ paths: - `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. + - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. + - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. + - `view` is the total number of viewers until this point in time. explode: false in: path name: metric @@ -13252,6 +13333,9 @@ paths: - start - end - impression + - ccv-peak + - ccv-average + - view type: string style: simple - description: "Use this path parameter to define a dimension for segmenting\ @@ -13271,7 +13355,10 @@ paths: \ based on the operating system used by the viewers. Response values can\ \ include `windows`, `mac osx`, `android`, `ios`, `linux`.\n- `browser`:\ \ Returns analytics based on the browser used by the viewers. Response values\ - \ can include `chrome`, `firefox`, `edge`, `opera`.\n" + \ can include `chrome`, `firefox`, `edge`, `opera`.\n- `referrer`: Returns\ + \ the URL where the view originates from, for example a website where the\ + \ video is embedded. View events from Android and iOS return empty strings\ + \ as the value for `referrer`.\n" explode: false in: path name: breakdown @@ -13285,6 +13372,7 @@ paths: - device-type - operating-system - browser + - referrer type: string style: simple - description: | @@ -13352,6 +13440,40 @@ paths: - desc type: string style: form + - description: "Use this query parameter to control how viewer data is counted:\n\ + \n- `true` means that a single user watching multiple times counts as 1\ + \ unique viewer\n- `false` means that all views count, even if from the\ + \ same user.\n\nThe API accepts this parameter only when you use the `ccv-peak`,\ + \ `ccv-average`, or `view` metric. \n\nViewers are unique for 1\ + \ day.\n\nThe API determines uniqueness based on a viewer's `user-agent`\ + \ and IP address. This means that the API can filter viewers using multiple\ + \ tabs to watch the same video multiple times, but cannot filter for viewers\ + \ who use multiple browsers to watch the same content multiple times.\n" + example: true + explode: false + in: query + name: unique + required: false + schema: + type: boolean + style: form + - description: "Use this query parameter to define how many seconds a view has\ + \ to last to be counted in analytics data.\n\n- You can only use this parameter\ + \ together with the `view` metric.\n- The accepted values are `3s`, `5s`,\ + \ `10s`, and `30s`. \n- If you do not set this parameter, the API defaults\ + \ to `5s`.\n" + explode: false + in: query + name: viewDuration + required: false + schema: + enum: + - 3s + - 5s + - 10s + - 30s + type: string + style: form - $ref: '#/components/parameters/filterBy_2' description: "Use this parameter to filter the API's response based on different\ \ data dimensions. You can serialize filters in your query to receive more\ @@ -13378,7 +13500,10 @@ paths: \ on the browser used by the viewers. Response values can include `chrome`,\ \ `firefox`, `edge`, `opera`.\n- `tag`: Returns analytics for videos using\ \ this tag. This filter only accepts a single value and is case sensitive.\ - \ Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).\n" + \ Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).\n\ + - `referrer`: Filters data based on the URL where the view is originating\ + \ from. Accepts an empty string as a value to filter view events where no\ + \ referrer is available.\n" example: filterBy[country]=FR&filterBy[operatingSystem]=windows&filterBy[browser][]=firefox&filterBy[browser][]=chrome&filterBy[tag]=Cool videos explode: true @@ -13460,6 +13585,19 @@ paths: tagging your videos [here](https://docs.api.video/vod/tags-metadata). example: Cool videos type: string + referrer: + description: |- + Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + + - The API filters for exact matches. Include the trailing `/` characters if needed. + - The URLs you add must be URL encoded. + example: + - https%3A%2F%2Fmy-awesome-videos.com + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true style: deepObject @@ -13562,6 +13700,24 @@ paths: status: 400 detail: This field was not expected. name: from:2024-05-20T09:15:05+02:00 + Referrer too long: + description: Occurs when the value of `referrer` in your query is + too long. + value: + type: https://docs.api.video/reference/request-invalid-query-parameter + title: A query parameter is invalid. + status: 400 + detail: This value should not contain more than 2048 characters. + name: filterBy[referrer] + Invalid view duration: + description: Occurs when the value of `viewDuration` is incorrect. + value: + type: https://docs.api.video/reference/request-invalid-query-parameter + title: A query parameter is invalid. + status: 400 + detail: This view duration is invalid. Use one of "3s", "5s", + "10s", "30s". + name: viewDuration schema: $ref: '#/components/schemas/analytics-plays-400-error' description: Bad request error @@ -13728,14 +13884,16 @@ paths: grouped by the time at which they occurred operationId: GET_metrics-over-time parameters: - - description: | - 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. + - description: "Use this path parameter to select a metric that you want analytics\ + \ for.\n\n- `play` is the number of times your content has been played.\n\ + - `play-rate` is the ratio that calculates the number of plays your content\ + \ receives divided by its impressions.\n- `start` is the number of times\ + \ playback was started.\n- `end` is the number of times playback has ended\ + \ with the content watch until the end.\n- `impression` is the number of\ + \ times your content has been loaded and was ready for playback.\n- `ccv-peak`\ + \ is the highest number of concurrent viewers in the timeframe of your request.\n\ + - `ccv-average` is the average number of concurrent viewers in the timeframe\ + \ of your request.\n- `view` is the total number of viewers. \n" explode: false in: path name: metric @@ -13747,6 +13905,9 @@ paths: - start - end - impression + - ccv-peak + - ccv-average + - view type: string style: simple - description: | @@ -13779,11 +13940,10 @@ paths: type: string style: form - description: | - 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. + Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `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`. + - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters must be less than 60 minutes. example: hour explode: false in: query @@ -13791,6 +13951,7 @@ paths: required: false schema: enum: + - minute - hour - day type: string @@ -13831,6 +13992,40 @@ paths: - desc type: string style: form + - description: "Use this query parameter to control how viewer data is counted:\n\ + \n- `true` means that a single user watching multiple times counts as 1\ + \ unique viewer\n- `false` means that all views count, even if from the\ + \ same user.\n\nThe API accepts this parameter only when you use the `ccv-peak`,\ + \ `ccv-average`, or `view` metric. \n\nViewers are unique for 1\ + \ day.\n\nThe API determines uniqueness based on a viewer's `user-agent`\ + \ and IP address. This means that the API can filter viewers using multiple\ + \ tabs to watch the same video multiple times, but cannot filter for viewers\ + \ who use multiple browsers to watch the same content multiple times.\n" + example: true + explode: false + in: query + name: unique + required: false + schema: + type: boolean + style: form + - description: "Use this query parameter to define how many seconds a view has\ + \ to last to be counted in analytics data.\n\n- You can only use this parameter\ + \ together with the `view` metric.\n- The accepted values are `3s`, `5s`,\ + \ `10s`, and `30s`. \n- If you do not set this parameter, the API defaults\ + \ to `5s`.\n" + explode: false + in: query + name: viewDuration + required: false + schema: + enum: + - 3s + - 5s + - 10s + - 30s + type: string + style: form - $ref: '#/components/parameters/filterBy_2' description: "Use this parameter to filter the API's response based on different\ \ data dimensions. You can serialize filters in your query to receive more\ @@ -13857,7 +14052,10 @@ paths: \ on the browser used by the viewers. Response values can include `chrome`,\ \ `firefox`, `edge`, `opera`.\n- `tag`: Returns analytics for videos using\ \ this tag. This filter only accepts a single value and is case sensitive.\ - \ Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).\n" + \ Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).\n\ + - `referrer`: Filters data based on the URL where the view is originating\ + \ from. Accepts an empty string as a value to filter view events where no\ + \ referrer is available.\n" example: filterBy[country]=FR&filterBy[operatingSystem]=windows&filterBy[browser][]=firefox&filterBy[browser][]=chrome&filterBy[tag]=Cool videos explode: true @@ -13939,6 +14137,19 @@ paths: tagging your videos [here](https://docs.api.video/vod/tags-metadata). example: Cool videos type: string + referrer: + description: |- + Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + + - The API filters for exact matches. Include the trailing `/` characters if needed. + - The URLs you add must be URL encoded. + example: + - https%3A%2F%2Fmy-awesome-videos.com + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true style: deepObject @@ -14045,6 +14256,44 @@ paths: status: 400 detail: This field was not expected. name: from:2024-05-20T09:15:05+02:00 + Invalid interval: + description: Occurs when the value you set for `interval` is not + `minute`, `hour`, or `day`. + value: + type: https://docs.api.video/reference/request-invalid-query-parameter + title: A query parameter is invalid. + status: 400 + detail: This interval is invalid. Use one of "minute", "hour", + "day". + name: interval + Timeframe does not match interval: + description: Occurs when you set `minute` as interval, and a timeframe + that is longer than 60 minutes. + value: + type: https://docs.api.video/reference/request-invalid-query-parameter + title: A query parameter is invalid. + status: 400 + detail: This interval cannot be used with a timeframe over 60 + minutes. + name: interval + Referrer too long: + description: Occurs when the value of `referrer` in your query is + too long. + value: + type: https://docs.api.video/reference/request-invalid-query-parameter + title: A query parameter is invalid. + status: 400 + detail: This value should not contain more than 2048 characters. + name: filterBy[referrer] + Invalid view duration: + description: Occurs when the value of `viewDuration` is incorrect. + value: + type: https://docs.api.video/reference/request-invalid-query-parameter + title: A query parameter is invalid. + status: 400 + detail: This view duration is invalid. Use one of "3s", "5s", + "10s", "30s". + name: viewDuration schema: $ref: '#/components/schemas/analytics-plays-400-error' description: Bad request error @@ -15184,7 +15433,10 @@ components: \ the browser used by the viewers. Response values can include `chrome`, `firefox`,\ \ `edge`, `opera`.\n- `tag`: Returns analytics for videos using this tag.\ \ This filter only accepts a single value and is case sensitive. Read more\ - \ about tagging your videos [here](https://docs.api.video/vod/tags-metadata).\n" + \ about tagging your videos [here](https://docs.api.video/vod/tags-metadata).\n\ + - `referrer`: Filters data based on the URL where the view is originating\ + \ from. Accepts an empty string as a value to filter view events where no\ + \ referrer is available.\n" example: filterBy[country]=FR&filterBy[operatingSystem]=windows&filterBy[browser][]=firefox&filterBy[browser][]=chrome&filterBy[tag]=Cool videos explode: true @@ -15265,6 +15517,19 @@ components: your videos [here](https://docs.api.video/vod/tags-metadata). example: Cool videos type: string + referrer: + description: |- + Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + + - The API filters for exact matches. Include the trailing `/` characters if needed. + - The URLs you add must be URL encoded. + example: + - https%3A%2F%2Fmy-awesome-videos.com + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true style: deepObject @@ -17519,7 +17784,7 @@ components: context: $ref: '#/components/schemas/analytics_metrics_over_time_response_context' data: - description: Returns an array of metrics and the timestamps . + description: Returns an array of metrics and the timestamps. items: $ref: '#/components/schemas/analytics_metrics_over_time_response_data' type: array @@ -17953,6 +18218,19 @@ components: your videos [here](https://docs.api.video/vod/tags-metadata). example: Cool videos type: string + referrer: + description: |- + Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + + - The API filters for exact matches. Include the trailing `/` characters if needed. + - The URLs you add must be URL encoded. + example: + - https%3A%2F%2Fmy-awesome-videos.com + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true filterBy_1: @@ -18029,6 +18307,19 @@ components: your videos [here](https://docs.api.video/vod/tags-metadata). example: Cool videos type: string + referrer: + description: |- + Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + + - The API filters for exact matches. Include the trailing `/` characters if needed. + - The URLs you add must be URL encoded. + example: + - https%3A%2F%2Fmy-awesome-videos.com + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true filterBy_2: @@ -18105,6 +18396,19 @@ components: your videos [here](https://docs.api.video/vod/tags-metadata). example: Cool videos type: string + referrer: + description: |- + Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + + - The API filters for exact matches. Include the trailing `/` characters if needed. + - The URLs you add must be URL encoded. + example: + - https%3A%2F%2Fmy-awesome-videos.com + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true list_tags_response_data: @@ -18162,7 +18466,7 @@ components: aggregation: count properties: metric: - description: Returns the metric you selected. + description: Returns the metric and relevant parameters you selected. enum: - play - start @@ -18170,6 +18474,17 @@ components: - impression - impression-time - watch-time + - ccv + - unique-ccv + - view-3 + - view-5 + - view-10 + - view-30 + - unique-view + - unique-view-3 + - unique-view-5 + - unique-view-10 + - unique-view-30 example: impression type: string aggregation: @@ -18194,13 +18509,26 @@ components: breakdown: country properties: metric: - description: Returns the metric you selected. + description: Returns the metric and relevant parameters you selected. enum: - play - play-rate - start - end - impression + - ccv-average + - ccv-peak + - unique-ccv-average + - unique-ccv-peak + - view-3 + - view-5 + - view-10 + - view-30 + - unique-view + - unique-view-3 + - unique-view-5 + - unique-view-10 + - unique-view-30 example: impression type: string breakdown: @@ -18242,18 +18570,32 @@ components: interval: day properties: metric: - description: Returns the metric you selected. + description: Returns the metric and relevant parameters you selected. enum: - play - play-rate - start - end - impression + - ccv-average + - ccv-peak + - unique-ccv-average + - unique-ccv-peak + - view-3 + - view-5 + - view-10 + - view-30 + - unique-view + - unique-view-3 + - unique-view-5 + - unique-view-10 + - unique-view-30 example: impression type: string interval: description: Returns the interval you selected. enum: + - minute - hour - day example: day diff --git a/build.gradle b/build.gradle index 5fa96d3..8fe721e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'com.diffplug.spotless' apply plugin: 'maven-publish' group = 'video.api' -version = '1.4.5' +version = '1.4.6' buildscript { repositories { diff --git a/docs/AnalyticsAggregatedMetricsResponseContext.md b/docs/AnalyticsAggregatedMetricsResponseContext.md index 812f89b..a1722a2 100644 --- a/docs/AnalyticsAggregatedMetricsResponseContext.md +++ b/docs/AnalyticsAggregatedMetricsResponseContext.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | [**MetricEnum**](#MetricEnum) | Returns the metric you selected. | [optional] +**metric** | [**MetricEnum**](#MetricEnum) | Returns the metric and relevant parameters you selected. | [optional] **aggregation** | [**AggregationEnum**](#AggregationEnum) | Returns the aggregation you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] @@ -22,6 +22,17 @@ END | "end" IMPRESSION | "impression" IMPRESSION_TIME | "impression-time" WATCH_TIME | "watch-time" +CCV | "ccv" +UNIQUE_CCV | "unique-ccv" +VIEW_3 | "view-3" +VIEW_5 | "view-5" +VIEW_10 | "view-10" +VIEW_30 | "view-30" +UNIQUE_VIEW | "unique-view" +UNIQUE_VIEW_3 | "unique-view-3" +UNIQUE_VIEW_5 | "unique-view-5" +UNIQUE_VIEW_10 | "unique-view-10" +UNIQUE_VIEW_30 | "unique-view-30" diff --git a/docs/AnalyticsApi.md b/docs/AnalyticsApi.md index 443c116..8023f7e 100644 --- a/docs/AnalyticsApi.md +++ b/docs/AnalyticsApi.md @@ -11,7 +11,7 @@ Method | HTTP request | Description # **getAggregatedMetrics** -> AnalyticsAggregatedMetricsResponse getAggregatedMetrics(metric, aggregation).from(from).to(to).filterBy(filterBy).execute() +> AnalyticsAggregatedMetricsResponse getAggregatedMetrics(metric, aggregation).from(from).to(to).unique(unique).viewDuration(viewDuration).filterBy(filterBy).execute() > okhttp3.Call executeAsync(callback) > ApiResponse executeWithHttpInfo() @@ -36,11 +36,13 @@ public class Example { AnalyticsApi apiInstance = client.analytics(); - String metric = "play"; // 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. - String aggregation = "count"; // 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. + String metric = "play"; // 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. - `ccv`: is the number of concurrent viewers, or users watching at the same time. - `view`: the total number of viewers until this point in time. + String aggregation = "count"; // 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. - `peak` shows the highest value of the `ccv` metric in the timeframe of your request. You can use this aggregation only with the `ccv` metric. - `live` shows the highest value of the `ccv` metric from the last 20 seconds. You can use this aggregation only with the `ccv` metric. OffsetDateTime from = OffsetDateTime.parse("2024-02-05T00:00:00+01:00"); // Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. OffsetDateTime to = OffsetDateTime.parse("2024-02-06T00:00:00+01:00"); // 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. - FilterBy2 filterBy = new HashMap(); // Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + Boolean unique = true; // Use this query parameter to control how viewer data is counted: - `true` means that a single user watching multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv` or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + String viewDuration = "3s"; // Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + FilterBy2 filterBy = new HashMap(); // Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. filterBy.setMediaId(Arrays.asList(Arrays.asList(Arrays.asList("vi4blUQJFrYWbaG44NChkH27")))); // Returns analytics based on the unique identifiers of a video or a live stream. filterBy.setMediaType("""video"""); // filterBy.setContinent(Arrays.asList(Arrays.asList(Arrays.asList("EU")))); // Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. @@ -49,12 +51,18 @@ public class Example { filterBy.setOperatingSystem(Arrays.asList(Arrays.asList(Arrays.asList("windows")))); // Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. filterBy.setBrowser(Arrays.asList(Arrays.asList(Arrays.asList("firefox")))); // Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. filterBy.setTag("""Cool videos"""); // Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + filterBy.setReferrer(Collections.emptyList()); // Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + +- The API filters for exact matches. Include the trailing `/` characters if needed. +- The URLs you add must be URL encoded. try { AnalyticsAggregatedMetricsResponse result = apiInstance.getAggregatedMetrics(metric, aggregation) .from(from) .to(to) + .unique(unique) + .viewDuration(viewDuration) .filterBy(filterBy) .execute(); System.out.println(result); @@ -73,11 +81,13 @@ public class Example { 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. | [enum: play, start, end, impression, impression-time, watch-time] - **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. | [enum: count, rate, total, average, sum] + **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. - `ccv`: is the number of concurrent viewers, or users watching at the same time. - `view`: the total number of viewers until this point in time. | [enum: play, start, end, impression, impression-time, watch-time, ccv, view] + **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. - `peak` shows the highest value of the `ccv` metric in the timeframe of your request. You can use this aggregation only with the `ccv` metric. - `live` shows the highest value of the `ccv` metric from the last 20 seconds. You can use this aggregation only with the `ccv` metric. | [enum: count, rate, total, average, sum, peak, live] **from** | **OffsetDateTime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. | [optional] **to** | **OffsetDateTime**| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] - **filterBy** | [**FilterBy2**](.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + **unique** | **Boolean**| Use this query parameter to control how viewer data is counted: - `true` means that a single user watching multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv` or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | [optional] + **viewDuration** | **String**| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | [optional] [enum: 3s, 5s, 10s, 30s] + **filterBy** | [**FilterBy2**](.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | [optional] ### Return type @@ -103,7 +113,7 @@ Name | Type | Description | Notes # **getMetricsBreakdown** -> AnalyticsMetricsBreakdownResponse getMetricsBreakdown(metric, breakdown).from(from).to(to).sortBy(sortBy).sortOrder(sortOrder).filterBy(filterBy).currentPage(currentPage).pageSize(pageSize).execute() +> AnalyticsMetricsBreakdownResponse getMetricsBreakdown(metric, breakdown).from(from).to(to).sortBy(sortBy).sortOrder(sortOrder).unique(unique).viewDuration(viewDuration).filterBy(filterBy).currentPage(currentPage).pageSize(pageSize).execute() > okhttp3.Call executeAsync(callback) > ApiResponse executeWithHttpInfo() @@ -128,13 +138,15 @@ public class Example { AnalyticsApi apiInstance = client.analytics(); - String metric = "play"; // Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - String breakdown = "media-id"; // Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. + String metric = "play"; // Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers until this point in time. + String breakdown = "media-id"; // Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `referrer`: Returns the URL where the view originates from, for example a website where the video is embedded. View events from Android and iOS return empty strings as the value for `referrer`. OffsetDateTime from = OffsetDateTime.parse("2024-02-05T00:00:00+01:00"); // Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` OffsetDateTime to = OffsetDateTime.parse("2024-02-06T00:00:00+01:00"); // 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. String sortBy = "metricValue"; // Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `dimensionValue`: Sorts the results based on the **dimension** you selected in your request. String sortOrder = "asc"; // Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. - FilterBy2 filterBy = new HashMap(); // Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + Boolean unique = true; // Use this query parameter to control how viewer data is counted: - `true` means that a single user watching multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + String viewDuration = "3s"; // Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + FilterBy2 filterBy = new HashMap(); // Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. filterBy.setMediaId(Arrays.asList(Arrays.asList(Arrays.asList("vi4blUQJFrYWbaG44NChkH27")))); // Returns analytics based on the unique identifiers of a video or a live stream. filterBy.setMediaType("""video"""); // filterBy.setContinent(Arrays.asList(Arrays.asList(Arrays.asList("EU")))); // Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. @@ -143,6 +155,10 @@ public class Example { filterBy.setOperatingSystem(Arrays.asList(Arrays.asList(Arrays.asList("windows")))); // Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. filterBy.setBrowser(Arrays.asList(Arrays.asList(Arrays.asList("firefox")))); // Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. filterBy.setTag("""Cool videos"""); // Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + filterBy.setReferrer(Collections.emptyList()); // Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + +- The API filters for exact matches. Include the trailing `/` characters if needed. +- The URLs you add must be URL encoded. Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. @@ -153,6 +169,8 @@ public class Example { .to(to) .sortBy(sortBy) .sortOrder(sortOrder) + .unique(unique) + .viewDuration(viewDuration) .filterBy(filterBy) .currentPage(currentPage) .pageSize(pageSize) @@ -173,13 +191,15 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **metric** | **String**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. | [enum: play, play-rate, play-total, start, end, impression] - **breakdown** | **String**| Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [enum: media-id, media-type, continent, country, device-type, operating-system, browser] + **metric** | **String**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers until this point in time. | [enum: play, play-rate, play-total, start, end, impression, ccv-peak, ccv-average, view] + **breakdown** | **String**| Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `referrer`: Returns the URL where the view originates from, for example a website where the video is embedded. View events from Android and iOS return empty strings as the value for `referrer`. | [enum: media-id, media-type, continent, country, device-type, operating-system, browser, referrer] **from** | **OffsetDateTime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | [optional] **to** | **OffsetDateTime**| 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] **sortBy** | **String**| Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `dimensionValue`: Sorts the results based on the **dimension** you selected in your request. | [optional] [enum: metricValue, dimensionValue] **sortOrder** | **String**| Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. | [optional] [enum: asc, desc] - **filterBy** | [**FilterBy2**](.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + **unique** | **Boolean**| Use this query parameter to control how viewer data is counted: - `true` means that a single user watching multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | [optional] + **viewDuration** | **String**| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | [optional] [enum: 3s, 5s, 10s, 30s] + **filterBy** | [**FilterBy2**](.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | [optional] **currentPage** | **Integer**| Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] **pageSize** | **Integer**| Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] @@ -207,7 +227,7 @@ Name | Type | Description | Notes # **getMetricsOverTime** -> AnalyticsMetricsOverTimeResponse getMetricsOverTime(metric).from(from).to(to).interval(interval).sortBy(sortBy).sortOrder(sortOrder).filterBy(filterBy).currentPage(currentPage).pageSize(pageSize).execute() +> AnalyticsMetricsOverTimeResponse getMetricsOverTime(metric).from(from).to(to).interval(interval).sortBy(sortBy).sortOrder(sortOrder).unique(unique).viewDuration(viewDuration).filterBy(filterBy).currentPage(currentPage).pageSize(pageSize).execute() > okhttp3.Call executeAsync(callback) > ApiResponse executeWithHttpInfo() @@ -232,13 +252,15 @@ public class Example { AnalyticsApi apiInstance = client.analytics(); - String metric = "play"; // 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. + String metric = "play"; // 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. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers. OffsetDateTime from = OffsetDateTime.parse("2024-02-05T00:00:00+01:00"); // Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` OffsetDateTime to = OffsetDateTime.parse("2024-02-06T00:00:00+01:00"); // 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. - String interval = "hour"; // 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`. + String interval = "minute"; // Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `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`. - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters must be less than 60 minutes. String sortBy = "metricValue"; // Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format. String sortOrder = "asc"; // Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. - FilterBy2 filterBy = new HashMap(); // Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + Boolean unique = true; // Use this query parameter to control how viewer data is counted: - `true` means that a single user watching multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. + String viewDuration = "3s"; // Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. + FilterBy2 filterBy = new HashMap(); // Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. filterBy.setMediaId(Arrays.asList(Arrays.asList(Arrays.asList("vi4blUQJFrYWbaG44NChkH27")))); // Returns analytics based on the unique identifiers of a video or a live stream. filterBy.setMediaType("""video"""); // filterBy.setContinent(Arrays.asList(Arrays.asList(Arrays.asList("EU")))); // Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. @@ -247,6 +269,10 @@ public class Example { filterBy.setOperatingSystem(Arrays.asList(Arrays.asList(Arrays.asList("windows")))); // Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. filterBy.setBrowser(Arrays.asList(Arrays.asList(Arrays.asList("firefox")))); // Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. filterBy.setTag("""Cool videos"""); // Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). + filterBy.setReferrer(Collections.emptyList()); // Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. + +- The API filters for exact matches. Include the trailing `/` characters if needed. +- The URLs you add must be URL encoded. Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1 Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25. @@ -258,6 +284,8 @@ public class Example { .interval(interval) .sortBy(sortBy) .sortOrder(sortOrder) + .unique(unique) + .viewDuration(viewDuration) .filterBy(filterBy) .currentPage(currentPage) .pageSize(pageSize) @@ -278,13 +306,15 @@ public class Example { 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. | [enum: play, play-rate, start, end, impression] + **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. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers. | [enum: play, play-rate, start, end, impression, ccv-peak, ccv-average, view] **from** | **OffsetDateTime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | [optional] **to** | **OffsetDateTime**| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] - **interval** | **String**| Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. | [optional] [enum: hour, day] + **interval** | **String**| Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `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`. - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters must be less than 60 minutes. | [optional] [enum: minute, hour, day] **sortBy** | **String**| Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format. | [optional] [enum: metricValue, emittedAt] **sortOrder** | **String**| Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. | [optional] [enum: asc, desc] - **filterBy** | [**FilterBy2**](.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + **unique** | **Boolean**| Use this query parameter to control how viewer data is counted: - `true` means that a single user watching multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | [optional] + **viewDuration** | **String**| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | [optional] [enum: 3s, 5s, 10s, 30s] + **filterBy** | [**FilterBy2**](.md)| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | [optional] **currentPage** | **Integer**| Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] **pageSize** | **Integer**| Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] diff --git a/docs/AnalyticsMetricsBreakdownResponseContext.md b/docs/AnalyticsMetricsBreakdownResponseContext.md index 61d3776..d95a790 100644 --- a/docs/AnalyticsMetricsBreakdownResponseContext.md +++ b/docs/AnalyticsMetricsBreakdownResponseContext.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | [**MetricEnum**](#MetricEnum) | Returns the metric you selected. | [optional] +**metric** | [**MetricEnum**](#MetricEnum) | Returns the metric and relevant parameters you selected. | [optional] **breakdown** | [**BreakdownEnum**](#BreakdownEnum) | Returns the dimension you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] @@ -21,6 +21,19 @@ PLAY_RATE | "play-rate" START | "start" END | "end" IMPRESSION | "impression" +CCV_AVERAGE | "ccv-average" +CCV_PEAK | "ccv-peak" +UNIQUE_CCV_AVERAGE | "unique-ccv-average" +UNIQUE_CCV_PEAK | "unique-ccv-peak" +VIEW_3 | "view-3" +VIEW_5 | "view-5" +VIEW_10 | "view-10" +VIEW_30 | "view-30" +UNIQUE_VIEW | "unique-view" +UNIQUE_VIEW_3 | "unique-view-3" +UNIQUE_VIEW_5 | "unique-view-5" +UNIQUE_VIEW_10 | "unique-view-10" +UNIQUE_VIEW_30 | "unique-view-30" diff --git a/docs/AnalyticsMetricsOverTimeResponse.md b/docs/AnalyticsMetricsOverTimeResponse.md index e61a6cd..7a7be47 100644 --- a/docs/AnalyticsMetricsOverTimeResponse.md +++ b/docs/AnalyticsMetricsOverTimeResponse.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **context** | [**AnalyticsMetricsOverTimeResponseContext**](AnalyticsMetricsOverTimeResponseContext.md) | | -**data** | [**List<AnalyticsMetricsOverTimeResponseData>**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps . | +**data** | [**List<AnalyticsMetricsOverTimeResponseData>**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps. | **pagination** | [**Pagination**](Pagination.md) | | diff --git a/docs/AnalyticsMetricsOverTimeResponseContext.md b/docs/AnalyticsMetricsOverTimeResponseContext.md index ea7032e..6b73413 100644 --- a/docs/AnalyticsMetricsOverTimeResponseContext.md +++ b/docs/AnalyticsMetricsOverTimeResponseContext.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | [**MetricEnum**](#MetricEnum) | Returns the metric you selected. | [optional] +**metric** | [**MetricEnum**](#MetricEnum) | Returns the metric and relevant parameters you selected. | [optional] **interval** | [**IntervalEnum**](#IntervalEnum) | Returns the interval you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] @@ -21,6 +21,19 @@ PLAY_RATE | "play-rate" START | "start" END | "end" IMPRESSION | "impression" +CCV_AVERAGE | "ccv-average" +CCV_PEAK | "ccv-peak" +UNIQUE_CCV_AVERAGE | "unique-ccv-average" +UNIQUE_CCV_PEAK | "unique-ccv-peak" +VIEW_3 | "view-3" +VIEW_5 | "view-5" +VIEW_10 | "view-10" +VIEW_30 | "view-30" +UNIQUE_VIEW | "unique-view" +UNIQUE_VIEW_3 | "unique-view-3" +UNIQUE_VIEW_5 | "unique-view-5" +UNIQUE_VIEW_10 | "unique-view-10" +UNIQUE_VIEW_30 | "unique-view-30" @@ -28,6 +41,7 @@ IMPRESSION | "impression" Name | Value ---- | ----- +MINUTE | "minute" HOUR | "hour" DAY | "day" diff --git a/docs/FilterBy.md b/docs/FilterBy.md index 218c7af..04efcc9 100644 --- a/docs/FilterBy.md +++ b/docs/FilterBy.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **operatingSystem** | **List<String>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **List<String>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **String** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **List<URI>** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. | [optional] diff --git a/docs/FilterBy1.md b/docs/FilterBy1.md index 907e328..75f585d 100644 --- a/docs/FilterBy1.md +++ b/docs/FilterBy1.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **operatingSystem** | **List<String>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **List<String>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **String** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **List<URI>** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. | [optional] diff --git a/docs/FilterBy2.md b/docs/FilterBy2.md index b83e5cd..ca2b704 100644 --- a/docs/FilterBy2.md +++ b/docs/FilterBy2.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **operatingSystem** | **List<String>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **List<String>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **String** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **List<URI>** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. | [optional] diff --git a/pom.xml b/pom.xml index 95c2014..9bc00a5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ java-api-client jar ${project.groupId}:${project.artifactId} - 1.4.5 + 1.4.6 https://github.com/apivideo/api.video-java-client api.video Java API client diff --git a/src/main/java/video/api/client/api/ApiClient.java b/src/main/java/video/api/client/api/ApiClient.java index 538f969..e22cd36 100644 --- a/src/main/java/video/api/client/api/ApiClient.java +++ b/src/main/java/video/api/client/api/ApiClient.java @@ -120,7 +120,7 @@ private OkHttpClient initHttpClient(List interceptors) { private void init() { verifyingSsl = true; json = new JSON(); - addDefaultHeader("AV-Origin-Client", "java:1.4.5"); + addDefaultHeader("AV-Origin-Client", "java:1.4.6"); } private boolean isValid(String regex, String field) { diff --git a/src/main/java/video/api/client/api/clients/AnalyticsApi.java b/src/main/java/video/api/client/api/clients/AnalyticsApi.java index 42da972..fa7ff24 100644 --- a/src/main/java/video/api/client/api/clients/AnalyticsApi.java +++ b/src/main/java/video/api/client/api/clients/AnalyticsApi.java @@ -101,7 +101,8 @@ public void setApiClient(ApiClient apiClient) { } private okhttp3.Call getAggregatedMetricsCall(String metric, String aggregation, OffsetDateTime from, - OffsetDateTime to, FilterBy2 filterBy, final ApiCallback _callback) throws ApiException { + OffsetDateTime to, Boolean unique, String viewDuration, FilterBy2 filterBy, final ApiCallback _callback) + throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -123,6 +124,14 @@ private okhttp3.Call getAggregatedMetricsCall(String metric, String aggregation, localVarQueryParams.addAll(localVarApiClient.parameterToPair("to", to)); } + if (unique != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("unique", unique)); + } + + if (viewDuration != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("viewDuration", viewDuration)); + } + if (filterBy != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("filterBy", filterBy)); } @@ -145,7 +154,8 @@ private okhttp3.Call getAggregatedMetricsCall(String metric, String aggregation, @SuppressWarnings("rawtypes") private okhttp3.Call getAggregatedMetricsValidateBeforeCall(String metric, String aggregation, OffsetDateTime from, - OffsetDateTime to, FilterBy2 filterBy, final ApiCallback _callback) throws ApiException { + OffsetDateTime to, Boolean unique, String viewDuration, FilterBy2 filterBy, final ApiCallback _callback) + throws ApiException { // verify the required parameter 'metric' is set if (metric == null) { @@ -157,24 +167,26 @@ private okhttp3.Call getAggregatedMetricsValidateBeforeCall(String metric, Strin throw new ApiException("Missing the required parameter 'aggregation' when calling getAggregatedMetrics"); } - okhttp3.Call localVarCall = getAggregatedMetricsCall(metric, aggregation, from, to, filterBy, _callback); + okhttp3.Call localVarCall = getAggregatedMetricsCall(metric, aggregation, from, to, unique, viewDuration, + filterBy, _callback); return localVarCall; } private ApiResponse getAggregatedMetricsWithHttpInfo(String metric, - String aggregation, OffsetDateTime from, OffsetDateTime to, FilterBy2 filterBy) throws ApiException { - okhttp3.Call localVarCall = getAggregatedMetricsValidateBeforeCall(metric, aggregation, from, to, filterBy, - null); + String aggregation, OffsetDateTime from, OffsetDateTime to, Boolean unique, String viewDuration, + FilterBy2 filterBy) throws ApiException { + okhttp3.Call localVarCall = getAggregatedMetricsValidateBeforeCall(metric, aggregation, from, to, unique, + viewDuration, filterBy, null); Type localVarReturnType = new TypeToken() { }.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getAggregatedMetricsAsync(String metric, String aggregation, OffsetDateTime from, - OffsetDateTime to, FilterBy2 filterBy, final ApiCallback _callback) - throws ApiException { - okhttp3.Call localVarCall = getAggregatedMetricsValidateBeforeCall(metric, aggregation, from, to, filterBy, - _callback); + OffsetDateTime to, Boolean unique, String viewDuration, FilterBy2 filterBy, + final ApiCallback _callback) throws ApiException { + okhttp3.Call localVarCall = getAggregatedMetricsValidateBeforeCall(metric, aggregation, from, to, unique, + viewDuration, filterBy, _callback); Type localVarReturnType = new TypeToken() { }.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); @@ -186,6 +198,8 @@ public class APIgetAggregatedMetricsRequest { private final String aggregation; private OffsetDateTime from; private OffsetDateTime to; + private Boolean unique; + private String viewDuration; private FilterBy2 filterBy; private APIgetAggregatedMetricsRequest(String metric, String aggregation) { @@ -227,6 +241,41 @@ public APIgetAggregatedMetricsRequest to(OffsetDateTime to) { return this; } + /** + * Set unique + * + * @param unique + * Use this query parameter to control how viewer data is counted: - `true` means that a + * single user watching multiple times counts as 1 unique viewer - `false` means that all + * views count, even if from the same user. The API accepts this parameter only when you use the + * `ccv` or `view` metric. Viewers are unique for 1 day. The API determines + * uniqueness based on a viewer's `user-agent` and IP address. This means that the API + * can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter + * for viewers who use multiple browsers to watch the same content multiple times. (optional) + * + * @return APIgetAggregatedMetricsRequest + */ + public APIgetAggregatedMetricsRequest unique(Boolean unique) { + this.unique = unique; + return this; + } + + /** + * Set viewDuration + * + * @param viewDuration + * Use this query parameter to define how many seconds a view has to last to be counted in analytics + * data. - You can only use this parameter with the `view` metric. - The accepted values + * are `3s`, `5s`, `10s`, and `30s`. - If you do not set this + * parameter, the API defaults to `5s`. (optional) + * + * @return APIgetAggregatedMetricsRequest + */ + public APIgetAggregatedMetricsRequest viewDuration(String viewDuration) { + this.viewDuration = viewDuration; + return this; + } + /** * Set filterBy * @@ -255,7 +304,9 @@ public APIgetAggregatedMetricsRequest to(OffsetDateTime to) { * based on the browser used by the viewers. Response values can include `chrome`, * `firefox`, `edge`, `opera`. - `tag`: Returns analytics for * videos using this tag. This filter only accepts a single value and is case sensitive. Read more - * about tagging your videos [here](https://docs.api.video/vod/tags-metadata). (optional) + * about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - + * `referrer`: Filters data based on the URL where the view is originating from. Accepts an + * empty string as a value to filter view events where no referrer is available. (optional) * * @return APIgetAggregatedMetricsRequest */ @@ -325,7 +376,7 @@ public APIgetAggregatedMetricsRequest filterBy(FilterBy2 filterBy) { * */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getAggregatedMetricsCall(metric, aggregation, from, to, filterBy, _callback); + return getAggregatedMetricsCall(metric, aggregation, from, to, unique, viewDuration, filterBy, _callback); } /** @@ -387,7 +438,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { */ public AnalyticsAggregatedMetricsResponse execute() throws ApiException { ApiResponse localVarResp = getAggregatedMetricsWithHttpInfo(metric, - aggregation, from, to, filterBy); + aggregation, from, to, unique, viewDuration, filterBy); return localVarResp.getData(); } @@ -395,6 +446,8 @@ private APIgetAggregatedMetricsRequest copy() { APIgetAggregatedMetricsRequest copy = new APIgetAggregatedMetricsRequest(metric, aggregation); copy.from(from); copy.to(to); + copy.unique(unique); + copy.viewDuration(viewDuration); copy.filterBy(filterBy); return copy; } @@ -457,7 +510,7 @@ private APIgetAggregatedMetricsRequest copy() { * */ public ApiResponse executeWithHttpInfo() throws ApiException { - return getAggregatedMetricsWithHttpInfo(metric, aggregation, from, to, filterBy); + return getAggregatedMetricsWithHttpInfo(metric, aggregation, from, to, unique, viewDuration, filterBy); } /** @@ -522,7 +575,7 @@ public ApiResponse executeWithHttpInfo() thr */ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { - return getAggregatedMetricsAsync(metric, aggregation, from, to, filterBy, _callback); + return getAggregatedMetricsAsync(metric, aggregation, from, to, unique, viewDuration, filterBy, _callback); } } @@ -545,7 +598,9 @@ public okhttp3.Call executeAsync(final ApiCallback getMetricsBreakdownWithHttpInfo(String metric, - String breakdown, OffsetDateTime from, OffsetDateTime to, String sortBy, String sortOrder, - FilterBy2 filterBy, Integer currentPage, Integer pageSize) throws ApiException { + String breakdown, OffsetDateTime from, OffsetDateTime to, String sortBy, String sortOrder, Boolean unique, + String viewDuration, FilterBy2 filterBy, Integer currentPage, Integer pageSize) throws ApiException { okhttp3.Call localVarCall = getMetricsBreakdownValidateBeforeCall(metric, breakdown, from, to, sortBy, - sortOrder, filterBy, currentPage, pageSize, null); + sortOrder, unique, viewDuration, filterBy, currentPage, pageSize, null); Type localVarReturnType = new TypeToken() { }.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getMetricsBreakdownAsync(String metric, String breakdown, OffsetDateTime from, - OffsetDateTime to, String sortBy, String sortOrder, FilterBy2 filterBy, Integer currentPage, - Integer pageSize, final ApiCallback _callback) throws ApiException { + OffsetDateTime to, String sortBy, String sortOrder, Boolean unique, String viewDuration, FilterBy2 filterBy, + Integer currentPage, Integer pageSize, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getMetricsBreakdownValidateBeforeCall(metric, breakdown, from, to, sortBy, - sortOrder, filterBy, currentPage, pageSize, _callback); + sortOrder, unique, viewDuration, filterBy, currentPage, pageSize, _callback); Type localVarReturnType = new TypeToken() { }.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); @@ -718,6 +785,8 @@ public class APIgetMetricsBreakdownRequest { private OffsetDateTime to; private String sortBy; private String sortOrder; + private Boolean unique; + private String viewDuration; private FilterBy2 filterBy; private Integer currentPage; private Integer pageSize; @@ -791,6 +860,42 @@ public APIgetMetricsBreakdownRequest sortOrder(String sortOrder) { return this; } + /** + * Set unique + * + * @param unique + * Use this query parameter to control how viewer data is counted: - `true` means that a + * single user watching multiple times counts as 1 unique viewer - `false` means that all + * views count, even if from the same user. The API accepts this parameter only when you use the + * `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for + * 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP + * address. This means that the API can filter viewers using multiple tabs to watch the same video + * multiple times, but cannot filter for viewers who use multiple browsers to watch the same content + * multiple times. (optional) + * + * @return APIgetMetricsBreakdownRequest + */ + public APIgetMetricsBreakdownRequest unique(Boolean unique) { + this.unique = unique; + return this; + } + + /** + * Set viewDuration + * + * @param viewDuration + * Use this query parameter to define how many seconds a view has to last to be counted in analytics + * data. - You can only use this parameter together with the `view` metric. - The accepted + * values are `3s`, `5s`, `10s`, and `30s`. - If you do not + * set this parameter, the API defaults to `5s`. (optional) + * + * @return APIgetMetricsBreakdownRequest + */ + public APIgetMetricsBreakdownRequest viewDuration(String viewDuration) { + this.viewDuration = viewDuration; + return this; + } + /** * Set filterBy * @@ -819,7 +924,9 @@ public APIgetMetricsBreakdownRequest sortOrder(String sortOrder) { * based on the browser used by the viewers. Response values can include `chrome`, * `firefox`, `edge`, `opera`. - `tag`: Returns analytics for * videos using this tag. This filter only accepts a single value and is case sensitive. Read more - * about tagging your videos [here](https://docs.api.video/vod/tags-metadata). (optional) + * about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - + * `referrer`: Filters data based on the URL where the view is originating from. Accepts an + * empty string as a value to filter view events where no referrer is available. (optional) * * @return APIgetMetricsBreakdownRequest */ @@ -915,8 +1022,8 @@ public APIgetMetricsBreakdownRequest pageSize(Integer pageSize) { * */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getMetricsBreakdownCall(metric, breakdown, from, to, sortBy, sortOrder, filterBy, currentPage, - pageSize, _callback); + return getMetricsBreakdownCall(metric, breakdown, from, to, sortBy, sortOrder, unique, viewDuration, + filterBy, currentPage, pageSize, _callback); } /** @@ -978,7 +1085,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { */ public Page execute() throws ApiException { ApiResponse localVarResp = getMetricsBreakdownWithHttpInfo(metric, - breakdown, from, to, sortBy, sortOrder, filterBy, currentPage, pageSize); + breakdown, from, to, sortBy, sortOrder, unique, viewDuration, filterBy, currentPage, pageSize); return new Page<>(localVarResp.getData().getData(), localVarResp.getData().getPagination(), () -> { try { return copy().currentPage((currentPage == null ? 1 : currentPage) + 1).execute(); @@ -994,6 +1101,8 @@ private APIgetMetricsBreakdownRequest copy() { copy.to(to); copy.sortBy(sortBy); copy.sortOrder(sortOrder); + copy.unique(unique); + copy.viewDuration(viewDuration); copy.filterBy(filterBy); copy.currentPage(currentPage); copy.pageSize(pageSize); @@ -1058,8 +1167,8 @@ private APIgetMetricsBreakdownRequest copy() { * */ public ApiResponse executeWithHttpInfo() throws ApiException { - return getMetricsBreakdownWithHttpInfo(metric, breakdown, from, to, sortBy, sortOrder, filterBy, - currentPage, pageSize); + return getMetricsBreakdownWithHttpInfo(metric, breakdown, from, to, sortBy, sortOrder, unique, viewDuration, + filterBy, currentPage, pageSize); } /** @@ -1153,8 +1262,8 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) _callback.onDownloadProgress(bytesRead, contentLength, done); } }; - return getMetricsBreakdownAsync(metric, breakdown, from, to, sortBy, sortOrder, filterBy, currentPage, - pageSize, apiCallback); + return getMetricsBreakdownAsync(metric, breakdown, from, to, sortBy, sortOrder, unique, viewDuration, + filterBy, currentPage, pageSize, apiCallback); } } @@ -1172,7 +1281,9 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) * breakdown with this metric. - `start` is the number of times playback was started. - * `end` is the number of times playback has ended with the content watch until the end. - * `impression` is the number of times your content has been loaded and was ready for playback. - * (required) + * - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - + * `ccv-average` is the average number of concurrent viewers in the timeframe of your request. + * - `view` is the total number of viewers until this point in time. (required) * @param breakdown * Use this path parameter to define a dimension for segmenting analytics data. You must use * `kebab-case` for path parameters. These are the available dimensions: - @@ -1190,7 +1301,9 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) * the operating system used by the viewers. Response values can include `windows`, `mac * osx`, `android`, `ios`, `linux`. - `browser`: Returns * analytics based on the browser used by the viewers. Response values can include `chrome`, - * `firefox`, `edge`, `opera`. (required) + * `firefox`, `edge`, `opera`. - `referrer`: Returns the URL + * where the view originates from, for example a website where the video is embedded. View events from + * Android and iOS return empty strings as the value for `referrer`. (required) * * @return APIgetMetricsBreakdownRequest * @@ -1248,8 +1361,8 @@ public APIgetMetricsBreakdownRequest getMetricsBreakdown(String metric, String b } private okhttp3.Call getMetricsOverTimeCall(String metric, OffsetDateTime from, OffsetDateTime to, String interval, - String sortBy, String sortOrder, FilterBy2 filterBy, Integer currentPage, Integer pageSize, - final ApiCallback _callback) throws ApiException { + String sortBy, String sortOrder, Boolean unique, String viewDuration, FilterBy2 filterBy, + Integer currentPage, Integer pageSize, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -1282,6 +1395,14 @@ private okhttp3.Call getMetricsOverTimeCall(String metric, OffsetDateTime from, localVarQueryParams.addAll(localVarApiClient.parameterToPair("sortOrder", sortOrder)); } + if (unique != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("unique", unique)); + } + + if (viewDuration != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("viewDuration", viewDuration)); + } + if (filterBy != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("filterBy", filterBy)); } @@ -1312,34 +1433,35 @@ private okhttp3.Call getMetricsOverTimeCall(String metric, OffsetDateTime from, @SuppressWarnings("rawtypes") private okhttp3.Call getMetricsOverTimeValidateBeforeCall(String metric, OffsetDateTime from, OffsetDateTime to, - String interval, String sortBy, String sortOrder, FilterBy2 filterBy, Integer currentPage, Integer pageSize, - final ApiCallback _callback) throws ApiException { + String interval, String sortBy, String sortOrder, Boolean unique, String viewDuration, FilterBy2 filterBy, + Integer currentPage, Integer pageSize, final ApiCallback _callback) throws ApiException { // verify the required parameter 'metric' is set if (metric == null) { throw new ApiException("Missing the required parameter 'metric' when calling getMetricsOverTime"); } - okhttp3.Call localVarCall = getMetricsOverTimeCall(metric, from, to, interval, sortBy, sortOrder, filterBy, - currentPage, pageSize, _callback); + okhttp3.Call localVarCall = getMetricsOverTimeCall(metric, from, to, interval, sortBy, sortOrder, unique, + viewDuration, filterBy, currentPage, pageSize, _callback); return localVarCall; } private ApiResponse getMetricsOverTimeWithHttpInfo(String metric, - OffsetDateTime from, OffsetDateTime to, String interval, String sortBy, String sortOrder, - FilterBy2 filterBy, Integer currentPage, Integer pageSize) throws ApiException { + OffsetDateTime from, OffsetDateTime to, String interval, String sortBy, String sortOrder, Boolean unique, + String viewDuration, FilterBy2 filterBy, Integer currentPage, Integer pageSize) throws ApiException { okhttp3.Call localVarCall = getMetricsOverTimeValidateBeforeCall(metric, from, to, interval, sortBy, sortOrder, - filterBy, currentPage, pageSize, null); + unique, viewDuration, filterBy, currentPage, pageSize, null); Type localVarReturnType = new TypeToken() { }.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getMetricsOverTimeAsync(String metric, OffsetDateTime from, OffsetDateTime to, String interval, - String sortBy, String sortOrder, FilterBy2 filterBy, Integer currentPage, Integer pageSize, - final ApiCallback _callback) throws ApiException { + String sortBy, String sortOrder, Boolean unique, String viewDuration, FilterBy2 filterBy, + Integer currentPage, Integer pageSize, final ApiCallback _callback) + throws ApiException { okhttp3.Call localVarCall = getMetricsOverTimeValidateBeforeCall(metric, from, to, interval, sortBy, sortOrder, - filterBy, currentPage, pageSize, _callback); + unique, viewDuration, filterBy, currentPage, pageSize, _callback); Type localVarReturnType = new TypeToken() { }.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); @@ -1353,6 +1475,8 @@ public class APIgetMetricsOverTimeRequest { private String interval; private String sortBy; private String sortOrder; + private Boolean unique; + private String viewDuration; private FilterBy2 filterBy; private Integer currentPage; private Integer pageSize; @@ -1397,12 +1521,13 @@ public APIgetMetricsOverTimeRequest to(OffsetDateTime to) { * Set interval * * @param 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) + * Use this query parameter to define the granularity of the data. Possible values: + * `minute`, `hour`, `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`. - When you set `minute` as interval, the + * timeframe you define with the `from` and `to` parameters must be less than 60 + * minutes. (optional) * * @return APIgetMetricsOverTimeRequest */ @@ -1443,6 +1568,42 @@ public APIgetMetricsOverTimeRequest sortOrder(String sortOrder) { return this; } + /** + * Set unique + * + * @param unique + * Use this query parameter to control how viewer data is counted: - `true` means that a + * single user watching multiple times counts as 1 unique viewer - `false` means that all + * views count, even if from the same user. The API accepts this parameter only when you use the + * `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for + * 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP + * address. This means that the API can filter viewers using multiple tabs to watch the same video + * multiple times, but cannot filter for viewers who use multiple browsers to watch the same content + * multiple times. (optional) + * + * @return APIgetMetricsOverTimeRequest + */ + public APIgetMetricsOverTimeRequest unique(Boolean unique) { + this.unique = unique; + return this; + } + + /** + * Set viewDuration + * + * @param viewDuration + * Use this query parameter to define how many seconds a view has to last to be counted in analytics + * data. - You can only use this parameter together with the `view` metric. - The accepted + * values are `3s`, `5s`, `10s`, and `30s`. - If you do not + * set this parameter, the API defaults to `5s`. (optional) + * + * @return APIgetMetricsOverTimeRequest + */ + public APIgetMetricsOverTimeRequest viewDuration(String viewDuration) { + this.viewDuration = viewDuration; + return this; + } + /** * Set filterBy * @@ -1471,7 +1632,9 @@ public APIgetMetricsOverTimeRequest sortOrder(String sortOrder) { * based on the browser used by the viewers. Response values can include `chrome`, * `firefox`, `edge`, `opera`. - `tag`: Returns analytics for * videos using this tag. This filter only accepts a single value and is case sensitive. Read more - * about tagging your videos [here](https://docs.api.video/vod/tags-metadata). (optional) + * about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - + * `referrer`: Filters data based on the URL where the view is originating from. Accepts an + * empty string as a value to filter view events where no referrer is available. (optional) * * @return APIgetMetricsOverTimeRequest */ @@ -1567,8 +1730,8 @@ public APIgetMetricsOverTimeRequest pageSize(Integer pageSize) { * */ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { - return getMetricsOverTimeCall(metric, from, to, interval, sortBy, sortOrder, filterBy, currentPage, - pageSize, _callback); + return getMetricsOverTimeCall(metric, from, to, interval, sortBy, sortOrder, unique, viewDuration, filterBy, + currentPage, pageSize, _callback); } /** @@ -1630,7 +1793,7 @@ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { */ public Page execute() throws ApiException { ApiResponse localVarResp = getMetricsOverTimeWithHttpInfo(metric, from, - to, interval, sortBy, sortOrder, filterBy, currentPage, pageSize); + to, interval, sortBy, sortOrder, unique, viewDuration, filterBy, currentPage, pageSize); return new Page<>(localVarResp.getData().getData(), localVarResp.getData().getPagination(), () -> { try { return copy().currentPage((currentPage == null ? 1 : currentPage) + 1).execute(); @@ -1647,6 +1810,8 @@ private APIgetMetricsOverTimeRequest copy() { copy.interval(interval); copy.sortBy(sortBy); copy.sortOrder(sortOrder); + copy.unique(unique); + copy.viewDuration(viewDuration); copy.filterBy(filterBy); copy.currentPage(currentPage); copy.pageSize(pageSize); @@ -1711,8 +1876,8 @@ private APIgetMetricsOverTimeRequest copy() { * */ public ApiResponse executeWithHttpInfo() throws ApiException { - return getMetricsOverTimeWithHttpInfo(metric, from, to, interval, sortBy, sortOrder, filterBy, currentPage, - pageSize); + return getMetricsOverTimeWithHttpInfo(metric, from, to, interval, sortBy, sortOrder, unique, viewDuration, + filterBy, currentPage, pageSize); } /** @@ -1806,8 +1971,8 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) _callback.onDownloadProgress(bytesRead, contentLength, done); } }; - return getMetricsOverTimeAsync(metric, from, to, interval, sortBy, sortOrder, filterBy, currentPage, - pageSize, apiCallback); + return getMetricsOverTimeAsync(metric, from, to, interval, sortBy, sortOrder, unique, viewDuration, + filterBy, currentPage, pageSize, apiCallback); } } @@ -1822,7 +1987,10 @@ public void onDownloadProgress(long bytesRead, long contentLength, boolean done) * 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) + * loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers + * in the timeframe of your request. - `ccv-average` is the average number of concurrent + * viewers in the timeframe of your request. - `view` is the total number of viewers. + * (required) * * @return APIgetMetricsOverTimeRequest * diff --git a/src/main/java/video/api/client/api/models/AnalyticsAggregatedMetricsResponseContext.java b/src/main/java/video/api/client/api/models/AnalyticsAggregatedMetricsResponseContext.java index 87a0b6e..3cfd4e0 100644 --- a/src/main/java/video/api/client/api/models/AnalyticsAggregatedMetricsResponseContext.java +++ b/src/main/java/video/api/client/api/models/AnalyticsAggregatedMetricsResponseContext.java @@ -32,7 +32,7 @@ public class AnalyticsAggregatedMetricsResponseContext implements Serializable, private static final long serialVersionUID = 1L; /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. */ @JsonAdapter(MetricEnum.Adapter.class) public enum MetricEnum { @@ -46,7 +46,29 @@ public enum MetricEnum { IMPRESSION_TIME("impression-time"), - WATCH_TIME("watch-time"); + WATCH_TIME("watch-time"), + + CCV("ccv"), + + UNIQUE_CCV("unique-ccv"), + + VIEW_3("view-3"), + + VIEW_5("view-5"), + + VIEW_10("view-10"), + + VIEW_30("view-30"), + + UNIQUE_VIEW("unique-view"), + + UNIQUE_VIEW_3("unique-view-3"), + + UNIQUE_VIEW_5("unique-view-5"), + + UNIQUE_VIEW_10("unique-view-10"), + + UNIQUE_VIEW_30("unique-view-30"); private String value; @@ -157,12 +179,12 @@ public AnalyticsAggregatedMetricsResponseContext metric(MetricEnum metric) { } /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. * * @return metric **/ @javax.annotation.Nullable - @ApiModelProperty(example = "impression", value = "Returns the metric you selected.") + @ApiModelProperty(example = "impression", value = "Returns the metric and relevant parameters you selected.") public MetricEnum getMetric() { return metric; diff --git a/src/main/java/video/api/client/api/models/AnalyticsMetricsBreakdownResponseContext.java b/src/main/java/video/api/client/api/models/AnalyticsMetricsBreakdownResponseContext.java index 6fc3e24..4ad06b1 100644 --- a/src/main/java/video/api/client/api/models/AnalyticsMetricsBreakdownResponseContext.java +++ b/src/main/java/video/api/client/api/models/AnalyticsMetricsBreakdownResponseContext.java @@ -32,7 +32,7 @@ public class AnalyticsMetricsBreakdownResponseContext implements Serializable, D private static final long serialVersionUID = 1L; /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. */ @JsonAdapter(MetricEnum.Adapter.class) public enum MetricEnum { @@ -44,7 +44,33 @@ public enum MetricEnum { END("end"), - IMPRESSION("impression"); + IMPRESSION("impression"), + + CCV_AVERAGE("ccv-average"), + + CCV_PEAK("ccv-peak"), + + UNIQUE_CCV_AVERAGE("unique-ccv-average"), + + UNIQUE_CCV_PEAK("unique-ccv-peak"), + + VIEW_3("view-3"), + + VIEW_5("view-5"), + + VIEW_10("view-10"), + + VIEW_30("view-30"), + + UNIQUE_VIEW("unique-view"), + + UNIQUE_VIEW_3("unique-view-3"), + + UNIQUE_VIEW_5("unique-view-5"), + + UNIQUE_VIEW_10("unique-view-10"), + + UNIQUE_VIEW_30("unique-view-30"); private String value; @@ -159,12 +185,12 @@ public AnalyticsMetricsBreakdownResponseContext metric(MetricEnum metric) { } /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. * * @return metric **/ @javax.annotation.Nullable - @ApiModelProperty(example = "impression", value = "Returns the metric you selected.") + @ApiModelProperty(example = "impression", value = "Returns the metric and relevant parameters you selected.") public MetricEnum getMetric() { return metric; diff --git a/src/main/java/video/api/client/api/models/AnalyticsMetricsOverTimeResponse.java b/src/main/java/video/api/client/api/models/AnalyticsMetricsOverTimeResponse.java index 1c929f2..6bcfbbe 100644 --- a/src/main/java/video/api/client/api/models/AnalyticsMetricsOverTimeResponse.java +++ b/src/main/java/video/api/client/api/models/AnalyticsMetricsOverTimeResponse.java @@ -78,11 +78,11 @@ public AnalyticsMetricsOverTimeResponse addDataItem(AnalyticsMetricsOverTimeResp } /** - * Returns an array of metrics and the timestamps . + * Returns an array of metrics and the timestamps. * * @return data **/ - @ApiModelProperty(required = true, value = "Returns an array of metrics and the timestamps .") + @ApiModelProperty(required = true, value = "Returns an array of metrics and the timestamps.") public List getData() { return data; diff --git a/src/main/java/video/api/client/api/models/AnalyticsMetricsOverTimeResponseContext.java b/src/main/java/video/api/client/api/models/AnalyticsMetricsOverTimeResponseContext.java index 5ecca68..1531888 100644 --- a/src/main/java/video/api/client/api/models/AnalyticsMetricsOverTimeResponseContext.java +++ b/src/main/java/video/api/client/api/models/AnalyticsMetricsOverTimeResponseContext.java @@ -32,7 +32,7 @@ public class AnalyticsMetricsOverTimeResponseContext implements Serializable, De private static final long serialVersionUID = 1L; /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. */ @JsonAdapter(MetricEnum.Adapter.class) public enum MetricEnum { @@ -44,7 +44,33 @@ public enum MetricEnum { END("end"), - IMPRESSION("impression"); + IMPRESSION("impression"), + + CCV_AVERAGE("ccv-average"), + + CCV_PEAK("ccv-peak"), + + UNIQUE_CCV_AVERAGE("unique-ccv-average"), + + UNIQUE_CCV_PEAK("unique-ccv-peak"), + + VIEW_3("view-3"), + + VIEW_5("view-5"), + + VIEW_10("view-10"), + + VIEW_30("view-30"), + + UNIQUE_VIEW("unique-view"), + + UNIQUE_VIEW_3("unique-view-3"), + + UNIQUE_VIEW_5("unique-view-5"), + + UNIQUE_VIEW_10("unique-view-10"), + + UNIQUE_VIEW_30("unique-view-30"); private String value; @@ -93,6 +119,8 @@ public MetricEnum read(final JsonReader jsonReader) throws IOException { */ @JsonAdapter(IntervalEnum.Adapter.class) public enum IntervalEnum { + MINUTE("minute"), + HOUR("hour"), DAY("day"); @@ -149,12 +177,12 @@ public AnalyticsMetricsOverTimeResponseContext metric(MetricEnum metric) { } /** - * Returns the metric you selected. + * Returns the metric and relevant parameters you selected. * * @return metric **/ @javax.annotation.Nullable - @ApiModelProperty(example = "impression", value = "Returns the metric you selected.") + @ApiModelProperty(example = "impression", value = "Returns the metric and relevant parameters you selected.") public MetricEnum getMetric() { return metric; diff --git a/src/main/java/video/api/client/api/models/FilterBy.java b/src/main/java/video/api/client/api/models/FilterBy.java index 6ba7791..b120171 100644 --- a/src/main/java/video/api/client/api/models/FilterBy.java +++ b/src/main/java/video/api/client/api/models/FilterBy.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.net.URI; import java.util.ArrayList; import java.util.List; import java.io.Serializable; @@ -168,6 +169,10 @@ public ContinentEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TAG) private String tag; + public static final String SERIALIZED_NAME_REFERRER = "referrer"; + @SerializedName(SERIALIZED_NAME_REFERRER) + private List referrer = null; + public FilterBy mediaId(List mediaId) { this.mediaId = mediaId; return this; @@ -393,6 +398,37 @@ public void setTag(String tag) { this.tag = tag; } + public FilterBy referrer(List referrer) { + this.referrer = referrer; + return this; + } + + public FilterBy addReferrerItem(URI referrerItem) { + if (this.referrer == null) { + this.referrer = new ArrayList<>(); + } + this.referrer.add(referrerItem); + return this; + } + + /** + * Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string + * to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing + * `/` characters if needed. - The URLs you add must be URL encoded. + * + * @return referrer + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "[\"https%3A%2F%2Fmy-awesome-videos.com\"]", value = "Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded.") + + public List getReferrer() { + return referrer; + } + + public void setReferrer(List referrer) { + this.referrer = referrer; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -406,12 +442,14 @@ public boolean equals(Object o) { && Objects.equals(this.continent, filterBy.continent) && Objects.equals(this.country, filterBy.country) && Objects.equals(this.deviceType, filterBy.deviceType) && Objects.equals(this.operatingSystem, filterBy.operatingSystem) - && Objects.equals(this.browser, filterBy.browser) && Objects.equals(this.tag, filterBy.tag); + && Objects.equals(this.browser, filterBy.browser) && Objects.equals(this.tag, filterBy.tag) + && Objects.equals(this.referrer, filterBy.referrer); } @Override public int hashCode() { - return Objects.hash(mediaId, mediaType, continent, country, deviceType, operatingSystem, browser, tag); + return Objects.hash(mediaId, mediaType, continent, country, deviceType, operatingSystem, browser, tag, + referrer); } @Override @@ -426,6 +464,7 @@ public String toString() { sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); sb.append(" browser: ").append(toIndentedString(browser)).append("\n"); sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" referrer: ").append(toIndentedString(referrer)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/video/api/client/api/models/FilterBy1.java b/src/main/java/video/api/client/api/models/FilterBy1.java index 3d13324..3139133 100644 --- a/src/main/java/video/api/client/api/models/FilterBy1.java +++ b/src/main/java/video/api/client/api/models/FilterBy1.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.net.URI; import java.util.ArrayList; import java.util.List; import java.io.Serializable; @@ -168,6 +169,10 @@ public ContinentEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TAG) private String tag; + public static final String SERIALIZED_NAME_REFERRER = "referrer"; + @SerializedName(SERIALIZED_NAME_REFERRER) + private List referrer = null; + public FilterBy1 mediaId(List mediaId) { this.mediaId = mediaId; return this; @@ -393,6 +398,37 @@ public void setTag(String tag) { this.tag = tag; } + public FilterBy1 referrer(List referrer) { + this.referrer = referrer; + return this; + } + + public FilterBy1 addReferrerItem(URI referrerItem) { + if (this.referrer == null) { + this.referrer = new ArrayList<>(); + } + this.referrer.add(referrerItem); + return this; + } + + /** + * Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string + * to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing + * `/` characters if needed. - The URLs you add must be URL encoded. + * + * @return referrer + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "[\"https%3A%2F%2Fmy-awesome-videos.com\"]", value = "Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded.") + + public List getReferrer() { + return referrer; + } + + public void setReferrer(List referrer) { + this.referrer = referrer; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -407,12 +443,14 @@ public boolean equals(Object o) { && Objects.equals(this.country, filterBy1.country) && Objects.equals(this.deviceType, filterBy1.deviceType) && Objects.equals(this.operatingSystem, filterBy1.operatingSystem) - && Objects.equals(this.browser, filterBy1.browser) && Objects.equals(this.tag, filterBy1.tag); + && Objects.equals(this.browser, filterBy1.browser) && Objects.equals(this.tag, filterBy1.tag) + && Objects.equals(this.referrer, filterBy1.referrer); } @Override public int hashCode() { - return Objects.hash(mediaId, mediaType, continent, country, deviceType, operatingSystem, browser, tag); + return Objects.hash(mediaId, mediaType, continent, country, deviceType, operatingSystem, browser, tag, + referrer); } @Override @@ -427,6 +465,7 @@ public String toString() { sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); sb.append(" browser: ").append(toIndentedString(browser)).append("\n"); sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" referrer: ").append(toIndentedString(referrer)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/video/api/client/api/models/FilterBy2.java b/src/main/java/video/api/client/api/models/FilterBy2.java index 49121a1..a9961e5 100644 --- a/src/main/java/video/api/client/api/models/FilterBy2.java +++ b/src/main/java/video/api/client/api/models/FilterBy2.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.net.URI; import java.util.ArrayList; import java.util.List; import java.io.Serializable; @@ -168,6 +169,10 @@ public ContinentEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_TAG) private String tag; + public static final String SERIALIZED_NAME_REFERRER = "referrer"; + @SerializedName(SERIALIZED_NAME_REFERRER) + private List referrer = null; + public FilterBy2 mediaId(List mediaId) { this.mediaId = mediaId; return this; @@ -393,6 +398,37 @@ public void setTag(String tag) { this.tag = tag; } + public FilterBy2 referrer(List referrer) { + this.referrer = referrer; + return this; + } + + public FilterBy2 addReferrerItem(URI referrerItem) { + if (this.referrer == null) { + this.referrer = new ArrayList<>(); + } + this.referrer.add(referrerItem); + return this; + } + + /** + * Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string + * to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing + * `/` characters if needed. - The URLs you add must be URL encoded. + * + * @return referrer + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "[\"https%3A%2F%2Fmy-awesome-videos.com\"]", value = "Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded.") + + public List getReferrer() { + return referrer; + } + + public void setReferrer(List referrer) { + this.referrer = referrer; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -407,12 +443,14 @@ public boolean equals(Object o) { && Objects.equals(this.country, filterBy2.country) && Objects.equals(this.deviceType, filterBy2.deviceType) && Objects.equals(this.operatingSystem, filterBy2.operatingSystem) - && Objects.equals(this.browser, filterBy2.browser) && Objects.equals(this.tag, filterBy2.tag); + && Objects.equals(this.browser, filterBy2.browser) && Objects.equals(this.tag, filterBy2.tag) + && Objects.equals(this.referrer, filterBy2.referrer); } @Override public int hashCode() { - return Objects.hash(mediaId, mediaType, continent, country, deviceType, operatingSystem, browser, tag); + return Objects.hash(mediaId, mediaType, continent, country, deviceType, operatingSystem, browser, tag, + referrer); } @Override @@ -427,6 +465,7 @@ public String toString() { sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); sb.append(" browser: ").append(toIndentedString(browser)).append("\n"); sb.append(" tag: ").append(toIndentedString(tag)).append("\n"); + sb.append(" referrer: ").append(toIndentedString(referrer)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/test/resources/payloads/analytics/getAggregatedMetrics/responses/400-2.json b/src/test/resources/payloads/analytics/getAggregatedMetrics/responses/400-2.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/src/test/resources/payloads/analytics/getAggregatedMetrics/responses/400-2.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 value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/src/test/resources/payloads/analytics/getAggregatedMetrics/responses/400-3.json b/src/test/resources/payloads/analytics/getAggregatedMetrics/responses/400-3.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/src/test/resources/payloads/analytics/getAggregatedMetrics/responses/400-3.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 view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file diff --git a/src/test/resources/payloads/analytics/getMetricsBreakdown/responses/400-2.json b/src/test/resources/payloads/analytics/getMetricsBreakdown/responses/400-2.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/src/test/resources/payloads/analytics/getMetricsBreakdown/responses/400-2.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 value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/src/test/resources/payloads/analytics/getMetricsBreakdown/responses/400-3.json b/src/test/resources/payloads/analytics/getMetricsBreakdown/responses/400-3.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/src/test/resources/payloads/analytics/getMetricsBreakdown/responses/400-3.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 view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file diff --git a/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-2.json b/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-2.json new file mode 100644 index 0000000..f7c9d42 --- /dev/null +++ b/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-2.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 interval is invalid. Use one of \"minute\", \"hour\", \"day\".", + "name" : "interval" +} \ No newline at end of file diff --git a/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-3.json b/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-3.json new file mode 100644 index 0000000..333be94 --- /dev/null +++ b/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-3.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 interval cannot be used with a timeframe over 60 minutes.", + "name" : "interval" +} \ No newline at end of file diff --git a/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-4.json b/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-4.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-4.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 value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-5.json b/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-5.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/src/test/resources/payloads/analytics/getMetricsOverTime/responses/400-5.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 view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file