diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 5dd3179..153c80d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -26,7 +26,16 @@ Sources/JSONEncodingHelper.swift Sources/Models.swift Sources/Models/AccessToken.swift Sources/Models/AdditionalBadRequestErrors.swift +Sources/Models/AnalyticsAggregatedMetricsResponse.swift +Sources/Models/AnalyticsAggregatedMetricsResponseContext.swift +Sources/Models/AnalyticsAggregatedMetricsResponseContextTimeframe.swift Sources/Models/AnalyticsData.swift +Sources/Models/AnalyticsMetricsBreakdownResponse.swift +Sources/Models/AnalyticsMetricsBreakdownResponseContext.swift +Sources/Models/AnalyticsMetricsBreakdownResponseData.swift +Sources/Models/AnalyticsMetricsOverTimeResponse.swift +Sources/Models/AnalyticsMetricsOverTimeResponseContext.swift +Sources/Models/AnalyticsMetricsOverTimeResponseData.swift Sources/Models/AnalyticsPlays400Error.swift Sources/Models/AnalyticsPlaysResponse.swift Sources/Models/AuthenticatePayload.swift @@ -43,12 +52,6 @@ Sources/Models/LiveStream.swift Sources/Models/LiveStreamAssets.swift Sources/Models/LiveStreamCreationPayload.swift Sources/Models/LiveStreamListResponse.swift -Sources/Models/LiveStreamSession.swift -Sources/Models/LiveStreamSessionClient.swift -Sources/Models/LiveStreamSessionDevice.swift -Sources/Models/LiveStreamSessionLocation.swift -Sources/Models/LiveStreamSessionReferrer.swift -Sources/Models/LiveStreamSessionSession.swift Sources/Models/LiveStreamUpdatePayload.swift Sources/Models/Metadata.swift Sources/Models/Model403ErrorSchema.swift @@ -69,18 +72,12 @@ Sources/Models/RestreamsResponseObject.swift Sources/Models/TokenCreationPayload.swift Sources/Models/TokenListResponse.swift Sources/Models/TooManyRequests.swift +Sources/Models/UnrecognizedRequestUrl.swift Sources/Models/UploadToken.swift Sources/Models/Video.swift Sources/Models/VideoAssets.swift Sources/Models/VideoClip.swift Sources/Models/VideoCreationPayload.swift -Sources/Models/VideoSession.swift -Sources/Models/VideoSessionClient.swift -Sources/Models/VideoSessionDevice.swift -Sources/Models/VideoSessionLocation.swift -Sources/Models/VideoSessionOs.swift -Sources/Models/VideoSessionReferrer.swift -Sources/Models/VideoSessionSession.swift Sources/Models/VideoSource.swift Sources/Models/VideoSourceLiveStream.swift Sources/Models/VideoSourceLiveStreamLink.swift @@ -108,7 +105,16 @@ docs/AccessToken.md docs/AdditionalBadRequestErrors.md docs/AdvancedAuthenticationAPI.md docs/AnalyticsAPI.md +docs/AnalyticsAggregatedMetricsResponse.md +docs/AnalyticsAggregatedMetricsResponseContext.md +docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md docs/AnalyticsData.md +docs/AnalyticsMetricsBreakdownResponse.md +docs/AnalyticsMetricsBreakdownResponseContext.md +docs/AnalyticsMetricsBreakdownResponseData.md +docs/AnalyticsMetricsOverTimeResponse.md +docs/AnalyticsMetricsOverTimeResponseContext.md +docs/AnalyticsMetricsOverTimeResponseData.md docs/AnalyticsPlays400Error.md docs/AnalyticsPlaysResponse.md docs/AuthenticatePayload.md @@ -126,12 +132,6 @@ docs/LiveStream.md docs/LiveStreamAssets.md docs/LiveStreamCreationPayload.md docs/LiveStreamListResponse.md -docs/LiveStreamSession.md -docs/LiveStreamSessionClient.md -docs/LiveStreamSessionDevice.md -docs/LiveStreamSessionLocation.md -docs/LiveStreamSessionReferrer.md -docs/LiveStreamSessionSession.md docs/LiveStreamUpdatePayload.md docs/LiveStreamsAPI.md docs/Metadata.md @@ -153,19 +153,13 @@ docs/RestreamsResponseObject.md docs/TokenCreationPayload.md docs/TokenListResponse.md docs/TooManyRequests.md +docs/UnrecognizedRequestUrl.md docs/UploadToken.md docs/UploadTokensAPI.md docs/Video.md docs/VideoAssets.md docs/VideoClip.md docs/VideoCreationPayload.md -docs/VideoSession.md -docs/VideoSessionClient.md -docs/VideoSessionDevice.md -docs/VideoSessionLocation.md -docs/VideoSessionOs.md -docs/VideoSessionReferrer.md -docs/VideoSessionSession.md docs/VideoSource.md docs/VideoSourceLiveStream.md docs/VideoSourceLiveStreamLink.md diff --git a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 index 644fa0c..8e783f7 100644 --- a/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 +++ b/.openapi-generator/oas_apivideo.yaml-defaut-cli.sha256 @@ -1 +1 @@ -d7b342ceb1a4805da9e3d6355384e34c1a99e1300d01cac3ae3218c5738f11f1 \ No newline at end of file +16c7ff294d3c9a1f33f41ce3edfa0dbfed5810ccdd2d92872179b6c87c5e9169 \ No newline at end of file diff --git a/README.md b/README.md index dfe2ee5..fadec69 100644 --- a/README.md +++ b/README.md @@ -104,8 +104,9 @@ AnalyticsAPI Method | HTTP request | Description ------------- | ------------- | ------------- -[**getLiveStreamsPlays**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getLiveStreamsPlays) | **GET** `/analytics/live-streams/plays` | Get play events for live stream -[**getVideosPlays**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getVideosPlays) | **GET** `/analytics/videos/plays` | Get play events for video +[**getAggregatedMetrics**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getAggregatedMetrics) | **GET** `/data/metrics/{metric}/{aggregation}` | Retrieve aggregated metrics +[**getMetricsBreakdown**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getMetricsBreakdown) | **GET** `/data/buckets/{metric}/{breakdown}` | Retrieve metrics in a breakdown of dimensions +[**getMetricsOverTime**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAPI.md#getMetricsOverTime) | **GET** `/data/timeseries/{metric}` | Retrieve metrics over time #### CaptionsAPI @@ -164,6 +165,7 @@ Method | HTTP request | Description [**list**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#list) | **GET** `/live-streams` | List all live streams [**uploadThumbnail**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#uploadThumbnail) | **POST** `/live-streams/{liveStreamId}/thumbnail` | Upload a thumbnail [**deleteThumbnail**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#deleteThumbnail) | **DELETE** `/live-streams/{liveStreamId}/thumbnail` | Delete a thumbnail +[**complete**](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#complete) | **PUT** `/live-streams/{liveStreamId}/complete` | Complete a live stream #### PlayerThemesAPI @@ -269,7 +271,16 @@ Method | HTTP request | Description - [AccessToken](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AccessToken.md) - [AdditionalBadRequestErrors](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AdditionalBadRequestErrors.md) + - [AnalyticsAggregatedMetricsResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAggregatedMetricsResponse.md) + - [AnalyticsAggregatedMetricsResponseContext](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAggregatedMetricsResponseContext.md) + - [AnalyticsAggregatedMetricsResponseContextTimeframe](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md) - [AnalyticsData](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsData.md) + - [AnalyticsMetricsBreakdownResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsBreakdownResponse.md) + - [AnalyticsMetricsBreakdownResponseContext](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsBreakdownResponseContext.md) + - [AnalyticsMetricsBreakdownResponseData](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsBreakdownResponseData.md) + - [AnalyticsMetricsOverTimeResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsOverTimeResponse.md) + - [AnalyticsMetricsOverTimeResponseContext](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsOverTimeResponseContext.md) + - [AnalyticsMetricsOverTimeResponseData](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsMetricsOverTimeResponseData.md) - [AnalyticsPlays400Error](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsPlays400Error.md) - [AnalyticsPlaysResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AnalyticsPlaysResponse.md) - [AuthenticatePayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/AuthenticatePayload.md) @@ -285,12 +296,6 @@ Method | HTTP request | Description - [LiveStreamAssets](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamAssets.md) - [LiveStreamCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamCreationPayload.md) - [LiveStreamListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamListResponse.md) - - [LiveStreamSession](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSession.md) - - [LiveStreamSessionClient](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionClient.md) - - [LiveStreamSessionDevice](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionDevice.md) - - [LiveStreamSessionLocation](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionLocation.md) - - [LiveStreamSessionReferrer](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionReferrer.md) - - [LiveStreamSessionSession](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamSessionSession.md) - [LiveStreamUpdatePayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamUpdatePayload.md) - [Metadata](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Metadata.md) - [Model403ErrorSchema](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Model403ErrorSchema.md) @@ -310,18 +315,12 @@ Method | HTTP request | Description - [TokenCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TokenCreationPayload.md) - [TokenListResponse](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TokenListResponse.md) - [TooManyRequests](https://github.com/apivideo/api.video-swift-client/blob/main/docs/TooManyRequests.md) + - [UnrecognizedRequestUrl](https://github.com/apivideo/api.video-swift-client/blob/main/docs/UnrecognizedRequestUrl.md) - [UploadToken](https://github.com/apivideo/api.video-swift-client/blob/main/docs/UploadToken.md) - [Video](https://github.com/apivideo/api.video-swift-client/blob/main/docs/Video.md) - [VideoAssets](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoAssets.md) - [VideoClip](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoClip.md) - [VideoCreationPayload](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoCreationPayload.md) - - [VideoSession](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSession.md) - - [VideoSessionClient](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionClient.md) - - [VideoSessionDevice](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionDevice.md) - - [VideoSessionLocation](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionLocation.md) - - [VideoSessionOs](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionOs.md) - - [VideoSessionReferrer](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionReferrer.md) - - [VideoSessionSession](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSessionSession.md) - [VideoSource](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSource.md) - [VideoSourceLiveStream](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSourceLiveStream.md) - [VideoSourceLiveStreamLink](https://github.com/apivideo/api.video-swift-client/blob/main/docs/VideoSourceLiveStreamLink.md) diff --git a/Sources/APIs/AnalyticsAPI.swift b/Sources/APIs/AnalyticsAPI.swift index c1acaa4..a27f5f9 100644 --- a/Sources/APIs/AnalyticsAPI.swift +++ b/Sources/APIs/AnalyticsAPI.swift @@ -13,32 +13,151 @@ import AnyCodable open class AnalyticsAPI { /** - * enum for parameter dimension + * enum for parameter metric */ - public enum DimensionGetLiveStreamsPlays: String, CaseIterable { - case livestreamid = "liveStreamId" - case emittedat = "emittedAt" + public enum MetricGetAggregatedMetrics: String, CaseIterable { + case play = "play" + case start = "start" + case end = "end" + case impression = "impression" + case impressionTime = "impression-time" + case watchTime = "watch-time" + } + + /** + * enum for parameter aggregation + */ + public enum AggregationGetAggregatedMetrics: String, CaseIterable { + case count = "count" + case rate = "rate" + case total = "total" + case average = "average" + case sum = "sum" + } + + /** + Retrieve aggregated metrics + + - parameter metric: (path) 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. + - parameter aggregation: (path) 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. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects. + */ + @discardableResult + open class func getAggregatedMetrics(metric: MetricGetAggregatedMetrics, aggregation: AggregationGetAggregatedMetrics, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsAggregatedMetricsResponse?, _ error: Error?) -> Void)) -> RequestTask { + return getAggregatedMetrics(metric: metric, aggregation: aggregation, from: from, to: to, filterBy: filterBy, apiResponseQueue: apiResponseQueue) { result in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Retrieve aggregated metrics + + - parameter metric: (path) 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. + - parameter aggregation: (path) 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. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the result of the request (incl. headers). + */ + @discardableResult + open class func getAggregatedMetrics(metric: MetricGetAggregatedMetrics, aggregation: AggregationGetAggregatedMetrics, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return getAggregatedMetricsWithRequestBuilder(metric: metric, aggregation: aggregation, from: from, to: to, filterBy: filterBy).execute(apiResponseQueue, completion) + } + + + /** + Retrieve aggregated metrics + - GET /data/metrics/{metric}/{aggregation} + - Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. + - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] + - parameter metric: (path) 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. + - parameter aggregation: (path) 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. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + - returns: RequestBuilder + */ + internal class func getAggregatedMetricsWithRequestBuilder(metric: MetricGetAggregatedMetrics, aggregation: AggregationGetAggregatedMetrics, from: Date? = nil, to: Date? = nil, filterBy: String? = nil) -> RequestBuilder { + var localVariablePath = "/data/metrics/{metric}/{aggregation}" + let metricPreEscape = "\(metric.rawValue)" + let metricPostEscape = metricPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{metric}", with: metricPostEscape, options: .literal, range: nil) + let aggregationPreEscape = "\(aggregation.rawValue)" + let aggregationPostEscape = aggregationPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{aggregation}", with: aggregationPostEscape, options: .literal, range: nil) + let localVariableURLString = ApiVideoClient.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + var localVariableUrlComponents = URLComponents(string: localVariableURLString) + localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ + "from": from?.encodeToJSON(), + "to": to?.encodeToJSON(), + "filterBy": filterBy?.encodeToJSON(), + ]) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() + + return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + + + /** + * enum for parameter metric + */ + public enum MetricGetMetricsBreakdown: String, CaseIterable { + case play = "play" + case playRate = "play-rate" + case playTotal = "play-total" + case start = "start" + case end = "end" + case impression = "impression" + } + + /** + * enum for parameter breakdown + */ + public enum BreakdownGetMetricsBreakdown: String, CaseIterable { + case mediaId = "media-id" + case mediaType = "media-type" + case continent = "continent" case country = "country" - case devicetype = "deviceType" - case operatingsystem = "operatingSystem" + case deviceType = "device-type" + case operatingSystem = "operating-system" case browser = "browser" } /** - Get play events for live stream + Retrieve metrics in a breakdown of dimensions - - parameter from: (query) Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. - - parameter dimension: (query) Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. - - parameter to: (query) Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional) - - parameter filter: (query) Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional) + - parameter metric: (path) 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. + - parameter breakdown: (path) Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects. */ @discardableResult - open class func getLiveStreamsPlays(from: Date, dimension: DimensionGetLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsPlaysResponse?, _ error: Error?) -> Void)) -> RequestTask { - return getLiveStreamsPlays(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize, apiResponseQueue: apiResponseQueue) { result in + open class func getMetricsBreakdown(metric: MetricGetMetricsBreakdown, breakdown: BreakdownGetMetricsBreakdown, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsMetricsBreakdownResponse?, _ error: Error?) -> Void)) -> RequestTask { + return getMetricsBreakdown(metric: metric, breakdown: breakdown, from: from, to: to, filterBy: filterBy, currentPage: currentPage, pageSize: pageSize, apiResponseQueue: apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -49,47 +168,54 @@ open class AnalyticsAPI { } /** - Get play events for live stream + Retrieve metrics in a breakdown of dimensions - - parameter from: (query) Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. - - parameter dimension: (query) Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. - - parameter to: (query) Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional) - - parameter filter: (query) Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional) + - parameter metric: (path) 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. + - parameter breakdown: (path) Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result of the request (incl. headers). */ @discardableResult - open class func getLiveStreamsPlays(from: Date, dimension: DimensionGetLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { - return getLiveStreamsPlaysWithRequestBuilder(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue, completion) + open class func getMetricsBreakdown(metric: MetricGetMetricsBreakdown, breakdown: BreakdownGetMetricsBreakdown, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return getMetricsBreakdownWithRequestBuilder(metric: metric, breakdown: breakdown, from: from, to: to, filterBy: filterBy, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue, completion) } /** - Get play events for live stream - - GET /analytics/live-streams/plays - - Retrieve filtered analytics about the number of plays for your live streams in a project. + Retrieve metrics in a breakdown of dimensions + - GET /data/buckets/{metric}/{breakdown} + - Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - - parameter from: (query) Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. - - parameter dimension: (query) Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. - - parameter to: (query) Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional) - - parameter filter: (query) Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional) + - parameter metric: (path) 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. + - parameter breakdown: (path) Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - - returns: RequestBuilder + - returns: RequestBuilder */ - internal class func getLiveStreamsPlaysWithRequestBuilder(from: Date, dimension: DimensionGetLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { - let localVariablePath = "/analytics/live-streams/plays" + internal class func getMetricsBreakdownWithRequestBuilder(metric: MetricGetMetricsBreakdown, breakdown: BreakdownGetMetricsBreakdown, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { + var localVariablePath = "/data/buckets/{metric}/{breakdown}" + let metricPreEscape = "\(metric.rawValue)" + let metricPostEscape = metricPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{metric}", with: metricPostEscape, options: .literal, range: nil) + let breakdownPreEscape = "\(breakdown.rawValue)" + let breakdownPostEscape = breakdownPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{breakdown}", with: breakdownPostEscape, options: .literal, range: nil) let localVariableURLString = ApiVideoClient.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "from": from.encodeToJSON(), + "from": from?.encodeToJSON(), "to": to?.encodeToJSON(), - "dimension": dimension.encodeToJSON(), - "filter": filter?.encodeToJSON(), + "filterBy": filterBy?.encodeToJSON(), "currentPage": currentPage?.encodeToJSON(), "pageSize": pageSize?.encodeToJSON(), ]) @@ -100,39 +226,39 @@ open class AnalyticsAPI { let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) - let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) } /** - * enum for parameter dimension + * enum for parameter metric */ - public enum DimensionGetVideosPlays: String, CaseIterable { - case videoid = "videoId" - case emittedat = "emittedAt" - case country = "country" - case devicetype = "deviceType" - case operatingsystem = "operatingSystem" - case browser = "browser" + public enum MetricGetMetricsOverTime: String, CaseIterable { + case play = "play" + case playRate = "play-rate" + case start = "start" + case end = "end" + case impression = "impression" } /** - Get play events for video + Retrieve metrics over time - - parameter from: (query) Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. - - parameter dimension: (query) Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. - - parameter to: (query) Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional) - - parameter filter: (query) Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional) + - parameter metric: (path) 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. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter interval: (query) Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects. */ @discardableResult - open class func getVideosPlays(from: Date, dimension: DimensionGetVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsPlaysResponse?, _ error: Error?) -> Void)) -> RequestTask { - return getVideosPlays(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize, apiResponseQueue: apiResponseQueue) { result in + open class func getMetricsOverTime(metric: MetricGetMetricsOverTime, from: Date? = nil, to: Date? = nil, interval: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: AnalyticsMetricsOverTimeResponse?, _ error: Error?) -> Void)) -> RequestTask { + return getMetricsOverTime(metric: metric, from: from, to: to, interval: interval, filterBy: filterBy, currentPage: currentPage, pageSize: pageSize, apiResponseQueue: apiResponseQueue) { result in switch result { case let .success(response): completion(response.body, nil) @@ -143,47 +269,52 @@ open class AnalyticsAPI { } /** - Get play events for video + Retrieve metrics over time - - parameter from: (query) Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. - - parameter dimension: (query) Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. - - parameter to: (query) Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional) - - parameter filter: (query) Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional) + - parameter metric: (path) 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. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter interval: (query) Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result of the request (incl. headers). */ @discardableResult - open class func getVideosPlays(from: Date, dimension: DimensionGetVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { - return getVideosPlaysWithRequestBuilder(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue, completion) + open class func getMetricsOverTime(metric: MetricGetMetricsOverTime, from: Date? = nil, to: Date? = nil, interval: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return getMetricsOverTimeWithRequestBuilder(metric: metric, from: from, to: to, interval: interval, filterBy: filterBy, currentPage: currentPage, pageSize: pageSize).execute(apiResponseQueue, completion) } /** - Get play events for video - - GET /analytics/videos/plays - - Retrieve filtered analytics about the number of plays for your videos in a project. + Retrieve metrics over time + - GET /data/timeseries/{metric} + - Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] - - parameter from: (query) Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. - - parameter dimension: (query) Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. - - parameter to: (query) Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional) - - parameter filter: (query) Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional) + - parameter metric: (path) 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. + - parameter from: (query) Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) + - parameter to: (query) Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + - parameter interval: (query) Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. (optional) + - parameter filterBy: (query) Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) - parameter currentPage: (query) Choose the number of search results to return per page. Minimum value: 1 (optional, default to 1) - parameter pageSize: (query) Results per page. Allowed values 1-100, default is 25. (optional, default to 25) - - returns: RequestBuilder + - returns: RequestBuilder */ - internal class func getVideosPlaysWithRequestBuilder(from: Date, dimension: DimensionGetVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { - let localVariablePath = "/analytics/videos/plays" + internal class func getMetricsOverTimeWithRequestBuilder(metric: MetricGetMetricsOverTime, from: Date? = nil, to: Date? = nil, interval: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil) -> RequestBuilder { + var localVariablePath = "/data/timeseries/{metric}" + let metricPreEscape = "\(metric.rawValue)" + let metricPostEscape = metricPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{metric}", with: metricPostEscape, options: .literal, range: nil) let localVariableURLString = ApiVideoClient.basePath + localVariablePath let localVariableParameters: [String: Any]? = nil var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "from": from.encodeToJSON(), + "from": from?.encodeToJSON(), "to": to?.encodeToJSON(), - "dimension": dimension.encodeToJSON(), - "filter": filter?.encodeToJSON(), + "interval": interval?.encodeToJSON(), + "filterBy": filterBy?.encodeToJSON(), "currentPage": currentPage?.encodeToJSON(), "pageSize": pageSize?.encodeToJSON(), ]) @@ -194,7 +325,7 @@ open class AnalyticsAPI { let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) - let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getBuilder() return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) } diff --git a/Sources/APIs/LiveStreamsAPI.swift b/Sources/APIs/LiveStreamsAPI.swift index e7f763a..243f3f3 100644 --- a/Sources/APIs/LiveStreamsAPI.swift +++ b/Sources/APIs/LiveStreamsAPI.swift @@ -489,4 +489,66 @@ open class LiveStreamsAPI { return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) } + + /** + Complete a live stream + + - parameter liveStreamId: (path) The unique ID for the live stream you want to complete. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects. + */ + @discardableResult + open class func complete(liveStreamId: String, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { + return complete(liveStreamId: liveStreamId, apiResponseQueue: apiResponseQueue) { result in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Complete a live stream + + - parameter liveStreamId: (path) The unique ID for the live stream you want to complete. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the result of the request (incl. headers). + */ + @discardableResult + open class func complete(liveStreamId: String, apiResponseQueue: DispatchQueue = ApiVideoClient.apiResponseQueue, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return completeWithRequestBuilder(liveStreamId: liveStreamId).execute(apiResponseQueue, completion) + } + + + /** + Complete a live stream + - PUT /live-streams/{liveStreamId}/complete + - Request the completion of a live stream that is currently running. This operation is asynchronous and the live stream will stop after a few seconds. The API adds the `EXT-X-ENDLIST` tag to the live stream's HLS manifest. This stops the live stream on the player and also stops the recording of the live stream. The API keeps the incoming connection from the streamer open for at most 1 minute, which can be used to terminate the stream. + - responseHeaders: [X-RateLimit-Limit(Int), X-RateLimit-Remaining(Int), X-RateLimit-Retry-After(Int)] + - parameter liveStreamId: (path) The unique ID for the live stream you want to complete. + - returns: RequestBuilder + */ + internal class func completeWithRequestBuilder(liveStreamId: String) -> RequestBuilder { + var localVariablePath = "/live-streams/{liveStreamId}/complete" + let liveStreamIdPreEscape = "\(APIHelper.mapValueToPathItem(liveStreamId))" + let liveStreamIdPostEscape = liveStreamIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + localVariablePath = localVariablePath.replacingOccurrences(of: "{liveStreamId}", with: liveStreamIdPostEscape, options: .literal, range: nil) + let localVariableURLString = ApiVideoClient.basePath + localVariablePath + let localVariableParameters: [String: Any]? = nil + + let localVariableUrlComponents = URLComponents(string: localVariableURLString) + + let localVariableNillableHeaders: [String: Any?] = [ + : + ] + + let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) + + let localVariableRequestBuilder: RequestBuilder.Type = ApiVideoClient.requestBuilderFactory.getNonDecodableBuilder() + + return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters) + } + } diff --git a/Sources/Models/AnalyticsAggregatedMetricsResponse.swift b/Sources/Models/AnalyticsAggregatedMetricsResponse.swift new file mode 100644 index 0000000..638694b --- /dev/null +++ b/Sources/Models/AnalyticsAggregatedMetricsResponse.swift @@ -0,0 +1,36 @@ +// +// AnalyticsAggregatedMetricsResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AnalyticsAggregatedMetricsResponse: Codable, Hashable { + + public var context: AnalyticsAggregatedMetricsResponseContext + public var data: Float + + public init(context: AnalyticsAggregatedMetricsResponseContext, data: Float) { + self.context = context + self.data = data + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case context + case data + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(context, forKey: .context) + try container.encode(data, forKey: .data) + } +} + diff --git a/Sources/Models/AnalyticsAggregatedMetricsResponseContext.swift b/Sources/Models/AnalyticsAggregatedMetricsResponseContext.swift new file mode 100644 index 0000000..b23b03d --- /dev/null +++ b/Sources/Models/AnalyticsAggregatedMetricsResponseContext.swift @@ -0,0 +1,57 @@ +// +// AnalyticsAggregatedMetricsResponseContext.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AnalyticsAggregatedMetricsResponseContext: Codable, Hashable { + + public enum Metric: String, Codable, CaseIterable { + case play = "play" + case start = "start" + case end = "end" + case impression = "impression" + case impressionTime = "impression-time" + case watchTime = "watch-time" + } + public enum Aggregation: String, Codable, CaseIterable { + case count = "count" + case rate = "rate" + case total = "total" + case average = "average" + case sum = "sum" + } + /** Returns the metric you selected. */ + public var metric: Metric? + /** Returns the aggregation you selected. */ + public var aggregation: Aggregation? + public var timeframe: AnalyticsAggregatedMetricsResponseContextTimeframe? + + public init(metric: Metric? = nil, aggregation: Aggregation? = nil, timeframe: AnalyticsAggregatedMetricsResponseContextTimeframe? = nil) { + self.metric = metric + self.aggregation = aggregation + self.timeframe = timeframe + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case metric + case aggregation + case timeframe + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(metric, forKey: .metric) + try container.encodeIfPresent(aggregation, forKey: .aggregation) + try container.encodeIfPresent(timeframe, forKey: .timeframe) + } +} + diff --git a/Sources/Models/AnalyticsAggregatedMetricsResponseContextTimeframe.swift b/Sources/Models/AnalyticsAggregatedMetricsResponseContextTimeframe.swift new file mode 100644 index 0000000..015c796 --- /dev/null +++ b/Sources/Models/AnalyticsAggregatedMetricsResponseContextTimeframe.swift @@ -0,0 +1,39 @@ +// +// AnalyticsAggregatedMetricsResponseContextTimeframe.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +/** Returns the starting and ending date-times of the period you want analytics for. */ +public struct AnalyticsAggregatedMetricsResponseContextTimeframe: Codable, Hashable { + + /** Returns the starting date-time of the period you want analytics for in ATOM date-time format. */ + public var from: Date? + /** Returns the starting date-time of the period you want analytics for in ATOM date-time format. */ + public var to: Date? + + public init(from: Date? = nil, to: Date? = nil) { + self.from = from + self.to = to + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case from + case to + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(from, forKey: .from) + try container.encodeIfPresent(to, forKey: .to) + } +} + diff --git a/Sources/Models/AnalyticsMetricsBreakdownResponse.swift b/Sources/Models/AnalyticsMetricsBreakdownResponse.swift new file mode 100644 index 0000000..44a5dbb --- /dev/null +++ b/Sources/Models/AnalyticsMetricsBreakdownResponse.swift @@ -0,0 +1,41 @@ +// +// AnalyticsMetricsBreakdownResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AnalyticsMetricsBreakdownResponse: Codable, Hashable { + + public var context: AnalyticsMetricsBreakdownResponseContext + /** Returns an array of dimensions and their respective metrics. */ + public var data: [AnalyticsMetricsBreakdownResponseData] + public var pagination: Pagination + + public init(context: AnalyticsMetricsBreakdownResponseContext, data: [AnalyticsMetricsBreakdownResponseData], pagination: Pagination) { + self.context = context + self.data = data + self.pagination = pagination + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case context + case data + case pagination + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(context, forKey: .context) + try container.encode(data, forKey: .data) + try container.encode(pagination, forKey: .pagination) + } +} + diff --git a/Sources/Models/AnalyticsMetricsBreakdownResponseContext.swift b/Sources/Models/AnalyticsMetricsBreakdownResponseContext.swift new file mode 100644 index 0000000..43fe63e --- /dev/null +++ b/Sources/Models/AnalyticsMetricsBreakdownResponseContext.swift @@ -0,0 +1,58 @@ +// +// AnalyticsMetricsBreakdownResponseContext.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AnalyticsMetricsBreakdownResponseContext: Codable, Hashable { + + public enum Metric: String, Codable, CaseIterable { + case play = "play" + case playRate = "play-rate" + case start = "start" + case end = "end" + case impression = "impression" + } + public enum Breakdown: String, Codable, CaseIterable { + case mediaId = "media-id" + case mediaType = "media-type" + case continent = "continent" + case country = "country" + case deviceType = "device-type" + case operatingSystem = "operating-system" + case browser = "browser" + } + /** Returns the metric you selected. */ + public var metric: Metric? + /** Returns the dimension you selected. */ + public var breakdown: Breakdown? + public var timeframe: AnalyticsAggregatedMetricsResponseContextTimeframe? + + public init(metric: Metric? = nil, breakdown: Breakdown? = nil, timeframe: AnalyticsAggregatedMetricsResponseContextTimeframe? = nil) { + self.metric = metric + self.breakdown = breakdown + self.timeframe = timeframe + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case metric + case breakdown + case timeframe + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(metric, forKey: .metric) + try container.encodeIfPresent(breakdown, forKey: .breakdown) + try container.encodeIfPresent(timeframe, forKey: .timeframe) + } +} + diff --git a/Sources/Models/AnalyticsMetricsBreakdownResponseData.swift b/Sources/Models/AnalyticsMetricsBreakdownResponseData.swift new file mode 100644 index 0000000..16a1a59 --- /dev/null +++ b/Sources/Models/AnalyticsMetricsBreakdownResponseData.swift @@ -0,0 +1,38 @@ +// +// AnalyticsMetricsBreakdownResponseData.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AnalyticsMetricsBreakdownResponseData: Codable, Hashable { + + /** Returns a specific value for the dimension you selected, based on the data. For example if you select `continent` as a dimension, then `dimensionValue` returns values like `EU` or \"AZ\". */ + public var dimensionValue: String? + /** Returns the data for a specific dimension value. */ + public var metricValue: Float? + + public init(dimensionValue: String? = nil, metricValue: Float? = nil) { + self.dimensionValue = dimensionValue + self.metricValue = metricValue + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case dimensionValue + case metricValue + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(dimensionValue, forKey: .dimensionValue) + try container.encodeIfPresent(metricValue, forKey: .metricValue) + } +} + diff --git a/Sources/Models/AnalyticsMetricsOverTimeResponse.swift b/Sources/Models/AnalyticsMetricsOverTimeResponse.swift new file mode 100644 index 0000000..8fd8276 --- /dev/null +++ b/Sources/Models/AnalyticsMetricsOverTimeResponse.swift @@ -0,0 +1,41 @@ +// +// AnalyticsMetricsOverTimeResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AnalyticsMetricsOverTimeResponse: Codable, Hashable { + + public var context: AnalyticsMetricsOverTimeResponseContext + /** Returns an array of metrics and the timestamps . */ + public var data: [AnalyticsMetricsOverTimeResponseData] + public var pagination: Pagination + + public init(context: AnalyticsMetricsOverTimeResponseContext, data: [AnalyticsMetricsOverTimeResponseData], pagination: Pagination) { + self.context = context + self.data = data + self.pagination = pagination + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case context + case data + case pagination + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(context, forKey: .context) + try container.encode(data, forKey: .data) + try container.encode(pagination, forKey: .pagination) + } +} + diff --git a/Sources/Models/AnalyticsMetricsOverTimeResponseContext.swift b/Sources/Models/AnalyticsMetricsOverTimeResponseContext.swift new file mode 100644 index 0000000..a6062b8 --- /dev/null +++ b/Sources/Models/AnalyticsMetricsOverTimeResponseContext.swift @@ -0,0 +1,53 @@ +// +// AnalyticsMetricsOverTimeResponseContext.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AnalyticsMetricsOverTimeResponseContext: Codable, Hashable { + + public enum Metric: String, Codable, CaseIterable { + case play = "play" + case playRate = "play-rate" + case start = "start" + case end = "end" + case impression = "impression" + } + public enum Interval: String, Codable, CaseIterable { + case hour = "hour" + case day = "day" + } + /** Returns the metric you selected. */ + public var metric: Metric? + /** Returns the interval you selected. */ + public var interval: Interval? + public var timeframe: AnalyticsAggregatedMetricsResponseContextTimeframe? + + public init(metric: Metric? = nil, interval: Interval? = nil, timeframe: AnalyticsAggregatedMetricsResponseContextTimeframe? = nil) { + self.metric = metric + self.interval = interval + self.timeframe = timeframe + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case metric + case interval + case timeframe + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(metric, forKey: .metric) + try container.encodeIfPresent(interval, forKey: .interval) + try container.encodeIfPresent(timeframe, forKey: .timeframe) + } +} + diff --git a/Sources/Models/AnalyticsMetricsOverTimeResponseData.swift b/Sources/Models/AnalyticsMetricsOverTimeResponseData.swift new file mode 100644 index 0000000..5ad195b --- /dev/null +++ b/Sources/Models/AnalyticsMetricsOverTimeResponseData.swift @@ -0,0 +1,38 @@ +// +// AnalyticsMetricsOverTimeResponseData.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct AnalyticsMetricsOverTimeResponseData: Codable, Hashable { + + /** Returns the timestamp of the event that belongs to a specific metric in ATOM date-time format. For example, if you set `play` with an `hour` interval in your request, then `emittedAt` returns the hourly timestamps of every play event within the timeframe you defined. */ + public var emittedAt: String? + /** Returns the data for a specific metric value. */ + public var metricValue: Float? + + public init(emittedAt: String? = nil, metricValue: Float? = nil) { + self.emittedAt = emittedAt + self.metricValue = metricValue + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case emittedAt + case metricValue + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(emittedAt, forKey: .emittedAt) + try container.encodeIfPresent(metricValue, forKey: .metricValue) + } +} + diff --git a/Sources/Models/LiveStream.swift b/Sources/Models/LiveStream.swift index 8422842..96deb18 100644 --- a/Sources/Models/LiveStream.swift +++ b/Sources/Models/LiveStream.swift @@ -18,14 +18,14 @@ public struct LiveStream: Codable, Hashable { public var name: String? /** The unique, private stream key that you use to begin streaming. */ public var streamKey: String? - /** Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery-analytics/video-privacy-access-management). */ + /** Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery/video-privacy-access-management). */ public var _public: Bool? public var assets: LiveStreamAssets? /** The unique identifier for the player. */ public var playerId: String? /** Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not. */ public var broadcasting: Bool? - /** Returns the list of RTMP restream destinations. */ + /** Returns the list of restream destinations. */ public var restreams: [RestreamsResponseObject] /** When the player was created, presented in ISO-8601 format. */ public var createdAt: Date? diff --git a/Sources/Models/LiveStreamCreationPayload.swift b/Sources/Models/LiveStreamCreationPayload.swift index 06a38aa..1416dcc 100644 --- a/Sources/Models/LiveStreamCreationPayload.swift +++ b/Sources/Models/LiveStreamCreationPayload.swift @@ -14,11 +14,11 @@ public struct LiveStreamCreationPayload: Codable, Hashable { /** Add a name for your live stream here. */ public var name: String - /** Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery-analytics/video-privacy-access-management). */ + /** Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery/video-privacy-access-management). */ public var _public: Bool? /** The unique identifier for the player. */ public var playerId: String? - /** Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. */ + /** Use this parameter to add, edit, or remove `RTMPS` or `RTMP` services where you want to restream a live stream. The list can only contain up to 5 destinations. */ public var restreams: [RestreamsRequestObject]? public init(name: String, _public: Bool? = nil, playerId: String? = nil, restreams: [RestreamsRequestObject]? = nil) { diff --git a/Sources/Models/LiveStreamSession.swift b/Sources/Models/LiveStreamSession.swift deleted file mode 100644 index 432dc2f..0000000 --- a/Sources/Models/LiveStreamSession.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// LiveStreamSession.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -public struct LiveStreamSession: Codable, Hashable { - - public var session: LiveStreamSessionSession? - public var location: LiveStreamSessionLocation? - public var referrer: LiveStreamSessionReferrer? - public var device: LiveStreamSessionDevice? - public var os: VideoSessionOs? - public var client: LiveStreamSessionClient? - - public init(session: LiveStreamSessionSession? = nil, location: LiveStreamSessionLocation? = nil, referrer: LiveStreamSessionReferrer? = nil, device: LiveStreamSessionDevice? = nil, os: VideoSessionOs? = nil, client: LiveStreamSessionClient? = nil) { - self.session = session - self.location = location - self.referrer = referrer - self.device = device - self.os = os - self.client = client - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case session - case location - case referrer - case device - case os - case client - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(session, forKey: .session) - try container.encodeIfPresent(location, forKey: .location) - try container.encodeIfPresent(referrer, forKey: .referrer) - try container.encodeIfPresent(device, forKey: .device) - try container.encodeIfPresent(os, forKey: .os) - try container.encodeIfPresent(client, forKey: .client) - } -} - diff --git a/Sources/Models/LiveStreamSessionClient.swift b/Sources/Models/LiveStreamSessionClient.swift deleted file mode 100644 index eee824c..0000000 --- a/Sources/Models/LiveStreamSessionClient.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// LiveStreamSessionClient.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -/** What kind of browser the viewer is using for the live stream session. */ -public struct LiveStreamSessionClient: Codable, Hashable { - - /** The name of the browser used to view the live stream session. */ - public var name: String? - /** The version of the browser used to view the live stream session. */ - public var version: String? - /** The type of client used to view the live stream session. */ - public var type: String? - - public init(name: String? = nil, version: String? = nil, type: String? = nil) { - self.name = name - self.version = version - self.type = type - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case name - case version - case type - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(name, forKey: .name) - try container.encodeIfPresent(version, forKey: .version) - try container.encodeIfPresent(type, forKey: .type) - } -} - diff --git a/Sources/Models/LiveStreamSessionDevice.swift b/Sources/Models/LiveStreamSessionDevice.swift deleted file mode 100644 index 1646f69..0000000 --- a/Sources/Models/LiveStreamSessionDevice.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// LiveStreamSessionDevice.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -/** What type of device the user is on when in the live stream session. */ -public struct LiveStreamSessionDevice: Codable, Hashable { - - /** What the type is like desktop, laptop, mobile. */ - public var type: String? - /** If known, what the brand of the device is, like Apple, Dell, etc. */ - public var vendor: String? - /** The specific model of the device, if known. */ - public var model: String? - - public init(type: String? = nil, vendor: String? = nil, model: String? = nil) { - self.type = type - self.vendor = vendor - self.model = model - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case type - case vendor - case model - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(type, forKey: .type) - try container.encodeIfPresent(vendor, forKey: .vendor) - try container.encodeIfPresent(model, forKey: .model) - } -} - diff --git a/Sources/Models/LiveStreamSessionLocation.swift b/Sources/Models/LiveStreamSessionLocation.swift deleted file mode 100644 index 28d3560..0000000 --- a/Sources/Models/LiveStreamSessionLocation.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// LiveStreamSessionLocation.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -/** The location of the viewer of the live stream. */ -public struct LiveStreamSessionLocation: Codable, Hashable { - - /** The country of the viewer of the live stream. */ - public var country: String? - /** The city of the viewer of the live stream. */ - public var city: String? - - public init(country: String? = nil, city: String? = nil) { - self.country = country - self.city = city - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case country - case city - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(country, forKey: .country) - try container.encodeIfPresent(city, forKey: .city) - } -} - diff --git a/Sources/Models/LiveStreamSessionReferrer.swift b/Sources/Models/LiveStreamSessionReferrer.swift deleted file mode 100644 index 9ec500a..0000000 --- a/Sources/Models/LiveStreamSessionReferrer.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// LiveStreamSessionReferrer.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -public struct LiveStreamSessionReferrer: Codable, Hashable { - - /** The website the viewer of the live stream was referred to in order to view the live stream. */ - public var url: String? - /** The type of search that brought the viewer to the live stream. Organic would be they found it on their own, paid would be they found it via an advertisement. */ - public var medium: String? - /** Where the viewer came from to see the live stream (usually where they searched from). */ - public var source: String? - /** What term they searched for that led them to the live stream. */ - public var searchTerm: String? - - public init(url: String? = nil, medium: String? = nil, source: String? = nil, searchTerm: String? = nil) { - self.url = url - self.medium = medium - self.source = source - self.searchTerm = searchTerm - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case url - case medium - case source - case searchTerm - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(url, forKey: .url) - try container.encodeIfPresent(medium, forKey: .medium) - try container.encodeIfPresent(source, forKey: .source) - try container.encodeIfPresent(searchTerm, forKey: .searchTerm) - } -} - diff --git a/Sources/Models/LiveStreamSessionSession.swift b/Sources/Models/LiveStreamSessionSession.swift deleted file mode 100644 index e18b5f7..0000000 --- a/Sources/Models/LiveStreamSessionSession.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// LiveStreamSessionSession.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -public struct LiveStreamSessionSession: Codable, Hashable { - - /** A unique identifier for your session. You can use this to track what happens during a specific session. */ - public var sessionId: String? - /** When the session started, with the date and time presented in ISO-8601 format. */ - public var loadedAt: Date? - /** When the session ended, with the date and time presented in ISO-8601 format. */ - public var endedAt: Date? - - public init(sessionId: String? = nil, loadedAt: Date? = nil, endedAt: Date? = nil) { - self.sessionId = sessionId - self.loadedAt = loadedAt - self.endedAt = endedAt - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case sessionId - case loadedAt - case endedAt - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(sessionId, forKey: .sessionId) - try container.encodeIfPresent(loadedAt, forKey: .loadedAt) - try container.encodeIfPresent(endedAt, forKey: .endedAt) - } -} - diff --git a/Sources/Models/LiveStreamUpdatePayload.swift b/Sources/Models/LiveStreamUpdatePayload.swift index 526f0af..2ea3390 100644 --- a/Sources/Models/LiveStreamUpdatePayload.swift +++ b/Sources/Models/LiveStreamUpdatePayload.swift @@ -14,11 +14,11 @@ public struct LiveStreamUpdatePayload: Codable, Hashable { /** The name you want to use for your live stream. */ public var name: String? - /** Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery-analytics/video-privacy-access-management). */ + /** Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery/video-privacy-access-management). */ public var _public: Bool? /** The unique ID for the player associated with a live stream that you want to update. */ public var playerId: String? - /** Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed. */ + /** Use this parameter to add, edit, or remove `RTMPS` or `RTMP` services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed. */ public var restreams: [RestreamsRequestObject]? public init(name: String? = nil, _public: Bool? = nil, playerId: String? = nil, restreams: [RestreamsRequestObject]? = nil) { diff --git a/Sources/Models/RestreamsRequestObject.swift b/Sources/Models/RestreamsRequestObject.swift index aecf37e..024face 100644 --- a/Sources/Models/RestreamsRequestObject.swift +++ b/Sources/Models/RestreamsRequestObject.swift @@ -15,7 +15,7 @@ public struct RestreamsRequestObject: Codable, Hashable { /** Use this parameter to define a name for the restream destination. */ public var name: String - /** Use this parameter to set the RTMP URL of the restream destination. */ + /** Use this parameter to set the `RTMPS` or `RTMP` server URL of the restream destination. */ public var serverUrl: String /** Use this parameter to provide the unique key of the live stream that you want to restream. */ public var streamKey: String diff --git a/Sources/Models/RestreamsResponseObject.swift b/Sources/Models/RestreamsResponseObject.swift index a2c6532..ede3655 100644 --- a/Sources/Models/RestreamsResponseObject.swift +++ b/Sources/Models/RestreamsResponseObject.swift @@ -14,7 +14,7 @@ public struct RestreamsResponseObject: Codable, Hashable { /** Returns the name of a restream destination. */ public var name: String? - /** Returns the RTMP URL of a restream destination. */ + /** Returns the server URL of a restream destination. */ public var serverUrl: String? /** Returns the unique key of the live stream that is set up for restreaming. */ public var streamKey: String? diff --git a/Sources/Models/UnrecognizedRequestUrl.swift b/Sources/Models/UnrecognizedRequestUrl.swift new file mode 100644 index 0000000..560c2e1 --- /dev/null +++ b/Sources/Models/UnrecognizedRequestUrl.swift @@ -0,0 +1,43 @@ +// +// UnrecognizedRequestUrl.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if canImport(AnyCodable) +import AnyCodable +#endif + +public struct UnrecognizedRequestUrl: Codable, Hashable { + + /** A link to the error documentation. */ + public var type: String? + /** A description of the error that occurred. */ + public var title: String? + /** The HTTP status code. */ + public var status: Int? + + public init(type: String? = nil, title: String? = nil, status: Int? = nil) { + self.type = type + self.title = title + self.status = status + } + + public enum CodingKeys: String, CodingKey, CaseIterable { + case type + case title + case status + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encodeIfPresent(type, forKey: .type) + try container.encodeIfPresent(title, forKey: .title) + try container.encodeIfPresent(status, forKey: .status) + } +} + diff --git a/Sources/Models/VideoCreationPayload.swift b/Sources/Models/VideoCreationPayload.swift index f092468..22e5c13 100644 --- a/Sources/Models/VideoCreationPayload.swift +++ b/Sources/Models/VideoCreationPayload.swift @@ -18,7 +18,7 @@ public struct VideoCreationPayload: Codable, Hashable { public var description: String? /** You can either add a video already on the web, by entering the URL of the video, or you can also enter the `videoId` of one of the videos you already have on your api.video acccount, and this will generate a copy of your video. Creating a copy of a video can be especially useful if you want to keep your original video and trim or apply a watermark onto the copy you would create. */ public var source: String? - /** Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/delivery-analytics/video-privacy-access-management) */ + /** Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/delivery/video-privacy-access-management) */ public var _public: Bool? = true /** Indicates if your video is a 360/immersive video. */ public var panoramic: Bool? = false diff --git a/Sources/Models/VideoSession.swift b/Sources/Models/VideoSession.swift deleted file mode 100644 index 88ee365..0000000 --- a/Sources/Models/VideoSession.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// VideoSession.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -public struct VideoSession: Codable, Hashable { - - public var session: VideoSessionSession? - public var location: VideoSessionLocation? - public var referrer: VideoSessionReferrer? - public var device: VideoSessionDevice? - public var os: VideoSessionOs? - public var client: VideoSessionClient? - - public init(session: VideoSessionSession? = nil, location: VideoSessionLocation? = nil, referrer: VideoSessionReferrer? = nil, device: VideoSessionDevice? = nil, os: VideoSessionOs? = nil, client: VideoSessionClient? = nil) { - self.session = session - self.location = location - self.referrer = referrer - self.device = device - self.os = os - self.client = client - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case session - case location - case referrer - case device - case os - case client - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(session, forKey: .session) - try container.encodeIfPresent(location, forKey: .location) - try container.encodeIfPresent(referrer, forKey: .referrer) - try container.encodeIfPresent(device, forKey: .device) - try container.encodeIfPresent(os, forKey: .os) - try container.encodeIfPresent(client, forKey: .client) - } -} - diff --git a/Sources/Models/VideoSessionClient.swift b/Sources/Models/VideoSessionClient.swift deleted file mode 100644 index e970477..0000000 --- a/Sources/Models/VideoSessionClient.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// VideoSessionClient.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -/** What kind of browser the viewer is using for the video session. */ -public struct VideoSessionClient: Codable, Hashable { - - /** The name of the browser used to view the video session. */ - public var name: String? - /** The version of the browser used to view the video session. */ - public var version: String? - /** The type of client used to view the video session. */ - public var type: String? - - public init(name: String? = nil, version: String? = nil, type: String? = nil) { - self.name = name - self.version = version - self.type = type - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case name - case version - case type - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(name, forKey: .name) - try container.encodeIfPresent(version, forKey: .version) - try container.encodeIfPresent(type, forKey: .type) - } -} - diff --git a/Sources/Models/VideoSessionDevice.swift b/Sources/Models/VideoSessionDevice.swift deleted file mode 100644 index 6f44859..0000000 --- a/Sources/Models/VideoSessionDevice.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// VideoSessionDevice.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -/** What type of device the user is on when in the video session. */ -public struct VideoSessionDevice: Codable, Hashable { - - /** What the type is like desktop, laptop, mobile. */ - public var type: String? - /** If known, what the brand of the device is, like Apple, Dell, etc. */ - public var vendor: String? - /** The specific model of the device, if known. */ - public var model: String? - - public init(type: String? = nil, vendor: String? = nil, model: String? = nil) { - self.type = type - self.vendor = vendor - self.model = model - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case type - case vendor - case model - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(type, forKey: .type) - try container.encodeIfPresent(vendor, forKey: .vendor) - try container.encodeIfPresent(model, forKey: .model) - } -} - diff --git a/Sources/Models/VideoSessionLocation.swift b/Sources/Models/VideoSessionLocation.swift deleted file mode 100644 index f599c38..0000000 --- a/Sources/Models/VideoSessionLocation.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// VideoSessionLocation.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -/** The location of the viewer. */ -public struct VideoSessionLocation: Codable, Hashable { - - /** The country of the viewer. */ - public var country: String? - /** The city of the viewer. */ - public var city: String? - - public init(country: String? = nil, city: String? = nil) { - self.country = country - self.city = city - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case country - case city - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(country, forKey: .country) - try container.encodeIfPresent(city, forKey: .city) - } -} - diff --git a/Sources/Models/VideoSessionOs.swift b/Sources/Models/VideoSessionOs.swift deleted file mode 100644 index 6832ba6..0000000 --- a/Sources/Models/VideoSessionOs.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// VideoSessionOs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -/** The operating system the viewer is on. */ -public struct VideoSessionOs: Codable, Hashable { - - /** The name of the operating system. */ - public var name: String? - /** The nickname for the operating system, often representing the version. */ - public var shortname: String? - /** The version of the operating system. */ - public var version: String? - - public init(name: String? = nil, shortname: String? = nil, version: String? = nil) { - self.name = name - self.shortname = shortname - self.version = version - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case name - case shortname - case version - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(name, forKey: .name) - try container.encodeIfPresent(shortname, forKey: .shortname) - try container.encodeIfPresent(version, forKey: .version) - } -} - diff --git a/Sources/Models/VideoSessionReferrer.swift b/Sources/Models/VideoSessionReferrer.swift deleted file mode 100644 index 7e8af09..0000000 --- a/Sources/Models/VideoSessionReferrer.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// VideoSessionReferrer.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -public struct VideoSessionReferrer: Codable, Hashable { - - /** The link the viewer used to reach the video session. */ - public var url: String? - /** How they arrived at the site, for example organic or paid. Organic meaning they found it themselves and paid meaning they followed a link from an advertisement. */ - public var medium: String? - /** The source the referrer came from to the video session. For example if they searched through google to find the stream. */ - public var source: String? - /** The search term they typed to arrive at the video session. */ - public var searchTerm: String? - - public init(url: String? = nil, medium: String? = nil, source: String? = nil, searchTerm: String? = nil) { - self.url = url - self.medium = medium - self.source = source - self.searchTerm = searchTerm - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case url - case medium - case source - case searchTerm - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(url, forKey: .url) - try container.encodeIfPresent(medium, forKey: .medium) - try container.encodeIfPresent(source, forKey: .source) - try container.encodeIfPresent(searchTerm, forKey: .searchTerm) - } -} - diff --git a/Sources/Models/VideoSessionSession.swift b/Sources/Models/VideoSessionSession.swift deleted file mode 100644 index ba702bb..0000000 --- a/Sources/Models/VideoSessionSession.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// VideoSessionSession.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if canImport(AnyCodable) -import AnyCodable -#endif - -public struct VideoSessionSession: Codable, Hashable { - - /** The unique identifier for the session that you can use to track what happens during it. */ - public var sessionId: String? - /** When the video session started, presented in ISO-8601 format. */ - public var loadedAt: Date? - /** When the video session ended, presented in ISO-8601 format. */ - public var endedAt: Date? - /** A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. You can also just use the pairs as another way to tag and categorize your videos. */ - public var metadata: [Metadata]? - - public init(sessionId: String? = nil, loadedAt: Date? = nil, endedAt: Date? = nil, metadata: [Metadata]? = nil) { - self.sessionId = sessionId - self.loadedAt = loadedAt - self.endedAt = endedAt - self.metadata = metadata - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case sessionId - case loadedAt - case endedAt - case metadata - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(sessionId, forKey: .sessionId) - try container.encodeIfPresent(loadedAt, forKey: .loadedAt) - try container.encodeIfPresent(endedAt, forKey: .endedAt) - try container.encodeIfPresent(metadata, forKey: .metadata) - } -} - diff --git a/Tests/TestResources/payloads/advancedauthentication/authenticate/responses/400.json b/Tests/TestResources/payloads/advancedauthentication/authenticate/responses/400.json index 84cacbd..8d37eec 100644 --- a/Tests/TestResources/payloads/advancedauthentication/authenticate/responses/400.json +++ b/Tests/TestResources/payloads/advancedauthentication/authenticate/responses/400.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/authenticationinvalid_credentials", + "type" : "https://docs.api.video/reference/authentication-invalid-user-credentials", "title" : "The user credentials were incorrect.", "name" : "", "status" : 400 diff --git a/Tests/TestResources/payloads/advancedauthentication/refresh/responses/400.json b/Tests/TestResources/payloads/advancedauthentication/refresh/responses/400.json index 0c86651..b7e947e 100644 --- a/Tests/TestResources/payloads/advancedauthentication/refresh/responses/400.json +++ b/Tests/TestResources/payloads/advancedauthentication/refresh/responses/400.json @@ -1,6 +1,6 @@ { "status" : 400, - "type" : "https://docs.api.video/docs/authenticationinvalid_credentials", + "type" : "https://docs.api.video/reference/authentication-invalid-user-credentials", "title" : "The user credentials were incorrect.", "name" : "" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/200.json b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/200.json new file mode 100644 index 0000000..aad4f98 --- /dev/null +++ b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/200.json @@ -0,0 +1,11 @@ +{ + "context" : { + "metric" : "impression", + "aggregation" : "count", + "timeframe" : { + "from" : "2024-05-28T11:15:07+00:00", + "to" : "2024-05-29T11:15:07+00:00" + } + }, + "data" : 346.5 +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-0.json b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/400-0.json similarity index 88% rename from Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-0.json rename to Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/400-0.json index 84db8c3..4cbfb11 100644 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-0.json +++ b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/400-0.json @@ -3,5 +3,5 @@ "title" : "An attribute is invalid.", "status" : 400, "detail" : "This value must be of type string.", - "name" : "dimension" + "name" : "metric" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-5.json b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/400-1.json similarity index 61% rename from Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-5.json rename to Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/400-1.json index 080db28..061e505 100644 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-5.json +++ b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/400-1.json @@ -2,6 +2,6 @@ "type" : "https://docs.api.video/reference/request-invalid-query-parameter", "title" : "A query parameter is invalid.", "status" : 400, - "detail" : "This value must refer to an existing video", - "name" : "filter" + "detail" : "This field was not expected.", + "name" : "from:2024-05-20T09:15:05+02:00" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/404.json b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/404.json new file mode 100644 index 0000000..a1ef71d --- /dev/null +++ b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/404.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/unrecognized-request-url", + "title" : "Unrecognized request URL.", + "status" : 404 +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/429.json b/Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/429.json similarity index 100% rename from Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/429.json rename to Tests/TestResources/payloads/analytics/getAggregatedMetrics/responses/429.json diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-0.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-0.json deleted file mode 100644 index 833d2ff..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-0.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "data" : [ { - "value" : "li3q7HxhApxRF1c8F8r6VeaI", - "plays" : 100 - }, { - "value" : "li3q7HxhApxRF1c8F8r6VeaB", - "plays" : 10 - }, { - "value" : "li3q7HxhApxRF1c8F8r6VeaD", - "plays" : 1 - } ], - "pagination" : { - "currentPage" : 1, - "currentPageItems" : 2, - "pageSize" : 2, - "pagesTotal" : 2, - "itemsTotal" : 3, - "links" : [ { - "rel" : "self", - "uri" : "/analytics/live-streams/plays?dimension=liveStreamId¤tPage=1&pageSize=2" - }, { - "rel" : "first", - "uri" : "/analytics/live-streams/plays?dimension=liveStreamId¤tPage=2&pageSize=1" - }, { - "rel" : "last", - "uri" : "/analytics/live-streams/plays?dimension=liveStreamId¤tPage=2&pageSize=1" - } ] - } -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-1.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-1.json deleted file mode 100644 index cf2e9e5..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-1.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "data" : [ { - "value" : "france", - "plays" : 100 - }, { - "value" : "united states", - "plays" : 10 - }, { - "value" : "spain", - "plays" : 1 - } ], - "pagination" : { - "currentPage" : 1, - "currentPageItems" : 2, - "pageSize" : 2, - "pagesTotal" : 2, - "itemsTotal" : 3, - "links" : [ { - "rel" : "self", - "uri" : "/analytics/live-streams/plays?dimension=country¤tPage=1&pageSize=2" - }, { - "rel" : "first", - "uri" : "/analytics/live-streams/plays?dimension=country¤tPage=1&pageSize=2" - }, { - "rel" : "last", - "uri" : "/analytics/live-streams/plays?dimension=country¤tPage=2&pageSize=1" - } ] - } -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-2.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-2.json deleted file mode 100644 index 4e08c61..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/200-2.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "data" : [ { - "value" : "2023-06-10T10:00:00.000Z", - "plays" : 100 - }, { - "value" : "2023-06-10T11:00:00.000Z", - "plays" : 10 - }, { - "value" : "2023-06-10T12:00:00.000Z", - "plays" : 1 - } ], - "pagination" : { - "currentPage" : 1, - "currentPageItems" : 3, - "pageSize" : 25, - "pagesTotal" : 1, - "itemsTotal" : 3, - "links" : [ { - "rel" : "self", - "uri" : "/analytics/live-streams/plays?dimension=videoId&filter=liveStreamId:li3VooPMbQLWdPF26qfmNVX6¤tPage=1&pageSize=25" - }, { - "rel" : "first", - "uri" : "/analytics/live-streams/plays?dimension=videoId&filter=liveStreamId:li3VooPMbQLWdPF26qfmNVX6¤tPage=1&pageSize=25" - }, { - "rel" : "last", - "uri" : "/analytics/live-streams/plays?dimension=videoId&filter=liveStreamId:li3VooPMbQLWdPF26qfmNVX6¤tPage=1&pageSize=25" - } ] - } -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-1.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-1.json deleted file mode 100644 index eaf7c78..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/request-invalid-query-parameter", - "title" : "A query parameter is invalid.", - "status" : 400, - "detail" : "This value must be of the following structure(s): liveStreamId:{liveStreamId}", - "name" : "filter" -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-2.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-2.json deleted file mode 100644 index 282264f..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/request-invalid-query-parameter", - "title" : "A query parameter is invalid.", - "status" : 400, - "detail" : "This value must be part of the following values: emittedAt,liveStreamId,country,deviceType,operatingSystem,browser", - "name" : "dimension" -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-3.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-3.json deleted file mode 100644 index 282264f..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-3.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/request-invalid-query-parameter", - "title" : "A query parameter is invalid.", - "status" : 400, - "detail" : "This value must be part of the following values: emittedAt,liveStreamId,country,deviceType,operatingSystem,browser", - "name" : "dimension" -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-4.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-4.json deleted file mode 100644 index eaf7c78..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-4.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/request-invalid-query-parameter", - "title" : "A query parameter is invalid.", - "status" : 400, - "detail" : "This value must be of the following structure(s): liveStreamId:{liveStreamId}", - "name" : "filter" -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/403.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/403.json deleted file mode 100644 index cdd0425..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/403.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/authorization-disabled-analytics", - "title" : "You cannot get analytics from this project.", - "status" : 403 -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/404.json b/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/404.json deleted file mode 100644 index f366b6f..0000000 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/404.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "status" : 404 -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/200.json b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/200.json new file mode 100644 index 0000000..f5cdba3 --- /dev/null +++ b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/200.json @@ -0,0 +1,31 @@ +{ + "context" : { + "metric" : "play", + "breakdown" : "country", + "timeframe" : { + "from" : "2024-04-28T07:15:05+00:00", + "to" : "2024-05-29T11:25:37+00:00" + } + }, + "data" : [ { + "metricValue" : 7, + "dimensionValue" : "FR" + } ], + "pagination" : { + "currentPage" : 1, + "currentPageItems" : 1, + "pageSize" : 25, + "pagesTotal" : 1, + "itemsTotal" : 1, + "links" : [ { + "rel" : "self", + "uri" : "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25" + }, { + "rel" : "first", + "uri" : "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25" + }, { + "rel" : "last", + "uri" : "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25" + } ] + } +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-0.json b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/400-0.json similarity index 88% rename from Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-0.json rename to Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/400-0.json index 84db8c3..4cbfb11 100644 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-0.json +++ b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/400-0.json @@ -3,5 +3,5 @@ "title" : "An attribute is invalid.", "status" : 400, "detail" : "This value must be of type string.", - "name" : "dimension" + "name" : "metric" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-5.json b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/400-1.json similarity index 61% rename from Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-5.json rename to Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/400-1.json index 95b2f61..061e505 100644 --- a/Tests/TestResources/payloads/analytics/getLiveStreamsPlays/responses/400-5.json +++ b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/400-1.json @@ -2,6 +2,6 @@ "type" : "https://docs.api.video/reference/request-invalid-query-parameter", "title" : "A query parameter is invalid.", "status" : 400, - "detail" : "This value must refer to an existing live stream", - "name" : "filter" + "detail" : "This field was not expected.", + "name" : "from:2024-05-20T09:15:05+02:00" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/404.json b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/404.json new file mode 100644 index 0000000..a1ef71d --- /dev/null +++ b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/404.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/unrecognized-request-url", + "title" : "Unrecognized request URL.", + "status" : 404 +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/429.json b/Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/429.json similarity index 100% rename from Tests/TestResources/payloads/analytics/getVideosPlays/responses/429.json rename to Tests/TestResources/payloads/analytics/getMetricsBreakdown/responses/429.json diff --git a/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/200.json b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/200.json new file mode 100644 index 0000000..b5a6342 --- /dev/null +++ b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/200.json @@ -0,0 +1,37 @@ +{ + "context" : { + "metric" : "play", + "interval" : "hour", + "timeframe" : { + "from" : "2024-05-28T11:08:39+00:00", + "to" : "2024-05-29T11:08:39+00:00" + } + }, + "data" : [ { + "emittedAt" : "2024-05-29T07:00:00+00:00", + "metricValue" : 2 + }, { + "emittedAt" : "2024-05-29T08:00:00+00:00", + "metricValue" : 1 + }, { + "emittedAt" : "2024-05-29T09:00:00+00:00", + "metricValue" : 1 + } ], + "pagination" : { + "currentPage" : 1, + "currentPageItems" : 3, + "pageSize" : 25, + "pagesTotal" : 1, + "itemsTotal" : 3, + "links" : [ { + "rel" : "self", + "uri" : "/data/timeseries/play?currentPage=1&pageSize=25" + }, { + "rel" : "first", + "uri" : "/data/timeseries/play?currentPage=1&pageSize=25" + }, { + "rel" : "last", + "uri" : "/data/timeseries/play?currentPage=1&pageSize=25" + } ] + } +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/400-0.json b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/400-0.json new file mode 100644 index 0000000..4cbfb11 --- /dev/null +++ b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/400-0.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/invalid-attribute", + "title" : "An attribute is invalid.", + "status" : 400, + "detail" : "This value must be of type string.", + "name" : "metric" +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-1.json b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/400-1.json similarity index 58% rename from Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-1.json rename to Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/400-1.json index b1044e2..061e505 100644 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-1.json +++ b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/400-1.json @@ -2,6 +2,6 @@ "type" : "https://docs.api.video/reference/request-invalid-query-parameter", "title" : "A query parameter is invalid.", "status" : 400, - "detail" : "This value must be of the following structure(s): videoId:{videoId}", - "name" : "filter" + "detail" : "This field was not expected.", + "name" : "from:2024-05-20T09:15:05+02:00" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/404.json b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/404.json new file mode 100644 index 0000000..a1ef71d --- /dev/null +++ b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/404.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/unrecognized-request-url", + "title" : "Unrecognized request URL.", + "status" : 404 +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/429.json b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/429.json new file mode 100644 index 0000000..d312e2b --- /dev/null +++ b/Tests/TestResources/payloads/analytics/getMetricsOverTime/responses/429.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/too-many-requests", + "title" : "Too many requests.", + "status" : 429 +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-0.json b/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-0.json deleted file mode 100644 index f0d1e9a..0000000 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-0.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "data" : [ { - "value" : "vi3q7HxhApxRF1c8F8r6VeaI", - "plays" : 100 - }, { - "value" : "vi3q7HxhApxRF1c8F8r6VeaF", - "plays" : 10 - }, { - "value" : "vi3q7HxhApxRF1c8F8r6VeaH", - "plays" : 1 - } ], - "pagination" : { - "currentPage" : 1, - "currentPageItems" : 3, - "pageSize" : 25, - "pagesTotal" : 1, - "itemsTotal" : 3, - "links" : [ { - "rel" : "self", - "uri" : "/analytics/videos/plays?dimension=videoId¤tPage=1&pageSize=25" - }, { - "rel" : "first", - "uri" : "/analytics/videos/plays?dimension=videoId¤tPage=1&pageSize=25" - }, { - "rel" : "last", - "uri" : "/analytics/videos/plays?dimension=videoId¤tPage=1&pageSize=25" - } ] - } -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-1.json b/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-1.json deleted file mode 100644 index 7348fe2..0000000 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-1.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "data" : [ { - "value" : "france", - "plays" : 100 - }, { - "value" : "united states", - "plays" : 10 - }, { - "value" : "spain", - "plays" : 1 - } ], - "pagination" : { - "currentPage" : 1, - "currentPageItems" : 2, - "pageSize" : 2, - "pagesTotal" : 2, - "itemsTotal" : 3, - "links" : [ { - "rel" : "self", - "uri" : "/analytics/videos/plays?dimension=country¤tPage=1&pageSize=2" - }, { - "rel" : "first", - "uri" : "/analytics/videos/plays?dimension=country¤tPage=1&pageSize=2" - }, { - "rel" : "next", - "uri" : "/analytics/videos/plays?dimension=country¤tPage=2&pageSize=1" - }, { - "rel" : "last", - "uri" : "/analytics/videos/plays?dimension=country¤tPage=2&pageSize=1" - } ] - } -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-2.json b/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-2.json deleted file mode 100644 index ae770da..0000000 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/200-2.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "data" : [ { - "value" : "2023-06-10T10:00:00.000Z", - "plays" : 100 - }, { - "value" : "2023-06-10T11:00:00.000Z", - "plays" : 10 - }, { - "value" : "2023-06-10T12:00:00.000Z", - "plays" : 1 - } ], - "pagination" : { - "currentPage" : 1, - "currentPageItems" : 3, - "pageSize" : 25, - "pagesTotal" : 1, - "itemsTotal" : 3, - "links" : [ { - "rel" : "self", - "uri" : "/analytics/videos/plays?dimension=videoId&filter=videoId:vi3VooPMbQLWdPF26qfmNVX6¤tPage=1&pageSize=25" - }, { - "rel" : "first", - "uri" : "/analytics/videos/plays?dimension=videoId&filter=videoId:vi3VooPMbQLWdPF26qfmNVX6¤tPage=1&pageSize=25" - }, { - "rel" : "last", - "uri" : "/analytics/videos/plays?dimension=videoId&filter=videoId:vi3VooPMbQLWdPF26qfmNVX6¤tPage=1&pageSize=25" - } ] - } -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-2.json b/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-2.json deleted file mode 100644 index 3f739e6..0000000 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/request-invalid-query-parameter", - "title" : "A query parameter is invalid.", - "status" : 400, - "detail" : "This value must be part of the following values: emittedAt,videoId,country,deviceType,operatingSystem,browser", - "name" : "dimension" -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-3.json b/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-3.json deleted file mode 100644 index 3f739e6..0000000 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-3.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/request-invalid-query-parameter", - "title" : "A query parameter is invalid.", - "status" : 400, - "detail" : "This value must be part of the following values: emittedAt,videoId,country,deviceType,operatingSystem,browser", - "name" : "dimension" -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-4.json b/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-4.json deleted file mode 100644 index b1044e2..0000000 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/400-4.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/request-invalid-query-parameter", - "title" : "A query parameter is invalid.", - "status" : 400, - "detail" : "This value must be of the following structure(s): videoId:{videoId}", - "name" : "filter" -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/403.json b/Tests/TestResources/payloads/analytics/getVideosPlays/responses/403.json deleted file mode 100644 index cdd0425..0000000 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/403.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type" : "https://docs.api.video/reference/authorization-disabled-analytics", - "title" : "You cannot get analytics from this project.", - "status" : 403 -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/404.json b/Tests/TestResources/payloads/analytics/getVideosPlays/responses/404.json deleted file mode 100644 index f366b6f..0000000 --- a/Tests/TestResources/payloads/analytics/getVideosPlays/responses/404.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "status" : 404 -} \ No newline at end of file diff --git a/Tests/TestResources/payloads/livestreams/complete/responses/404.json b/Tests/TestResources/payloads/livestreams/complete/responses/404.json new file mode 100644 index 0000000..87595d9 --- /dev/null +++ b/Tests/TestResources/payloads/livestreams/complete/responses/404.json @@ -0,0 +1,6 @@ +{ + "type" : "https://docs.api.video/reference/resource-not-found", + "title" : "The requested resource was not found.", + "name" : "liveStreamId", + "status" : 404 +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/livestreams/complete/responses/429.json b/Tests/TestResources/payloads/livestreams/complete/responses/429.json new file mode 100644 index 0000000..d312e2b --- /dev/null +++ b/Tests/TestResources/payloads/livestreams/complete/responses/429.json @@ -0,0 +1,5 @@ +{ + "type" : "https://docs.api.video/reference/too-many-requests", + "title" : "Too many requests.", + "status" : 429 +} \ No newline at end of file diff --git a/Tests/TestResources/payloads/livestreams/create/responses/400-1.json b/Tests/TestResources/payloads/livestreams/create/responses/400-1.json index 1350192..c3d6d42 100644 --- a/Tests/TestResources/payloads/livestreams/create/responses/400-1.json +++ b/Tests/TestResources/payloads/livestreams/create/responses/400-1.json @@ -2,6 +2,6 @@ "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "An attribute is invalid.", "status" : 400, - "detail" : "Missing app name: rtmp://[host]/[app name].", + "detail" : "Missing app name: [rtmp|rtmps]://[host]/[app name].", "name" : "restreams[0][serverUrl]" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/livestreams/create/responses/400-2.json b/Tests/TestResources/payloads/livestreams/create/responses/400-2.json index b05a8e3..ea329ab 100644 --- a/Tests/TestResources/payloads/livestreams/create/responses/400-2.json +++ b/Tests/TestResources/payloads/livestreams/create/responses/400-2.json @@ -2,6 +2,6 @@ "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "An attribute is invalid.", "status" : 400, - "detail" : "RTMP URL should have the following format: rtmp://[host]/[app name].", + "detail" : "RTMP URL should have the following format: [rtmp|rtmps]://[host]/[app name].", "name" : "restreams[0][serverUrl]" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/livestreams/deleteThumbnail/responses/404.json b/Tests/TestResources/payloads/livestreams/deleteThumbnail/responses/404.json index 9efa63b..87595d9 100644 --- a/Tests/TestResources/payloads/livestreams/deleteThumbnail/responses/404.json +++ b/Tests/TestResources/payloads/livestreams/deleteThumbnail/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "liveStreamId", "status" : 404 diff --git a/Tests/TestResources/payloads/livestreams/update/responses/400-1.json b/Tests/TestResources/payloads/livestreams/update/responses/400-1.json index 1350192..c3d6d42 100644 --- a/Tests/TestResources/payloads/livestreams/update/responses/400-1.json +++ b/Tests/TestResources/payloads/livestreams/update/responses/400-1.json @@ -2,6 +2,6 @@ "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "An attribute is invalid.", "status" : 400, - "detail" : "Missing app name: rtmp://[host]/[app name].", + "detail" : "Missing app name: [rtmp|rtmps]://[host]/[app name].", "name" : "restreams[0][serverUrl]" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/livestreams/update/responses/400-2.json b/Tests/TestResources/payloads/livestreams/update/responses/400-2.json index b05a8e3..ea329ab 100644 --- a/Tests/TestResources/payloads/livestreams/update/responses/400-2.json +++ b/Tests/TestResources/payloads/livestreams/update/responses/400-2.json @@ -2,6 +2,6 @@ "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "An attribute is invalid.", "status" : 400, - "detail" : "RTMP URL should have the following format: rtmp://[host]/[app name].", + "detail" : "RTMP URL should have the following format: [rtmp|rtmps]://[host]/[app name].", "name" : "restreams[0][serverUrl]" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/livestreams/uploadThumbnail/responses/400.json b/Tests/TestResources/payloads/livestreams/uploadThumbnail/responses/400.json index 631e001..b581e38 100644 --- a/Tests/TestResources/payloads/livestreams/uploadThumbnail/responses/400.json +++ b/Tests/TestResources/payloads/livestreams/uploadThumbnail/responses/400.json @@ -1,6 +1,6 @@ { "status" : 400, - "type" : "https://docs.api.video/docs/fileextension", + "type" : "https://docs.api.video/reference/uploaded-file-extension-invalid", "title" : "Only [jpeg, jpg, JPG, JPEG] extensions are supported.", "name" : "file" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/livestreams/uploadThumbnail/responses/404.json b/Tests/TestResources/payloads/livestreams/uploadThumbnail/responses/404.json index 9efa63b..87595d9 100644 --- a/Tests/TestResources/payloads/livestreams/uploadThumbnail/responses/404.json +++ b/Tests/TestResources/payloads/livestreams/uploadThumbnail/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "liveStreamId", "status" : 404 diff --git a/Tests/TestResources/payloads/playerthemes/delete/responses/404.json b/Tests/TestResources/payloads/playerthemes/delete/responses/404.json index 719c18c..30decf6 100644 --- a/Tests/TestResources/payloads/playerthemes/delete/responses/404.json +++ b/Tests/TestResources/payloads/playerthemes/delete/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "playerId", "status" : 404 diff --git a/Tests/TestResources/payloads/playerthemes/deleteLogo/responses/404.json b/Tests/TestResources/payloads/playerthemes/deleteLogo/responses/404.json index 719c18c..30decf6 100644 --- a/Tests/TestResources/payloads/playerthemes/deleteLogo/responses/404.json +++ b/Tests/TestResources/payloads/playerthemes/deleteLogo/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "playerId", "status" : 404 diff --git a/Tests/TestResources/payloads/playerthemes/get/responses/404.json b/Tests/TestResources/payloads/playerthemes/get/responses/404.json index 719c18c..30decf6 100644 --- a/Tests/TestResources/payloads/playerthemes/get/responses/404.json +++ b/Tests/TestResources/payloads/playerthemes/get/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "playerId", "status" : 404 diff --git a/Tests/TestResources/payloads/playerthemes/update/responses/404.json b/Tests/TestResources/payloads/playerthemes/update/responses/404.json index 719c18c..30decf6 100644 --- a/Tests/TestResources/payloads/playerthemes/update/responses/404.json +++ b/Tests/TestResources/payloads/playerthemes/update/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "playerId", "status" : 404 diff --git a/Tests/TestResources/payloads/playerthemes/uploadLogo/responses/400.json b/Tests/TestResources/payloads/playerthemes/uploadLogo/responses/400.json index a96e225..6ef950a 100644 --- a/Tests/TestResources/payloads/playerthemes/uploadLogo/responses/400.json +++ b/Tests/TestResources/payloads/playerthemes/uploadLogo/responses/400.json @@ -1,6 +1,6 @@ { "status" : 400, - "type" : "https://docs.api.video/docs/fileextension", + "type" : "https://docs.api.video/reference/uploaded-file-extension-invalid", "title" : "Only ['jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG'] extensions are supported.", "name" : "file" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/playerthemes/uploadLogo/responses/404.json b/Tests/TestResources/payloads/playerthemes/uploadLogo/responses/404.json index 719c18c..30decf6 100644 --- a/Tests/TestResources/payloads/playerthemes/uploadLogo/responses/404.json +++ b/Tests/TestResources/payloads/playerthemes/uploadLogo/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "playerId", "status" : 404 diff --git a/Tests/TestResources/payloads/videos/create/responses/400.json b/Tests/TestResources/payloads/videos/create/responses/400.json index fc789fc..c6358bf 100644 --- a/Tests/TestResources/payloads/videos/create/responses/400.json +++ b/Tests/TestResources/payloads/videos/create/responses/400.json @@ -1,22 +1,22 @@ { - "type" : "https://docs.api.video/docs/attributerequired", + "type" : "https://docs.api.video/reference/attribute-required", "title" : "This attribute is required.", "name" : "title", "status" : 400, "problems" : [ { - "type" : "https://docs.api.video/docs/attributerequired", + "type" : "https://docs.api.video/reference/attribute-required", "title" : "This attribute is required.", "name" : "title" }, { - "type" : "https://docs.api.video/docs/attributeinvalid", + "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "This attribute must be a ISO8601 date.", "name" : "scheduledAt" }, { - "type" : "https://docs.api.video/docs/attributeinvalid", + "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "This attribute must be an array.", "name" : "tags" }, { - "type" : "https://docs.api.video/docs/attributeinvalid", + "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "This attribute must be an array.", "name" : "metadata" } ] diff --git a/Tests/TestResources/payloads/videos/delete/responses/404.json b/Tests/TestResources/payloads/videos/delete/responses/404.json index 69b4332..27275e1 100644 --- a/Tests/TestResources/payloads/videos/delete/responses/404.json +++ b/Tests/TestResources/payloads/videos/delete/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "videoId", "status" : 404 diff --git a/Tests/TestResources/payloads/videos/get/responses/404.json b/Tests/TestResources/payloads/videos/get/responses/404.json index 69b4332..27275e1 100644 --- a/Tests/TestResources/payloads/videos/get/responses/404.json +++ b/Tests/TestResources/payloads/videos/get/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "videoId", "status" : 404 diff --git a/Tests/TestResources/payloads/videos/getStatus/responses/404.json b/Tests/TestResources/payloads/videos/getStatus/responses/404.json index 69b4332..27275e1 100644 --- a/Tests/TestResources/payloads/videos/getStatus/responses/404.json +++ b/Tests/TestResources/payloads/videos/getStatus/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "videoId", "status" : 404 diff --git a/Tests/TestResources/payloads/videos/pickThumbnail/responses/404.json b/Tests/TestResources/payloads/videos/pickThumbnail/responses/404.json index 69b4332..27275e1 100644 --- a/Tests/TestResources/payloads/videos/pickThumbnail/responses/404.json +++ b/Tests/TestResources/payloads/videos/pickThumbnail/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "videoId", "status" : 404 diff --git a/Tests/TestResources/payloads/videos/update/responses/400.json b/Tests/TestResources/payloads/videos/update/responses/400.json index 65910b5..9115c98 100644 --- a/Tests/TestResources/payloads/videos/update/responses/400.json +++ b/Tests/TestResources/payloads/videos/update/responses/400.json @@ -1,18 +1,18 @@ { - "type" : "https://docs.api.video/docs/attributeinvalid", + "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "This attribute must be a ISO-8601 date.", "name" : "scheduledAt", "status" : 400, "problems" : [ { - "type" : "https://docs.api.video/docs/attributeinvalid", + "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "This attribute must be a ISO-8601 date.", "name" : "scheduledAt" }, { - "type" : "https://docs.api.video/docs/attributeinvalid", + "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "This attribute must be an array.", "name" : "tags" }, { - "type" : "https://docs.api.video/docs/attributeinvalid", + "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "This attribute must be an array.", "name" : "metadata" } ] diff --git a/Tests/TestResources/payloads/videos/update/responses/404.json b/Tests/TestResources/payloads/videos/update/responses/404.json index 69b4332..27275e1 100644 --- a/Tests/TestResources/payloads/videos/update/responses/404.json +++ b/Tests/TestResources/payloads/videos/update/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "videoId", "status" : 404 diff --git a/Tests/TestResources/payloads/videos/upload/responses/400.json b/Tests/TestResources/payloads/videos/upload/responses/400.json index b90e95e..09d2579 100644 --- a/Tests/TestResources/payloads/videos/upload/responses/400.json +++ b/Tests/TestResources/payloads/videos/upload/responses/400.json @@ -1,22 +1,22 @@ { - "type" : "https://docs.api.video/docs/filealreadyuploaded", + "type" : "https://docs.api.video/reference/video-source-already-uploaded", "title" : "The source of the video is already uploaded.", "name" : "file", "status" : 400, "problems" : [ { - "type" : "https://docs.api.video/docs/filealreadyuploaded", + "type" : "https://docs.api.video/reference/video-source-already-uploaded", "title" : "The source of the video is already uploaded.", "name" : "file" }, { - "type" : "https://docs.api.video/docs/filealreadyuploaded", + "type" : "https://docs.api.video/reference/video-source-already-uploaded", "title" : "The video xxxx has already been uploaded.", "name" : "video" }, { - "type" : "https://docs.api.video/docs/filemissing", + "type" : "https://docs.api.video/reference/uploaded-file-no-file", "title" : "There is no uploaded file in the request.", "name" : "file" }, { - "type" : "https://docs.api.video/docs/multiplefilesuploaded", + "type" : "https://docs.api.video/reference/uploaded-file-multiple-files", "title" : "There is more than one uploaded file in the request.", "name" : "file" } ] diff --git a/Tests/TestResources/payloads/videos/upload/responses/404.json b/Tests/TestResources/payloads/videos/upload/responses/404.json index 69b4332..27275e1 100644 --- a/Tests/TestResources/payloads/videos/upload/responses/404.json +++ b/Tests/TestResources/payloads/videos/upload/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "videoId", "status" : 404 diff --git a/Tests/TestResources/payloads/videos/uploadThumbnail/responses/400.json b/Tests/TestResources/payloads/videos/uploadThumbnail/responses/400.json index 631e001..b581e38 100644 --- a/Tests/TestResources/payloads/videos/uploadThumbnail/responses/400.json +++ b/Tests/TestResources/payloads/videos/uploadThumbnail/responses/400.json @@ -1,6 +1,6 @@ { "status" : 400, - "type" : "https://docs.api.video/docs/fileextension", + "type" : "https://docs.api.video/reference/uploaded-file-extension-invalid", "title" : "Only [jpeg, jpg, JPG, JPEG] extensions are supported.", "name" : "file" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/videos/uploadThumbnail/responses/404.json b/Tests/TestResources/payloads/videos/uploadThumbnail/responses/404.json index 69b4332..27275e1 100644 --- a/Tests/TestResources/payloads/videos/uploadThumbnail/responses/404.json +++ b/Tests/TestResources/payloads/videos/uploadThumbnail/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "videoId", "status" : 404 diff --git a/Tests/TestResources/payloads/watermarks/delete/responses/404.json b/Tests/TestResources/payloads/watermarks/delete/responses/404.json index 4ca04c5..c31a9d8 100644 --- a/Tests/TestResources/payloads/watermarks/delete/responses/404.json +++ b/Tests/TestResources/payloads/watermarks/delete/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "watermarkId", "status" : 404 diff --git a/Tests/TestResources/payloads/watermarks/upload/responses/400.json b/Tests/TestResources/payloads/watermarks/upload/responses/400.json index 7d5c846..3b406ad 100644 --- a/Tests/TestResources/payloads/watermarks/upload/responses/400.json +++ b/Tests/TestResources/payloads/watermarks/upload/responses/400.json @@ -1,6 +1,6 @@ { "status" : 400, - "type" : "https://docs.api.video/docs/fileextension", + "type" : "https://docs.api.video/reference/uploaded-file-extension-invalid", "title" : "Only [jpeg, jpg, JPG, JPEG, png, PNG] extensions are supported.", "name" : "file" } \ No newline at end of file diff --git a/Tests/TestResources/payloads/webhooks/create/responses/400.json b/Tests/TestResources/payloads/webhooks/create/responses/400.json index 1878cc2..e7c9e89 100644 --- a/Tests/TestResources/payloads/webhooks/create/responses/400.json +++ b/Tests/TestResources/payloads/webhooks/create/responses/400.json @@ -1,18 +1,18 @@ { - "type" : "https://docs.api.video/docs/attributerequired", + "type" : "https://docs.api.video/reference/attribute-required", "events" : "This attribute is required.", "name" : "events", "status" : 400, "problems" : [ { - "type" : "https://docs.api.video/docs/attributerequired", + "type" : "https://docs.api.video/reference/attribute-required", "title" : "This attribute is required.", "name" : "events" }, { - "type" : "https://docs.api.video/docs/attributerequired", + "type" : "https://docs.api.video/reference/attribute-required", "title" : "This attribute is required.", "name" : "url" }, { - "type" : "https://docs.api.video/docs/attributeinvalid", + "type" : "https://docs.api.video/reference/invalid-attribute", "title" : "This attribute must be an array.", "name" : "events" } ] diff --git a/Tests/TestResources/payloads/webhooks/delete/responses/404.json b/Tests/TestResources/payloads/webhooks/delete/responses/404.json index 0721bb1..c97ea66 100644 --- a/Tests/TestResources/payloads/webhooks/delete/responses/404.json +++ b/Tests/TestResources/payloads/webhooks/delete/responses/404.json @@ -1,5 +1,5 @@ { - "type" : "https://docs.api.video/docs/resourcenot_found", + "type" : "https://docs.api.video/reference/resource-not-found", "title" : "The requested resource was not found.", "name" : "webhookId", "status" : 404 diff --git a/docs/AnalyticsAPI.md b/docs/AnalyticsAPI.md index 1392737..3884b43 100644 --- a/docs/AnalyticsAPI.md +++ b/docs/AnalyticsAPI.md @@ -4,19 +4,20 @@ All URIs are relative to *https://ws.api.video* Method | HTTP request | Description ------------- | ------------- | ------------- -[**getLiveStreamsPlays**](AnalyticsAPI.md#getanalyticslivestreamsplays) | **GET** /analytics/live-streams/plays | Get play events for live stream -[**getVideosPlays**](AnalyticsAPI.md#getanalyticsvideosplays) | **GET** /analytics/videos/plays | Get play events for video +[**getAggregatedMetrics**](AnalyticsAPI.md#getaggregatedmetrics) | **GET** /data/metrics/{metric}/{aggregation} | Retrieve aggregated metrics +[**getMetricsBreakdown**](AnalyticsAPI.md#getmetricsbreakdown) | **GET** /data/buckets/{metric}/{breakdown} | Retrieve metrics in a breakdown of dimensions +[**getMetricsOverTime**](AnalyticsAPI.md#getmetricsovertime) | **GET** /data/timeseries/{metric} | Retrieve metrics over time -# **getLiveStreamsPlays** +# **getAggregatedMetrics** ```swift - open class func getLiveStreamsPlays(from: Date, dimension: Dimension_getLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ data: AnalyticsPlaysResponse?, _ error: Error?) -> Void) - open class func getLiveStreamsPlays(from: Date, dimension: Dimension_getLiveStreamsPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) + open class func getAggregatedMetrics(metric: Metric_getAggregatedMetrics, aggregation: Aggregation_getAggregatedMetrics, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, completion: @escaping (_ data: AnalyticsAggregatedMetricsResponse?, _ error: Error?) -> Void) + open class func getAggregatedMetrics(metric: Metric_getAggregatedMetrics, aggregation: Aggregation_getAggregatedMetrics, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) ``` -Get play events for live stream +Retrieve aggregated metrics -Retrieve filtered analytics about the number of plays for your live streams in a project. +Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time. ### Example @@ -24,15 +25,76 @@ Retrieve filtered analytics about the number of plays for your live streams in a // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new import ApiVideoClient -let from = Date() // Date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. -let dimension = "dimension_example" // String | Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. -let to = Date() // Date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional) -let filter = "filter_example" // String | Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional) +let 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. +let 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. +let from = Date() // Date | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. (optional) +let to = Date() // Date | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) +let filterBy = "filterBy_example" // String | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) + +// Retrieve aggregated metrics +AnalyticsAPI.getAggregatedMetrics(metric: metric, aggregation: aggregation, from: from, to: to, filterBy: filterBy) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **metric** | **String** | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. | + **aggregation** | **String** | Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. | + **from** | **Date** | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. | [optional] + **to** | **Date** | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] + **filterBy** | **String** | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. | [optional] + +### Return type + +[**AnalyticsAggregatedMetricsResponse**](AnalyticsAggregatedMetricsResponse.md) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getMetricsBreakdown** +```swift + open class func getMetricsBreakdown(metric: Metric_getMetricsBreakdown, breakdown: Breakdown_getMetricsBreakdown, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ data: AnalyticsMetricsBreakdownResponse?, _ error: Error?) -> Void) + open class func getMetricsBreakdown(metric: Metric_getMetricsBreakdown, breakdown: Breakdown_getMetricsBreakdown, from: Date? = nil, to: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) +``` + +Retrieve metrics in a breakdown of dimensions + +Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type. + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import ApiVideoClient + +let 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. +let breakdown = "breakdown_example" // String | Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `device-type`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. +let from = Date() // Date | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) +let to = Date() // Date | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) +let filterBy = "filterBy_example" // String | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) let currentPage = 987 // Int | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1) let pageSize = 987 // Int | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25) -// Get play events for live stream -AnalyticsAPI.getLiveStreamsPlays(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize) { (response, error) in +// Retrieve metrics in a breakdown of dimensions +AnalyticsAPI.getMetricsBreakdown(metric: metric, breakdown: breakdown, from: from, to: to, filterBy: filterBy, currentPage: currentPage, pageSize: pageSize) { (response, error) in guard error == nil else { print(error) return @@ -48,16 +110,17 @@ AnalyticsAPI.getLiveStreamsPlays(from: from, dimension: dimension, to: to, filte Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **from** | **Date** | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. | - **dimension** | **String** | Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. | - **to** | **Date** | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. | [optional] - **filter** | **String** | Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. | [optional] + **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. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. | + **from** | **Date** | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | [optional] + **to** | **Date** | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] + **filterBy** | **String** | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. | [optional] **currentPage** | **Int** | Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] **pageSize** | **Int** | Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] ### Return type -[**AnalyticsPlaysResponse**](AnalyticsPlaysResponse.md) +[**AnalyticsMetricsBreakdownResponse**](AnalyticsMetricsBreakdownResponse.md) ### Authorization @@ -70,15 +133,15 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **getVideosPlays** +# **getMetricsOverTime** ```swift - open class func getVideosPlays(from: Date, dimension: Dimension_getVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ data: AnalyticsPlaysResponse?, _ error: Error?) -> Void) - open class func getVideosPlays(from: Date, dimension: Dimension_getVideosPlays, to: Date? = nil, filter: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) + open class func getMetricsOverTime(metric: Metric_getMetricsOverTime, from: Date? = nil, to: Date? = nil, interval: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ data: AnalyticsMetricsOverTimeResponse?, _ error: Error?) -> Void) + open class func getMetricsOverTime(metric: Metric_getMetricsOverTime, from: Date? = nil, to: Date? = nil, interval: Date? = nil, filterBy: String? = nil, currentPage: Int? = nil, pageSize: Int? = nil, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) ``` -Get play events for video +Retrieve metrics over time -Retrieve filtered analytics about the number of plays for your videos in a project. +Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred ### Example @@ -86,15 +149,16 @@ Retrieve filtered analytics about the number of plays for your videos in a proje // The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new import ApiVideoClient -let from = Date() // Date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. -let dimension = "dimension_example" // String | Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. -let to = Date() // Date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional) -let filter = "filter_example" // String | Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional) +let 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. +let from = Date() // Date | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) +let to = Date() // Date | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) +let interval = Date() // Date | Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. (optional) +let filterBy = "filterBy_example" // String | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. (optional) let currentPage = 987 // Int | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1) let pageSize = 987 // Int | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25) -// Get play events for video -AnalyticsAPI.getVideosPlays(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize) { (response, error) in +// Retrieve metrics over time +AnalyticsAPI.getMetricsOverTime(metric: metric, from: from, to: to, interval: interval, filterBy: filterBy, currentPage: currentPage, pageSize: pageSize) { (response, error) in guard error == nil else { print(error) return @@ -110,16 +174,17 @@ AnalyticsAPI.getVideosPlays(from: from, dimension: dimension, to: to, filter: fi Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **from** | **Date** | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. | - **dimension** | **String** | Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. | - **to** | **Date** | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. | [optional] - **filter** | **String** | Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. | [optional] + **metric** | **String** | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. | + **from** | **Date** | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | [optional] + **to** | **Date** | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] + **interval** | **Date** | Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. | [optional] + **filterBy** | **String** | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. You must use `camelCase` for query parameters. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values include `chrome`, `firefox`, `edge`, `opera`. | [optional] **currentPage** | **Int** | Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1] **pageSize** | **Int** | Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25] ### Return type -[**AnalyticsPlaysResponse**](AnalyticsPlaysResponse.md) +[**AnalyticsMetricsOverTimeResponse**](AnalyticsMetricsOverTimeResponse.md) ### Authorization diff --git a/docs/VideoSessionLocation.md b/docs/AnalyticsAggregatedMetricsResponse.md similarity index 60% rename from docs/VideoSessionLocation.md rename to docs/AnalyticsAggregatedMetricsResponse.md index 22c137f..8f572d2 100644 --- a/docs/VideoSessionLocation.md +++ b/docs/AnalyticsAggregatedMetricsResponse.md @@ -1,10 +1,10 @@ -# VideoSessionLocation +# AnalyticsAggregatedMetricsResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**country** | **String** | The country of the viewer. | [optional] -**city** | **String** | The city of the viewer. | [optional] +**context** | [**AnalyticsAggregatedMetricsResponseContext**](AnalyticsAggregatedMetricsResponseContext.md) | | +**data** | **Float** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AnalyticsAggregatedMetricsResponseContext.md b/docs/AnalyticsAggregatedMetricsResponseContext.md new file mode 100644 index 0000000..856505a --- /dev/null +++ b/docs/AnalyticsAggregatedMetricsResponseContext.md @@ -0,0 +1,12 @@ +# AnalyticsAggregatedMetricsResponseContext + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **String** | Returns the metric you selected. | [optional] +**aggregation** | **String** | Returns the aggregation you selected. | [optional] +**timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md b/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md new file mode 100644 index 0000000..0608d85 --- /dev/null +++ b/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md @@ -0,0 +1,11 @@ +# AnalyticsAggregatedMetricsResponseContextTimeframe + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from** | **Date** | Returns the starting date-time of the period you want analytics for in ATOM date-time format. | [optional] +**to** | **Date** | Returns the starting date-time of the period you want analytics for in ATOM date-time format. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalyticsMetricsBreakdownResponse.md b/docs/AnalyticsMetricsBreakdownResponse.md new file mode 100644 index 0000000..05c099d --- /dev/null +++ b/docs/AnalyticsMetricsBreakdownResponse.md @@ -0,0 +1,12 @@ +# AnalyticsMetricsBreakdownResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | [**AnalyticsMetricsBreakdownResponseContext**](AnalyticsMetricsBreakdownResponseContext.md) | | +**data** | [AnalyticsMetricsBreakdownResponseData] | Returns an array of dimensions and their respective metrics. | +**pagination** | [**Pagination**](Pagination.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalyticsMetricsBreakdownResponseContext.md b/docs/AnalyticsMetricsBreakdownResponseContext.md new file mode 100644 index 0000000..80ba98b --- /dev/null +++ b/docs/AnalyticsMetricsBreakdownResponseContext.md @@ -0,0 +1,12 @@ +# AnalyticsMetricsBreakdownResponseContext + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **String** | Returns the metric you selected. | [optional] +**breakdown** | **String** | Returns the dimension you selected. | [optional] +**timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalyticsMetricsBreakdownResponseData.md b/docs/AnalyticsMetricsBreakdownResponseData.md new file mode 100644 index 0000000..286b50b --- /dev/null +++ b/docs/AnalyticsMetricsBreakdownResponseData.md @@ -0,0 +1,11 @@ +# AnalyticsMetricsBreakdownResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dimensionValue** | **String** | Returns a specific value for the dimension you selected, based on the data. For example if you select `continent` as a dimension, then `dimensionValue` returns values like `EU` or \"AZ\". | [optional] +**metricValue** | **Float** | Returns the data for a specific dimension value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalyticsMetricsOverTimeResponse.md b/docs/AnalyticsMetricsOverTimeResponse.md new file mode 100644 index 0000000..7af3ebb --- /dev/null +++ b/docs/AnalyticsMetricsOverTimeResponse.md @@ -0,0 +1,12 @@ +# AnalyticsMetricsOverTimeResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | [**AnalyticsMetricsOverTimeResponseContext**](AnalyticsMetricsOverTimeResponseContext.md) | | +**data** | [AnalyticsMetricsOverTimeResponseData] | Returns an array of metrics and the timestamps . | +**pagination** | [**Pagination**](Pagination.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalyticsMetricsOverTimeResponseContext.md b/docs/AnalyticsMetricsOverTimeResponseContext.md new file mode 100644 index 0000000..74f23c0 --- /dev/null +++ b/docs/AnalyticsMetricsOverTimeResponseContext.md @@ -0,0 +1,12 @@ +# AnalyticsMetricsOverTimeResponseContext + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metric** | **String** | Returns the metric you selected. | [optional] +**interval** | **String** | Returns the interval you selected. | [optional] +**timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AnalyticsMetricsOverTimeResponseData.md b/docs/AnalyticsMetricsOverTimeResponseData.md new file mode 100644 index 0000000..4900de4 --- /dev/null +++ b/docs/AnalyticsMetricsOverTimeResponseData.md @@ -0,0 +1,11 @@ +# AnalyticsMetricsOverTimeResponseData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emittedAt** | **String** | Returns the timestamp of the event that belongs to a specific metric in ATOM date-time format. For example, if you set `play` with an `hour` interval in your request, then `emittedAt` returns the hourly timestamps of every play event within the timeframe you defined. | [optional] +**metricValue** | **Float** | Returns the data for a specific metric value. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LiveStream.md b/docs/LiveStream.md index 24550f0..53601ac 100644 --- a/docs/LiveStream.md +++ b/docs/LiveStream.md @@ -6,11 +6,11 @@ Name | Type | Description | Notes **liveStreamId** | **String** | The unique identifier for the live stream. Live stream IDs begin with \"li.\" | **name** | **String** | The name of your live stream. | [optional] **streamKey** | **String** | The unique, private stream key that you use to begin streaming. | [optional] -**_public** | **Bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery-analytics/video-privacy-access-management). | [optional] +**_public** | **Bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery/video-privacy-access-management). | [optional] **assets** | [**LiveStreamAssets**](LiveStreamAssets.md) | | [optional] **playerId** | **String** | The unique identifier for the player. | [optional] **broadcasting** | **Bool** | Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not. | [optional] -**restreams** | [RestreamsResponseObject] | Returns the list of RTMP restream destinations. | +**restreams** | [RestreamsResponseObject] | Returns the list of restream destinations. | **createdAt** | **Date** | When the player was created, presented in ISO-8601 format. | [optional] **updatedAt** | **Date** | When the player was last updated, presented in ISO-8601 format. | [optional] diff --git a/docs/LiveStreamCreationPayload.md b/docs/LiveStreamCreationPayload.md index 9ca8769..398e2d1 100644 --- a/docs/LiveStreamCreationPayload.md +++ b/docs/LiveStreamCreationPayload.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Add a name for your live stream here. | -**_public** | **Bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery-analytics/video-privacy-access-management). | [optional] +**_public** | **Bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery/video-privacy-access-management). | [optional] **playerId** | **String** | The unique identifier for the player. | [optional] -**restreams** | [RestreamsRequestObject] | Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. | [optional] +**restreams** | [RestreamsRequestObject] | Use this parameter to add, edit, or remove `RTMPS` or `RTMP` services where you want to restream a live stream. The list can only contain up to 5 destinations. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LiveStreamSession.md b/docs/LiveStreamSession.md deleted file mode 100644 index 59a3c3b..0000000 --- a/docs/LiveStreamSession.md +++ /dev/null @@ -1,15 +0,0 @@ -# LiveStreamSession - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**session** | [**LiveStreamSessionSession**](LiveStreamSessionSession.md) | | [optional] -**location** | [**LiveStreamSessionLocation**](LiveStreamSessionLocation.md) | | [optional] -**referrer** | [**LiveStreamSessionReferrer**](LiveStreamSessionReferrer.md) | | [optional] -**device** | [**LiveStreamSessionDevice**](LiveStreamSessionDevice.md) | | [optional] -**os** | [**VideoSessionOs**](VideoSessionOs.md) | | [optional] -**client** | [**LiveStreamSessionClient**](LiveStreamSessionClient.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LiveStreamSessionClient.md b/docs/LiveStreamSessionClient.md deleted file mode 100644 index f8870cc..0000000 --- a/docs/LiveStreamSessionClient.md +++ /dev/null @@ -1,12 +0,0 @@ -# LiveStreamSessionClient - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The name of the browser used to view the live stream session. | [optional] -**version** | **String** | The version of the browser used to view the live stream session. | [optional] -**type** | **String** | The type of client used to view the live stream session. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LiveStreamSessionDevice.md b/docs/LiveStreamSessionDevice.md deleted file mode 100644 index b189a51..0000000 --- a/docs/LiveStreamSessionDevice.md +++ /dev/null @@ -1,12 +0,0 @@ -# LiveStreamSessionDevice - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | What the type is like desktop, laptop, mobile. | [optional] -**vendor** | **String** | If known, what the brand of the device is, like Apple, Dell, etc. | [optional] -**model** | **String** | The specific model of the device, if known. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LiveStreamSessionReferrer.md b/docs/LiveStreamSessionReferrer.md deleted file mode 100644 index 7459118..0000000 --- a/docs/LiveStreamSessionReferrer.md +++ /dev/null @@ -1,13 +0,0 @@ -# LiveStreamSessionReferrer - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **String** | The website the viewer of the live stream was referred to in order to view the live stream. | [optional] -**medium** | **String** | The type of search that brought the viewer to the live stream. Organic would be they found it on their own, paid would be they found it via an advertisement. | [optional] -**source** | **String** | Where the viewer came from to see the live stream (usually where they searched from). | [optional] -**searchTerm** | **String** | What term they searched for that led them to the live stream. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LiveStreamSessionSession.md b/docs/LiveStreamSessionSession.md deleted file mode 100644 index 88e0543..0000000 --- a/docs/LiveStreamSessionSession.md +++ /dev/null @@ -1,12 +0,0 @@ -# LiveStreamSessionSession - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sessionId** | **String** | A unique identifier for your session. You can use this to track what happens during a specific session. | [optional] -**loadedAt** | **Date** | When the session started, with the date and time presented in ISO-8601 format. | [optional] -**endedAt** | **Date** | When the session ended, with the date and time presented in ISO-8601 format. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/LiveStreamUpdatePayload.md b/docs/LiveStreamUpdatePayload.md index bc3fad9..026b63b 100644 --- a/docs/LiveStreamUpdatePayload.md +++ b/docs/LiveStreamUpdatePayload.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | The name you want to use for your live stream. | [optional] -**_public** | **Bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery-analytics/video-privacy-access-management). | [optional] +**_public** | **Bool** | Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature [here](https://docs.api.video/delivery/video-privacy-access-management). | [optional] **playerId** | **String** | The unique ID for the player associated with a live stream that you want to update. | [optional] -**restreams** | [RestreamsRequestObject] | Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed. | [optional] +**restreams** | [RestreamsRequestObject] | Use this parameter to add, edit, or remove `RTMPS` or `RTMP` services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LiveStreamsAPI.md b/docs/LiveStreamsAPI.md index c797201..cb0b3bc 100644 --- a/docs/LiveStreamsAPI.md +++ b/docs/LiveStreamsAPI.md @@ -11,6 +11,7 @@ Method | HTTP request | Description [**list**](LiveStreamsAPI.md#getlivestreams) | **GET** /live-streams | List all live streams [**uploadThumbnail**](LiveStreamsAPI.md#postlivestreamslivestreamidthumbnail) | **POST** /live-streams/{liveStreamId}/thumbnail | Upload a thumbnail [**deleteThumbnail**](LiveStreamsAPI.md#deletelivestreamslivestreamidthumbnail) | **DELETE** /live-streams/{liveStreamId}/thumbnail | Delete a thumbnail +[**complete**](LiveStreamsAPI.md#putlivestreamslivestreamidcomplete) | **PUT** /live-streams/{liveStreamId}/complete | Complete a live stream # **create** @@ -391,3 +392,55 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **complete** +```swift + open class func complete(liveStreamId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) + open class func complete(liveStreamId: String, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) +``` + +Complete a live stream + +Request the completion of a live stream that is currently running. This operation is asynchronous and the live stream will stop after a few seconds. The API adds the `EXT-X-ENDLIST` tag to the live stream's HLS manifest. This stops the live stream on the player and also stops the recording of the live stream. The API keeps the incoming connection from the streamer open for at most 1 minute, which can be used to terminate the stream. + + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import ApiVideoClient + +let liveStreamId = "liveStreamId_example" // String | The unique ID for the live stream you want to complete. + +// Complete a live stream +LiveStreamsAPI.complete(liveStreamId: liveStreamId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **liveStreamId** | **String** | The unique ID for the live stream you want to complete. | + +### Return type + +Void (empty response body) + +### Authorization + +[apiKey](../README.md#apiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/RestreamsRequestObject.md b/docs/RestreamsRequestObject.md index 6afd4d5..00a1868 100644 --- a/docs/RestreamsRequestObject.md +++ b/docs/RestreamsRequestObject.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Use this parameter to define a name for the restream destination. | -**serverUrl** | **String** | Use this parameter to set the RTMP URL of the restream destination. | +**serverUrl** | **String** | Use this parameter to set the `RTMPS` or `RTMP` server URL of the restream destination. | **streamKey** | **String** | Use this parameter to provide the unique key of the live stream that you want to restream. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/RestreamsResponseObject.md b/docs/RestreamsResponseObject.md index d9ee5fa..e610229 100644 --- a/docs/RestreamsResponseObject.md +++ b/docs/RestreamsResponseObject.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **String** | Returns the name of a restream destination. | [optional] -**serverUrl** | **String** | Returns the RTMP URL of a restream destination. | [optional] +**serverUrl** | **String** | Returns the server URL of a restream destination. | [optional] **streamKey** | **String** | Returns the unique key of the live stream that is set up for restreaming. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/LiveStreamSessionLocation.md b/docs/UnrecognizedRequestUrl.md similarity index 53% rename from docs/LiveStreamSessionLocation.md rename to docs/UnrecognizedRequestUrl.md index 757b141..1a5b9bc 100644 --- a/docs/LiveStreamSessionLocation.md +++ b/docs/UnrecognizedRequestUrl.md @@ -1,10 +1,11 @@ -# LiveStreamSessionLocation +# UnrecognizedRequestUrl ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**country** | **String** | The country of the viewer of the live stream. | [optional] -**city** | **String** | The city of the viewer of the live stream. | [optional] +**type** | **String** | A link to the error documentation. | [optional] +**title** | **String** | A description of the error that occurred. | [optional] +**status** | **Int** | The HTTP status code. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/VideoCreationPayload.md b/docs/VideoCreationPayload.md index 40d922b..b993a33 100644 --- a/docs/VideoCreationPayload.md +++ b/docs/VideoCreationPayload.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **title** | **String** | The title of your new video. | **description** | **String** | A brief description of your video. | [optional] **source** | **String** | You can either add a video already on the web, by entering the URL of the video, or you can also enter the `videoId` of one of the videos you already have on your api.video acccount, and this will generate a copy of your video. Creating a copy of a video can be especially useful if you want to keep your original video and trim or apply a watermark onto the copy you would create. | [optional] -**_public** | **Bool** | Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/delivery-analytics/video-privacy-access-management) | [optional] [default to true] +**_public** | **Bool** | Default: True. If set to `false` the video will become private. More information on private videos can be found [here](https://docs.api.video/delivery/video-privacy-access-management) | [optional] [default to true] **panoramic** | **Bool** | Indicates if your video is a 360/immersive video. | [optional] [default to false] **mp4Support** | **Bool** | Enables mp4 version in addition to streamed version. | [optional] [default to true] **playerId** | **String** | The unique identification number for your video player. | [optional] diff --git a/docs/VideoSession.md b/docs/VideoSession.md deleted file mode 100644 index 7964c36..0000000 --- a/docs/VideoSession.md +++ /dev/null @@ -1,15 +0,0 @@ -# VideoSession - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**session** | [**VideoSessionSession**](VideoSessionSession.md) | | [optional] -**location** | [**VideoSessionLocation**](VideoSessionLocation.md) | | [optional] -**referrer** | [**VideoSessionReferrer**](VideoSessionReferrer.md) | | [optional] -**device** | [**VideoSessionDevice**](VideoSessionDevice.md) | | [optional] -**os** | [**VideoSessionOs**](VideoSessionOs.md) | | [optional] -**client** | [**VideoSessionClient**](VideoSessionClient.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/VideoSessionClient.md b/docs/VideoSessionClient.md deleted file mode 100644 index 3fa3a9d..0000000 --- a/docs/VideoSessionClient.md +++ /dev/null @@ -1,12 +0,0 @@ -# VideoSessionClient - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The name of the browser used to view the video session. | [optional] -**version** | **String** | The version of the browser used to view the video session. | [optional] -**type** | **String** | The type of client used to view the video session. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/VideoSessionDevice.md b/docs/VideoSessionDevice.md deleted file mode 100644 index 3004c1f..0000000 --- a/docs/VideoSessionDevice.md +++ /dev/null @@ -1,12 +0,0 @@ -# VideoSessionDevice - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | What the type is like desktop, laptop, mobile. | [optional] -**vendor** | **String** | If known, what the brand of the device is, like Apple, Dell, etc. | [optional] -**model** | **String** | The specific model of the device, if known. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/VideoSessionOs.md b/docs/VideoSessionOs.md deleted file mode 100644 index 585c99b..0000000 --- a/docs/VideoSessionOs.md +++ /dev/null @@ -1,12 +0,0 @@ -# VideoSessionOs - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The name of the operating system. | [optional] -**shortname** | **String** | The nickname for the operating system, often representing the version. | [optional] -**version** | **String** | The version of the operating system. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/VideoSessionReferrer.md b/docs/VideoSessionReferrer.md deleted file mode 100644 index 75cad4a..0000000 --- a/docs/VideoSessionReferrer.md +++ /dev/null @@ -1,13 +0,0 @@ -# VideoSessionReferrer - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **String** | The link the viewer used to reach the video session. | [optional] -**medium** | **String** | How they arrived at the site, for example organic or paid. Organic meaning they found it themselves and paid meaning they followed a link from an advertisement. | [optional] -**source** | **String** | The source the referrer came from to the video session. For example if they searched through google to find the stream. | [optional] -**searchTerm** | **String** | The search term they typed to arrive at the video session. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/VideoSessionSession.md b/docs/VideoSessionSession.md deleted file mode 100644 index 68f1da3..0000000 --- a/docs/VideoSessionSession.md +++ /dev/null @@ -1,13 +0,0 @@ -# VideoSessionSession - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sessionId** | **String** | The unique identifier for the session that you can use to track what happens during it. | [optional] -**loadedAt** | **Date** | When the video session started, presented in ISO-8601 format. | [optional] -**endedAt** | **Date** | When the video session ended, presented in ISO-8601 format. | [optional] -**metadata** | [Metadata] | A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. You can also just use the pairs as another way to tag and categorize your videos. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -