From 8cb04fafdd1358dd295cc51d182071054ae4f0ec Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Mon, 4 Nov 2024 08:01:33 +0000 Subject: [PATCH] Analytics updates --- CHANGELOG.md | 3 + api/openapi.yaml | 371 +++++++++++++++++- api_analytics.go | 124 ++++-- client.go | 4 +- docs/Analytics.md | 48 ++- ...alyticsAggregatedMetricsResponseContext.md | 2 +- ...nalyticsMetricsBreakdownResponseContext.md | 2 +- docs/AnalyticsMetricsOverTimeResponse.md | 2 +- ...AnalyticsMetricsOverTimeResponseContext.md | 2 +- docs/FilterBy.md | 26 ++ docs/FilterBy1.md | 26 ++ docs/FilterBy2.md | 26 ++ ...ics_aggregated_metrics_response_context.go | 2 +- ...tics_metrics_breakdown_response_context.go | 2 +- model_analytics_metrics_over_time_response.go | 2 +- ...tics_metrics_over_time_response_context.go | 2 +- model_filter_by.go | 34 ++ model_filter_by_1.go | 34 ++ model_filter_by_2.go | 34 ++ 19 files changed, 659 insertions(+), 87 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b024b44..cddc015 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/api/openapi.yaml b/api/openapi.yaml index ee6593c..6abbd04 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -12749,6 +12749,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 @@ -12761,6 +12763,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\ @@ -12770,7 +12774,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 @@ -12782,6 +12790,8 @@ paths: - total - average - sum + - peak + - live type: string style: simple - description: | @@ -12815,6 +12825,41 @@ 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 watchig 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" + 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\ @@ -12841,7 +12886,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 @@ -12923,6 +12971,17 @@ 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. + example: + - http://my.list/of-videos + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true style: deepObject @@ -12989,6 +13048,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 @@ -13165,6 +13242,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 @@ -13177,6 +13257,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\ @@ -13196,7 +13279,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 referrer.\n" explode: false in: path name: breakdown @@ -13210,6 +13296,7 @@ paths: - device-type - operating-system - browser + - referrer type: string style: simple - description: | @@ -13277,6 +13364,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 watchig 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\ @@ -13303,7 +13424,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 @@ -13385,6 +13509,17 @@ 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. + example: + - http://my.list/of-videos + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true style: deepObject @@ -13487,6 +13622,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 @@ -13652,14 +13805,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 @@ -13671,6 +13826,9 @@ paths: - start - end - impression + - ccv-peak + - ccv-average + - view type: string style: simple - description: | @@ -13703,11 +13861,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 should be less than 60 minutes. example: hour explode: false in: query @@ -13715,6 +13872,7 @@ paths: required: false schema: enum: + - minute - hour - day type: string @@ -13755,6 +13913,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 watchig 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\ @@ -13781,7 +13973,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 @@ -13863,6 +14058,17 @@ 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. + example: + - http://my.list/of-videos + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true style: deepObject @@ -13969,6 +14175,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 @@ -15102,7 +15346,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 @@ -15183,6 +15430,17 @@ 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. + example: + - http://my.list/of-videos + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true style: deepObject @@ -17437,7 +17695,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 @@ -17871,6 +18129,17 @@ 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. + example: + - http://my.list/of-videos + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true filterBy_1: @@ -17947,6 +18216,17 @@ 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. + example: + - http://my.list/of-videos + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true filterBy_2: @@ -18023,6 +18303,17 @@ 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. + example: + - http://my.list/of-videos + items: + format: uri + maxLength: 2048 + type: string + type: array type: object x-is-deep-object: true list_tags_response_data: @@ -18080,7 +18371,7 @@ components: aggregation: count properties: metric: - description: Returns the metric you selected. + description: Returns the metric and relevant parameters you selected. enum: - play - start @@ -18088,6 +18379,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: @@ -18112,13 +18414,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: @@ -18160,18 +18475,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/api_analytics.go b/api_analytics.go index 43d1141..20cb8e3 100644 --- a/api_analytics.go +++ b/api_analytics.go @@ -24,9 +24,11 @@ var ( ) type AnalyticsApiGetAggregatedMetricsRequest struct { - from *time.Time - to *time.Time - filterBy *FilterBy2 + from *time.Time + to *time.Time + unique *bool + viewDuration *string + filterBy *FilterBy2 } func (r AnalyticsApiGetAggregatedMetricsRequest) From(from time.Time) AnalyticsApiGetAggregatedMetricsRequest { @@ -37,19 +39,29 @@ func (r AnalyticsApiGetAggregatedMetricsRequest) To(to time.Time) AnalyticsApiGe r.to = &to return r } +func (r AnalyticsApiGetAggregatedMetricsRequest) Unique(unique bool) AnalyticsApiGetAggregatedMetricsRequest { + r.unique = &unique + return r +} +func (r AnalyticsApiGetAggregatedMetricsRequest) ViewDuration(viewDuration string) AnalyticsApiGetAggregatedMetricsRequest { + r.viewDuration = &viewDuration + return r +} func (r AnalyticsApiGetAggregatedMetricsRequest) FilterBy(filterBy FilterBy2) AnalyticsApiGetAggregatedMetricsRequest { r.filterBy = &filterBy return r } type AnalyticsApiGetMetricsBreakdownRequest struct { - from *time.Time - to *time.Time - sortBy *string - sortOrder *string - filterBy *FilterBy2 - currentPage *int32 - pageSize *int32 + from *time.Time + to *time.Time + sortBy *string + sortOrder *string + unique *bool + viewDuration *string + filterBy *FilterBy2 + currentPage *int32 + pageSize *int32 } func (r AnalyticsApiGetMetricsBreakdownRequest) From(from time.Time) AnalyticsApiGetMetricsBreakdownRequest { @@ -68,6 +80,14 @@ func (r AnalyticsApiGetMetricsBreakdownRequest) SortOrder(sortOrder string) Anal r.sortOrder = &sortOrder return r } +func (r AnalyticsApiGetMetricsBreakdownRequest) Unique(unique bool) AnalyticsApiGetMetricsBreakdownRequest { + r.unique = &unique + return r +} +func (r AnalyticsApiGetMetricsBreakdownRequest) ViewDuration(viewDuration string) AnalyticsApiGetMetricsBreakdownRequest { + r.viewDuration = &viewDuration + return r +} func (r AnalyticsApiGetMetricsBreakdownRequest) FilterBy(filterBy FilterBy2) AnalyticsApiGetMetricsBreakdownRequest { r.filterBy = &filterBy return r @@ -82,14 +102,16 @@ func (r AnalyticsApiGetMetricsBreakdownRequest) PageSize(pageSize int32) Analyti } type AnalyticsApiGetMetricsOverTimeRequest struct { - from *time.Time - to *time.Time - interval *string - sortBy *string - sortOrder *string - filterBy *FilterBy2 - currentPage *int32 - pageSize *int32 + from *time.Time + to *time.Time + interval *string + sortBy *string + sortOrder *string + unique *bool + viewDuration *string + filterBy *FilterBy2 + currentPage *int32 + pageSize *int32 } func (r AnalyticsApiGetMetricsOverTimeRequest) From(from time.Time) AnalyticsApiGetMetricsOverTimeRequest { @@ -112,6 +134,14 @@ func (r AnalyticsApiGetMetricsOverTimeRequest) SortOrder(sortOrder string) Analy r.sortOrder = &sortOrder return r } +func (r AnalyticsApiGetMetricsOverTimeRequest) Unique(unique bool) AnalyticsApiGetMetricsOverTimeRequest { + r.unique = &unique + return r +} +func (r AnalyticsApiGetMetricsOverTimeRequest) ViewDuration(viewDuration string) AnalyticsApiGetMetricsOverTimeRequest { + r.viewDuration = &viewDuration + return r +} func (r AnalyticsApiGetMetricsOverTimeRequest) FilterBy(filterBy FilterBy2) AnalyticsApiGetMetricsOverTimeRequest { r.filterBy = &filterBy return r @@ -128,8 +158,8 @@ func (r AnalyticsApiGetMetricsOverTimeRequest) PageSize(pageSize int32) Analytic type AnalyticsServiceI interface { /* * GetAggregatedMetrics Retrieve aggregated metrics - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - * @param aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `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. + * @param aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `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. * @return AnalyticsApiGetAggregatedMetricsRequest */ @@ -138,8 +168,8 @@ type AnalyticsServiceI interface { /* * GetAggregatedMetrics Retrieve aggregated metrics * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - * @param aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `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. + * @param aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `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. * @return AnalyticsApiGetAggregatedMetricsRequest */ @@ -147,8 +177,8 @@ type AnalyticsServiceI interface { /* * GetMetricsBreakdown Retrieve metrics in a breakdown of dimensions - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - * @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: - `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`. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. + * @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: - `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 referrer. * @return AnalyticsApiGetMetricsBreakdownRequest */ @@ -157,8 +187,8 @@ type AnalyticsServiceI interface { /* * GetMetricsBreakdown Retrieve metrics in a breakdown of dimensions * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - * @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: - `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`. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. + * @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: - `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 referrer. * @return AnalyticsApiGetMetricsBreakdownRequest */ @@ -166,7 +196,7 @@ type AnalyticsServiceI interface { /* * GetMetricsOverTime Retrieve metrics over time - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. * @return AnalyticsApiGetMetricsOverTimeRequest */ @@ -175,7 +205,7 @@ type AnalyticsServiceI interface { /* * GetMetricsOverTime Retrieve metrics over time * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. * @return AnalyticsApiGetMetricsOverTimeRequest */ @@ -192,8 +222,8 @@ type AnalyticsService struct { * GetAggregatedMetrics Retrieve aggregated metrics * Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - * @param aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `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. + * @param aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `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. * @return AnalyticsApiGetAggregatedMetricsRequest */ @@ -207,8 +237,8 @@ func (s *AnalyticsService) GetAggregatedMetrics(metric string, aggregation strin * GetAggregatedMetrics Retrieve aggregated metrics * Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - * @param aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `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. + * @param aggregation Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `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. * @return AnalyticsApiGetAggregatedMetricsRequest */ @@ -228,6 +258,12 @@ func (s *AnalyticsService) GetAggregatedMetricsWithContext(ctx context.Context, if r.to != nil { localVarQueryParams.Add("to", parameterToString(*r.to, "")) } + if r.unique != nil { + localVarQueryParams.Add("unique", parameterToString(*r.unique, "")) + } + if r.viewDuration != nil { + localVarQueryParams.Add("viewDuration", parameterToString(*r.viewDuration, "")) + } if r.filterBy != nil { addDeepQueryParams(r.filterBy, "filterBy", localVarQueryParams) } @@ -252,8 +288,8 @@ func (s *AnalyticsService) GetAggregatedMetricsWithContext(ctx context.Context, * GetMetricsBreakdown Retrieve metrics in a breakdown of dimensions * Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - * @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: - `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`. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. + * @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: - `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 referrer. * @return AnalyticsApiGetMetricsBreakdownRequest */ @@ -267,8 +303,8 @@ func (s *AnalyticsService) GetMetricsBreakdown(metric string, breakdown string, * GetMetricsBreakdown Retrieve metrics in a breakdown of dimensions * Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - * @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: - `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`. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. + * @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: - `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 referrer. * @return AnalyticsApiGetMetricsBreakdownRequest */ @@ -294,6 +330,12 @@ func (s *AnalyticsService) GetMetricsBreakdownWithContext(ctx context.Context, m if r.sortOrder != nil { localVarQueryParams.Add("sortOrder", parameterToString(*r.sortOrder, "")) } + if r.unique != nil { + localVarQueryParams.Add("unique", parameterToString(*r.unique, "")) + } + if r.viewDuration != nil { + localVarQueryParams.Add("viewDuration", parameterToString(*r.viewDuration, "")) + } if r.filterBy != nil { addDeepQueryParams(r.filterBy, "filterBy", localVarQueryParams) } @@ -324,7 +366,7 @@ func (s *AnalyticsService) GetMetricsBreakdownWithContext(ctx context.Context, m * GetMetricsOverTime Retrieve metrics over time * Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. * @return AnalyticsApiGetMetricsOverTimeRequest */ @@ -338,7 +380,7 @@ func (s *AnalyticsService) GetMetricsOverTime(metric string, r AnalyticsApiGetMe * GetMetricsOverTime Retrieve metrics over time * Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + * @param metric Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. * @return AnalyticsApiGetMetricsOverTimeRequest */ @@ -366,6 +408,12 @@ func (s *AnalyticsService) GetMetricsOverTimeWithContext(ctx context.Context, me if r.sortOrder != nil { localVarQueryParams.Add("sortOrder", parameterToString(*r.sortOrder, "")) } + if r.unique != nil { + localVarQueryParams.Add("unique", parameterToString(*r.unique, "")) + } + if r.viewDuration != nil { + localVarQueryParams.Add("viewDuration", parameterToString(*r.viewDuration, "")) + } if r.filterBy != nil { addDeepQueryParams(r.filterBy, "filterBy", localVarQueryParams) } diff --git a/client.go b/client.go index f2c9d28..26affc1 100644 --- a/client.go +++ b/client.go @@ -259,7 +259,7 @@ func (c *Client) prepareRequest( req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.4.5") + req.Header.Set("AV-Origin-Client", "go:1.4.6") for headerName := range headerParams { req.Header.Set(headerName, headerParams[headerName]) @@ -534,7 +534,7 @@ func (c *Client) auth(req *http.Request) (*http.Request, error) { req.Header.Set("AV-Origin-Sdk", originSdkHeaderValue) } - req.Header.Set("AV-Origin-Client", "go:1.4.5") + req.Header.Set("AV-Origin-Client", "go:1.4.6") resp, err := c.httpClient.Do(req) diff --git a/docs/Analytics.md b/docs/Analytics.md index 185241d..ac265bb 100644 --- a/docs/Analytics.md +++ b/docs/Analytics.md @@ -42,11 +42,13 @@ func main() { // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_KEY").Build() req := apivideosdk.AnalyticsApiGetAggregatedMetricsRequest{} - req.Metric("metric_example") // string | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - req.Aggregation("aggregation_example") // string | Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + req.Metric("metric_example") // string | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `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. + req.Aggregation("aggregation_example") // string | Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `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. req.From(time.Now()) // time.Time | 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`. req.To(time.Now()) // time.Time | 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. - req.FilterBy(map[string][]apivideosdk.FilterBy2{"key": "TODO"}) // FilterBy2 | 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). + req.Unique(true) // bool | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig 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. + req.ViewDuration("5s") // 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`. + req.FilterBy(map[string][]apivideosdk.FilterBy2{"key": "TODO"}) // FilterBy2 | 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. res, err := client.Analytics.GetAggregatedMetrics(metric string, aggregation string, req) @@ -63,8 +65,8 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metric** | **string** | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. | -**aggregation** | **string** | Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. | +**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. | +**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. | ### Other Parameters @@ -74,7 +76,9 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **from** | **time.Time** | 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`. | **to** | **time.Time** | 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. | -**filterBy** | [**FilterBy2**](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). | +**unique** | **bool** | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig 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. | +**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`. | +**filterBy** | [**FilterBy2**](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. | ### Return type @@ -117,13 +121,15 @@ func main() { // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_KEY").Build() req := apivideosdk.AnalyticsApiGetMetricsBreakdownRequest{} - req.Metric("metric_example") // string | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `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. - req.Breakdown("breakdown_example") // string | Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. 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`. + req.Metric("metric_example") // string | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `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. + req.Breakdown("breakdown_example") // string | Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. 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 referrer. req.From(time.Now()) // time.Time | 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` req.To(time.Now()) // time.Time | 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. req.SortBy("metricValue") // 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. req.SortOrder("asc") // 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`. - req.FilterBy(map[string][]apivideosdk.FilterBy2{"key": "TODO"}) // FilterBy2 | 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). + req.Unique(true) // bool | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig 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. + req.ViewDuration("viewDuration_example") // 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`. + req.FilterBy(map[string][]apivideosdk.FilterBy2{"key": "TODO"}) // FilterBy2 | 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. req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1) req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25) @@ -142,8 +148,8 @@ func main() { 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. | -**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`. | +**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. | +**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 referrer. | ### Other Parameters @@ -155,7 +161,9 @@ Name | Type | Description | Notes **to** | **time.Time** | 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. | **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. | **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`. | -**filterBy** | [**FilterBy2**](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). | +**unique** | **bool** | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig 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. | +**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`. | +**filterBy** | [**FilterBy2**](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. | **currentPage** | **int32** | Choose the number of search results to return per page. Minimum value: 1 | [default to 1] **pageSize** | **int32** | Results per page. Allowed values 1-100, default is 25. | [default to 25] @@ -200,13 +208,15 @@ func main() { // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_KEY").Build() req := apivideosdk.AnalyticsApiGetMetricsOverTimeRequest{} - req.Metric("metric_example") // string | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + req.Metric("metric_example") // string | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `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. req.From(time.Now()) // time.Time | 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` req.To(time.Now()) // time.Time | 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. - req.Interval("hour") // 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`. + req.Interval("hour") // 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 should be less than 60 minutes. req.SortBy("metricValue") // 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. req.SortOrder("asc") // 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`. - req.FilterBy(map[string][]apivideosdk.FilterBy2{"key": "TODO"}) // FilterBy2 | 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). + req.Unique(true) // bool | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig 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. + req.ViewDuration("viewDuration_example") // 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`. + req.FilterBy(map[string][]apivideosdk.FilterBy2{"key": "TODO"}) // FilterBy2 | 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. req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1) req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25) @@ -225,7 +235,7 @@ func main() { 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. | +**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. | ### Other Parameters @@ -235,10 +245,12 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **from** | **time.Time** | 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` | **to** | **time.Time** | 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. | -**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`. | +**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 should be less than 60 minutes. | **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. | **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`. | -**filterBy** | [**FilterBy2**](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). | +**unique** | **bool** | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig 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. | +**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`. | +**filterBy** | [**FilterBy2**](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. | **currentPage** | **int32** | Choose the number of search results to return per page. Minimum value: 1 | [default to 1] **pageSize** | **int32** | Results per page. Allowed values 1-100, default is 25. | [default to 25] diff --git a/docs/AnalyticsAggregatedMetricsResponseContext.md b/docs/AnalyticsAggregatedMetricsResponseContext.md index 60b1728..c3069b9 100644 --- a/docs/AnalyticsAggregatedMetricsResponseContext.md +++ b/docs/AnalyticsAggregatedMetricsResponseContext.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Metric** | Pointer to **string** | Returns the metric you selected. | [optional] +**Metric** | Pointer to **string** | Returns the metric and relevant parameters you selected. | [optional] **Aggregation** | Pointer to **string** | Returns the aggregation you selected. | [optional] **Timeframe** | Pointer to [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] diff --git a/docs/AnalyticsMetricsBreakdownResponseContext.md b/docs/AnalyticsMetricsBreakdownResponseContext.md index 20081f0..2115e13 100644 --- a/docs/AnalyticsMetricsBreakdownResponseContext.md +++ b/docs/AnalyticsMetricsBreakdownResponseContext.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Metric** | Pointer to **string** | Returns the metric you selected. | [optional] +**Metric** | Pointer to **string** | Returns the metric and relevant parameters you selected. | [optional] **Breakdown** | Pointer to **string** | Returns the dimension you selected. | [optional] **Timeframe** | Pointer to [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] diff --git a/docs/AnalyticsMetricsOverTimeResponse.md b/docs/AnalyticsMetricsOverTimeResponse.md index 68d18ae..2e693ec 100644 --- a/docs/AnalyticsMetricsOverTimeResponse.md +++ b/docs/AnalyticsMetricsOverTimeResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Context** | [**AnalyticsMetricsOverTimeResponseContext**](AnalyticsMetricsOverTimeResponseContext.md) | | -**Data** | [**[]AnalyticsMetricsOverTimeResponseData**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps . | +**Data** | [**[]AnalyticsMetricsOverTimeResponseData**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps. | **Pagination** | [**Pagination**](Pagination.md) | | ## Methods diff --git a/docs/AnalyticsMetricsOverTimeResponseContext.md b/docs/AnalyticsMetricsOverTimeResponseContext.md index 5cd5ddf..de9f053 100644 --- a/docs/AnalyticsMetricsOverTimeResponseContext.md +++ b/docs/AnalyticsMetricsOverTimeResponseContext.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Metric** | Pointer to **string** | Returns the metric you selected. | [optional] +**Metric** | Pointer to **string** | Returns the metric and relevant parameters you selected. | [optional] **Interval** | Pointer to **string** | Returns the interval you selected. | [optional] **Timeframe** | Pointer to [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] diff --git a/docs/FilterBy.md b/docs/FilterBy.md index 8620ff6..9ff60e4 100644 --- a/docs/FilterBy.md +++ b/docs/FilterBy.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **OperatingSystem** | Pointer to **[]string** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **Browser** | Pointer to **[]string** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **Tag** | Pointer to **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** | Pointer to **[]string** | 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. | [optional] ## Methods @@ -232,6 +233,31 @@ SetTag sets Tag field to given value. HasTag returns a boolean if a field has been set. +### GetReferrer + +`func (o *FilterBy) GetReferrer() []string` + +GetReferrer returns the Referrer field if non-nil, zero value otherwise. + +### GetReferrerOk + +`func (o *FilterBy) GetReferrerOk() (*[]string, bool)` + +GetReferrerOk returns a tuple with the Referrer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferrer + +`func (o *FilterBy) SetReferrer(v []string)` + +SetReferrer sets Referrer field to given value. + +### HasReferrer + +`func (o *FilterBy) HasReferrer() bool` + +HasReferrer returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FilterBy1.md b/docs/FilterBy1.md index 7a96d6c..fed5562 100644 --- a/docs/FilterBy1.md +++ b/docs/FilterBy1.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **OperatingSystem** | Pointer to **[]string** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **Browser** | Pointer to **[]string** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **Tag** | Pointer to **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** | Pointer to **[]string** | 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. | [optional] ## Methods @@ -232,6 +233,31 @@ SetTag sets Tag field to given value. HasTag returns a boolean if a field has been set. +### GetReferrer + +`func (o *FilterBy1) GetReferrer() []string` + +GetReferrer returns the Referrer field if non-nil, zero value otherwise. + +### GetReferrerOk + +`func (o *FilterBy1) GetReferrerOk() (*[]string, bool)` + +GetReferrerOk returns a tuple with the Referrer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferrer + +`func (o *FilterBy1) SetReferrer(v []string)` + +SetReferrer sets Referrer field to given value. + +### HasReferrer + +`func (o *FilterBy1) HasReferrer() bool` + +HasReferrer returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FilterBy2.md b/docs/FilterBy2.md index 9b367fc..8b01227 100644 --- a/docs/FilterBy2.md +++ b/docs/FilterBy2.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **OperatingSystem** | Pointer to **[]string** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **Browser** | Pointer to **[]string** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **Tag** | Pointer to **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** | Pointer to **[]string** | 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. | [optional] ## Methods @@ -232,6 +233,31 @@ SetTag sets Tag field to given value. HasTag returns a boolean if a field has been set. +### GetReferrer + +`func (o *FilterBy2) GetReferrer() []string` + +GetReferrer returns the Referrer field if non-nil, zero value otherwise. + +### GetReferrerOk + +`func (o *FilterBy2) GetReferrerOk() (*[]string, bool)` + +GetReferrerOk returns a tuple with the Referrer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferrer + +`func (o *FilterBy2) SetReferrer(v []string)` + +SetReferrer sets Referrer field to given value. + +### HasReferrer + +`func (o *FilterBy2) HasReferrer() bool` + +HasReferrer returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/model_analytics_aggregated_metrics_response_context.go b/model_analytics_aggregated_metrics_response_context.go index 9234109..221c970 100644 --- a/model_analytics_aggregated_metrics_response_context.go +++ b/model_analytics_aggregated_metrics_response_context.go @@ -16,7 +16,7 @@ import ( // AnalyticsAggregatedMetricsResponseContext struct for AnalyticsAggregatedMetricsResponseContext type AnalyticsAggregatedMetricsResponseContext struct { - // Returns the metric you selected. + // Returns the metric and relevant parameters you selected. Metric *string `json:"metric,omitempty"` // Returns the aggregation you selected. Aggregation *string `json:"aggregation,omitempty"` diff --git a/model_analytics_metrics_breakdown_response_context.go b/model_analytics_metrics_breakdown_response_context.go index 479fcc5..60c002c 100644 --- a/model_analytics_metrics_breakdown_response_context.go +++ b/model_analytics_metrics_breakdown_response_context.go @@ -16,7 +16,7 @@ import ( // AnalyticsMetricsBreakdownResponseContext struct for AnalyticsMetricsBreakdownResponseContext type AnalyticsMetricsBreakdownResponseContext struct { - // Returns the metric you selected. + // Returns the metric and relevant parameters you selected. Metric *string `json:"metric,omitempty"` // Returns the dimension you selected. Breakdown *string `json:"breakdown,omitempty"` diff --git a/model_analytics_metrics_over_time_response.go b/model_analytics_metrics_over_time_response.go index eb2c48c..b1224db 100644 --- a/model_analytics_metrics_over_time_response.go +++ b/model_analytics_metrics_over_time_response.go @@ -17,7 +17,7 @@ import ( // AnalyticsMetricsOverTimeResponse struct for AnalyticsMetricsOverTimeResponse type AnalyticsMetricsOverTimeResponse struct { Context AnalyticsMetricsOverTimeResponseContext `json:"context"` - // Returns an array of metrics and the timestamps . + // Returns an array of metrics and the timestamps. Data []AnalyticsMetricsOverTimeResponseData `json:"data"` Pagination Pagination `json:"pagination"` } diff --git a/model_analytics_metrics_over_time_response_context.go b/model_analytics_metrics_over_time_response_context.go index 7e23f32..b9e9835 100644 --- a/model_analytics_metrics_over_time_response_context.go +++ b/model_analytics_metrics_over_time_response_context.go @@ -16,7 +16,7 @@ import ( // AnalyticsMetricsOverTimeResponseContext struct for AnalyticsMetricsOverTimeResponseContext type AnalyticsMetricsOverTimeResponseContext struct { - // Returns the metric you selected. + // Returns the metric and relevant parameters you selected. Metric *string `json:"metric,omitempty"` // Returns the interval you selected. Interval *string `json:"interval,omitempty"` diff --git a/model_filter_by.go b/model_filter_by.go index aca134e..bf14092 100644 --- a/model_filter_by.go +++ b/model_filter_by.go @@ -31,6 +31,8 @@ type FilterBy struct { Browser *[]string `json:"browser,omitempty"` // 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). Tag *string `json:"tag,omitempty"` + // 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. + Referrer *[]string `json:"referrer,omitempty"` } // NewFilterBy instantiates a new FilterBy object @@ -306,6 +308,38 @@ func (o *FilterBy) SetTag(v string) { o.Tag = &v } +// GetReferrer returns the Referrer field value if set, zero value otherwise. +func (o *FilterBy) GetReferrer() []string { + if o == nil || o.Referrer == nil { + var ret []string + return ret + } + return *o.Referrer +} + +// GetReferrerOk returns a tuple with the Referrer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterBy) GetReferrerOk() (*[]string, bool) { + if o == nil || o.Referrer == nil { + return nil, false + } + return o.Referrer, true +} + +// HasReferrer returns a boolean if a field has been set. +func (o *FilterBy) HasReferrer() bool { + if o != nil && o.Referrer != nil { + return true + } + + return false +} + +// SetReferrer gets a reference to the given []string and assigns it to the Referrer field. +func (o *FilterBy) SetReferrer(v []string) { + o.Referrer = &v +} + type NullableFilterBy struct { value *FilterBy isSet bool diff --git a/model_filter_by_1.go b/model_filter_by_1.go index 100f7d2..e1e6bfa 100644 --- a/model_filter_by_1.go +++ b/model_filter_by_1.go @@ -31,6 +31,8 @@ type FilterBy1 struct { Browser *[]string `json:"browser,omitempty"` // 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). Tag *string `json:"tag,omitempty"` + // 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. + Referrer *[]string `json:"referrer,omitempty"` } // NewFilterBy1 instantiates a new FilterBy1 object @@ -306,6 +308,38 @@ func (o *FilterBy1) SetTag(v string) { o.Tag = &v } +// GetReferrer returns the Referrer field value if set, zero value otherwise. +func (o *FilterBy1) GetReferrer() []string { + if o == nil || o.Referrer == nil { + var ret []string + return ret + } + return *o.Referrer +} + +// GetReferrerOk returns a tuple with the Referrer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterBy1) GetReferrerOk() (*[]string, bool) { + if o == nil || o.Referrer == nil { + return nil, false + } + return o.Referrer, true +} + +// HasReferrer returns a boolean if a field has been set. +func (o *FilterBy1) HasReferrer() bool { + if o != nil && o.Referrer != nil { + return true + } + + return false +} + +// SetReferrer gets a reference to the given []string and assigns it to the Referrer field. +func (o *FilterBy1) SetReferrer(v []string) { + o.Referrer = &v +} + type NullableFilterBy1 struct { value *FilterBy1 isSet bool diff --git a/model_filter_by_2.go b/model_filter_by_2.go index 323281f..725c6d0 100644 --- a/model_filter_by_2.go +++ b/model_filter_by_2.go @@ -31,6 +31,8 @@ type FilterBy2 struct { Browser *[]string `json:"browser,omitempty"` // 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). Tag *string `json:"tag,omitempty"` + // 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. + Referrer *[]string `json:"referrer,omitempty"` } // NewFilterBy2 instantiates a new FilterBy2 object @@ -306,6 +308,38 @@ func (o *FilterBy2) SetTag(v string) { o.Tag = &v } +// GetReferrer returns the Referrer field value if set, zero value otherwise. +func (o *FilterBy2) GetReferrer() []string { + if o == nil || o.Referrer == nil { + var ret []string + return ret + } + return *o.Referrer +} + +// GetReferrerOk returns a tuple with the Referrer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterBy2) GetReferrerOk() (*[]string, bool) { + if o == nil || o.Referrer == nil { + return nil, false + } + return o.Referrer, true +} + +// HasReferrer returns a boolean if a field has been set. +func (o *FilterBy2) HasReferrer() bool { + if o != nil && o.Referrer != nil { + return true + } + + return false +} + +// SetReferrer gets a reference to the given []string and assigns it to the Referrer field. +func (o *FilterBy2) SetReferrer(v []string) { + o.Referrer = &v +} + type NullableFilterBy2 struct { value *FilterBy2 isSet bool