Skip to content

Commit

Permalink
[DO NOT MERGE] Add Watch Data endpoints to OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo authored Jun 4, 2024
1 parent 301b28c commit b0780e7
Show file tree
Hide file tree
Showing 38 changed files with 474 additions and 1,010 deletions.
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ All URIs are relative to *https://ws.api.video*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_live_streams_plays**](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsApi.md#get_live_streams_plays) | **GET** /analytics/live-streams/plays | Get play events for live stream
[**get_videos_plays**](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsApi.md#get_videos_plays) | **GET** /analytics/videos/plays | Get play events for video
**(deprecated)** [**get_live_streams_plays**](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsApi.md#get_live_streams_plays) | **GET** /analytics/live-streams/plays | Get play events for live stream
**(deprecated)** [**get_videos_plays**](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsApi.md#get_videos_plays) | **GET** /analytics/videos/plays | Get play events for video


### CaptionsApi
Expand Down Expand Up @@ -229,7 +229,16 @@ Method | HTTP request | Description

- [AccessToken](https://github.com/apivideo/api.video-python-client/blob/main/docs/AccessToken.md)
- [AdditionalBadRequestErrors](https://github.com/apivideo/api.video-python-client/blob/main/docs/AdditionalBadRequestErrors.md)
- [AnalyticsAggregatedMetricsResponse](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsAggregatedMetricsResponse.md)
- [AnalyticsAggregatedMetricsResponseContext](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsAggregatedMetricsResponseContext.md)
- [AnalyticsAggregatedMetricsResponseContextTimeframe](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsAggregatedMetricsResponseContextTimeframe.md)
- [AnalyticsData](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsData.md)
- [AnalyticsMetricsBreakdownResponse](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsMetricsBreakdownResponse.md)
- [AnalyticsMetricsBreakdownResponseContext](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsMetricsBreakdownResponseContext.md)
- [AnalyticsMetricsBreakdownResponseData](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsMetricsBreakdownResponseData.md)
- [AnalyticsMetricsOverTimeResponse](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsMetricsOverTimeResponse.md)
- [AnalyticsMetricsOverTimeResponseContext](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsMetricsOverTimeResponseContext.md)
- [AnalyticsMetricsOverTimeResponseData](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsMetricsOverTimeResponseData.md)
- [AnalyticsPlays400Error](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsPlays400Error.md)
- [AnalyticsPlaysResponse](https://github.com/apivideo/api.video-python-client/blob/main/docs/AnalyticsPlaysResponse.md)
- [AuthenticatePayload](https://github.com/apivideo/api.video-python-client/blob/main/docs/AuthenticatePayload.md)
Expand All @@ -245,12 +254,6 @@ Method | HTTP request | Description
- [LiveStreamAssets](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamAssets.md)
- [LiveStreamCreationPayload](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamCreationPayload.md)
- [LiveStreamListResponse](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamListResponse.md)
- [LiveStreamSession](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamSession.md)
- [LiveStreamSessionClient](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamSessionClient.md)
- [LiveStreamSessionDevice](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamSessionDevice.md)
- [LiveStreamSessionLocation](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamSessionLocation.md)
- [LiveStreamSessionReferrer](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamSessionReferrer.md)
- [LiveStreamSessionSession](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamSessionSession.md)
- [LiveStreamUpdatePayload](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamUpdatePayload.md)
- [Metadata](https://github.com/apivideo/api.video-python-client/blob/main/docs/Metadata.md)
- [Model403ErrorSchema](https://github.com/apivideo/api.video-python-client/blob/main/docs/Model403ErrorSchema.md)
Expand All @@ -270,18 +273,12 @@ Method | HTTP request | Description
- [TokenCreationPayload](https://github.com/apivideo/api.video-python-client/blob/main/docs/TokenCreationPayload.md)
- [TokenListResponse](https://github.com/apivideo/api.video-python-client/blob/main/docs/TokenListResponse.md)
- [TooManyRequests](https://github.com/apivideo/api.video-python-client/blob/main/docs/TooManyRequests.md)
- [UnrecognizedRequestUrl](https://github.com/apivideo/api.video-python-client/blob/main/docs/UnrecognizedRequestUrl.md)
- [UploadToken](https://github.com/apivideo/api.video-python-client/blob/main/docs/UploadToken.md)
- [Video](https://github.com/apivideo/api.video-python-client/blob/main/docs/Video.md)
- [VideoAssets](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoAssets.md)
- [VideoClip](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoClip.md)
- [VideoCreationPayload](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoCreationPayload.md)
- [VideoSession](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSession.md)
- [VideoSessionClient](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSessionClient.md)
- [VideoSessionDevice](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSessionDevice.md)
- [VideoSessionLocation](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSessionLocation.md)
- [VideoSessionOs](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSessionOs.md)
- [VideoSessionReferrer](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSessionReferrer.md)
- [VideoSessionSession](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSessionSession.md)
- [VideoSource](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSource.md)
- [VideoSourceLiveStream](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSourceLiveStream.md)
- [VideoSourceLiveStreamLink](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideoSourceLiveStreamLink.md)
Expand Down
4 changes: 2 additions & 2 deletions apivideo/api/analytics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_live_streams_plays(
):
"""Get play events for live stream # noqa: E501
Retrieve filtered analytics about the number of plays for your live streams in a project. # noqa: E501
Retrieve filtered analytics about the number of plays for your live streams in a project. This endpoint will be deprecated with the release of Analytics v2.0. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
Expand Down Expand Up @@ -214,7 +214,7 @@ def get_videos_plays(
):
"""Get play events for video # noqa: E501
Retrieve filtered analytics about the number of plays for your videos in a project. # noqa: E501
Retrieve filtered analytics about the number of plays for your videos in a project. This endpoint will be deprecated with the release of Analytics v2.0. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@
validate_get_composed_info,
)

def lazy_import():
from apivideo.model.analytics_aggregated_metrics_response_context import AnalyticsAggregatedMetricsResponseContext
from apivideo.model.pagination import Pagination
globals()['AnalyticsAggregatedMetricsResponseContext'] = AnalyticsAggregatedMetricsResponseContext
globals()['Pagination'] = Pagination

class LiveStreamSessionSession(ModelNormal):

class AnalyticsAggregatedMetricsResponse(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down Expand Up @@ -70,10 +76,11 @@ def openapi_types():
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy_import()
return {
'session_id': (str,), # noqa: E501
'loaded_at': (datetime,), # noqa: E501
'ended_at': (datetime,), # noqa: E501
'context': (AnalyticsAggregatedMetricsResponseContext,), # noqa: E501
'data': ([float],), # noqa: E501
'pagination': (Pagination,), # noqa: E501
}

@cached_property
Expand All @@ -82,9 +89,9 @@ def discriminator():


attribute_map = {
'session_id': 'sessionId', # noqa: E501
'loaded_at': 'loadedAt', # noqa: E501
'ended_at': 'endedAt', # noqa: E501
'context': 'context', # noqa: E501
'data': 'data', # noqa: E501
'pagination': 'pagination', # noqa: E501
}

_composed_schemas = {}
Expand All @@ -99,8 +106,13 @@ def discriminator():
])

@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""LiveStreamSessionSession - a model defined in OpenAPI
def __init__(self, context, data, pagination, *args, **kwargs): # noqa: E501
"""AnalyticsAggregatedMetricsResponse - a model defined in OpenAPI
Args:
context (AnalyticsAggregatedMetricsResponseContext):
data ([float]):
pagination (Pagination):
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
Expand Down Expand Up @@ -133,9 +145,6 @@ def __init__(self, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
session_id (str): A unique identifier for your session. You can use this to track what happens during a specific session.. [optional] # noqa: E501
loaded_at (datetime): When the session started, with the date and time presented in ISO-8601 format.. [optional] # noqa: E501
ended_at (datetime): When the session ended, with the date and time presented in ISO-8601 format.. [optional] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand All @@ -161,6 +170,9 @@ def __init__(self, *args, **kwargs): # noqa: E501
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

self.context = context
self.data = data
self.pagination = pagination
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
validate_get_composed_info,
)

def lazy_import():
from apivideo.model.analytics_aggregated_metrics_response_context_timeframe import AnalyticsAggregatedMetricsResponseContextTimeframe
globals()['AnalyticsAggregatedMetricsResponseContextTimeframe'] = AnalyticsAggregatedMetricsResponseContextTimeframe

class VideoSessionReferrer(ModelNormal):

class AnalyticsAggregatedMetricsResponseContext(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand All @@ -51,6 +55,21 @@ class VideoSessionReferrer(ModelNormal):
"""

allowed_values = {
('metric',): {
'PLAY': "play",
'START': "start",
'END': "end",
'IMPRESSION': "impression",
'IMPRESSION-TIME': "impression-time",
'WATCH-TIME': "watch-time",
},
('aggregation',): {
'COUNT': "count",
'RATE': "rate",
'TOTAL': "total",
'AVERAGE': "average",
'SUM': "sum",
},
}

validations = {
Expand All @@ -70,11 +89,11 @@ def openapi_types():
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy_import()
return {
'url': (str, none_type,), # noqa: E501
'medium': (str,), # noqa: E501
'source': (str,), # noqa: E501
'search_term': (str,), # noqa: E501
'metric': (str,), # noqa: E501
'aggregation': (str,), # noqa: E501
'timeframe': (AnalyticsAggregatedMetricsResponseContextTimeframe,), # noqa: E501
}

@cached_property
Expand All @@ -83,10 +102,9 @@ def discriminator():


attribute_map = {
'url': 'url', # noqa: E501
'medium': 'medium', # noqa: E501
'source': 'source', # noqa: E501
'search_term': 'searchTerm', # noqa: E501
'metric': 'metric', # noqa: E501
'aggregation': 'aggregation', # noqa: E501
'timeframe': 'timeframe', # noqa: E501
}

_composed_schemas = {}
Expand All @@ -102,7 +120,7 @@ def discriminator():

@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""VideoSessionReferrer - a model defined in OpenAPI
"""AnalyticsAggregatedMetricsResponseContext - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
Expand Down Expand Up @@ -135,10 +153,9 @@ def __init__(self, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
url (str, none_type): The link the viewer used to reach the video session.. [optional] # noqa: E501
medium (str): 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] # noqa: E501
source (str): The source the referrer came from to the video session. For example if they searched through google to find the stream.. [optional] # noqa: E501
search_term (str): The search term they typed to arrive at the video session.. [optional] # noqa: E501
metric (str): Returns the metric you selected.. [optional] # noqa: E501
aggregation (str): Returns the aggregation you selected.. [optional] # noqa: E501
timeframe (AnalyticsAggregatedMetricsResponseContextTimeframe): [optional] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)


class VideoSessionLocation(ModelNormal):
class AnalyticsAggregatedMetricsResponseContextTimeframe(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Expand Down Expand Up @@ -71,8 +71,8 @@ def openapi_types():
and the value is attribute type.
"""
return {
'country': (str,), # noqa: E501
'city': (str, none_type,), # noqa: E501
'_from': (datetime,), # noqa: E501
'to': (datetime,), # noqa: E501
}

@cached_property
Expand All @@ -81,8 +81,8 @@ def discriminator():


attribute_map = {
'country': 'country', # noqa: E501
'city': 'city', # noqa: E501
'_from': 'from', # noqa: E501
'to': 'to', # noqa: E501
}

_composed_schemas = {}
Expand All @@ -98,7 +98,7 @@ def discriminator():

@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""VideoSessionLocation - a model defined in OpenAPI
"""AnalyticsAggregatedMetricsResponseContextTimeframe - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
Expand Down Expand Up @@ -131,8 +131,8 @@ def __init__(self, *args, **kwargs): # noqa: E501
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
country (str): The country of the viewer.. [optional] # noqa: E501
city (str, none_type): The city of the viewer.. [optional] # noqa: E501
_from (datetime): Returns the starting date-time of the period you want analytics for in ATOM date-time format.. [optional] # noqa: E501
to (datetime): Returns the starting date-time of the period you want analytics for in ATOM date-time format.. [optional] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down
Loading

0 comments on commit b0780e7

Please sign in to comment.