From e8bf6bb686f74a13ad67c88260c56b70fb661d69 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Mon, 16 Sep 2024 14:20:05 +0000 Subject: [PATCH] Add discarded videos feature --- CHANGELOG.md | 3 + README.md | 4 + apivideo/__init__.py | 2 +- apivideo/api/live_streams_api.py | 2 +- apivideo/api/player_themes_api.py | 2 +- apivideo/api/upload_tokens_api.py | 2 +- apivideo/api/videos_api.py | 458 +++++++++++++++++- apivideo/api_client.py | 2 +- apivideo/configuration.py | 2 +- .../model/discarded_video_update_payload.py | 165 +++++++ apivideo/model/live_stream.py | 4 +- apivideo/model/player_session_event.py | 2 +- apivideo/model/player_theme.py | 4 +- apivideo/model/upload_token.py | 4 +- apivideo/model/video.py | 17 +- apivideo/model/video_creation_payload.py | 2 +- apivideo/model/video_update_payload.py | 2 +- apivideo/model/watermark.py | 2 +- apivideo/model/webhook.py | 2 +- docs/DiscardedVideoUpdatePayload.md | 10 + docs/LiveStream.md | 4 +- docs/LiveStreamsApi.md | 4 +- docs/PlayerSessionEvent.md | 2 +- docs/PlayerTheme.md | 4 +- docs/PlayerThemesApi.md | 4 +- docs/UploadToken.md | 4 +- docs/UploadTokensApi.md | 4 +- docs/Video.md | 11 +- docs/VideoCreationPayload.md | 2 +- docs/VideoUpdatePayload.md | 2 +- docs/VideosApi.md | 214 +++++++- docs/Watermark.md | 2 +- docs/Webhook.md | 2 +- setup.py | 2 +- .../get_metrics_over_time/responses/200.json | 6 +- .../live_streams/create/responses/200.json | 4 +- .../live_streams/get/responses/200.json | 4 +- .../live_streams/list/responses/200.json | 8 +- .../live_streams/update/responses/200.json | 4 +- .../create_token/responses/200.json | 4 +- .../get_token/responses/200.json | 2 +- .../upload_tokens/list/responses/200.json | 6 +- .../payloads/videos/create/responses/201.json | 3 +- .../payloads/videos/create/responses/400.json | 2 +- test/payloads/videos/get/responses/200.json | 5 +- .../videos/get_discarded/responses/200.json | 25 + .../videos/get_discarded/responses/404.json | 6 + .../videos/get_discarded/responses/429.json | 5 + test/payloads/videos/list/responses/200.json | 15 +- .../videos/list_discarded/responses/200.json | 91 ++++ .../videos/list_discarded/responses/400.json | 22 + .../videos/list_discarded/responses/429.json | 5 + .../videos/pick_thumbnail/responses/200.json | 3 +- .../payloads/videos/update/responses/200.json | 5 +- .../update_discarded/responses/200.json | 25 + .../update_discarded/responses/400.json | 7 + .../update_discarded/responses/404.json | 6 + .../update_discarded/responses/429.json | 5 + .../payloads/videos/upload/responses/201.json | 3 +- .../upload_thumbnail/responses/200.json | 5 +- .../responses/201.json | 3 +- .../watermarks/list/responses/200.json | 4 +- .../watermarks/upload/responses/200.json | 2 +- .../webhooks/create/responses/201.json | 2 +- test/payloads/webhooks/get/responses/200.json | 2 +- .../payloads/webhooks/list/responses/200.json | 4 +- test/test_videos_api.py | 78 +++ 67 files changed, 1232 insertions(+), 91 deletions(-) create mode 100644 apivideo/model/discarded_video_update_payload.py create mode 100644 docs/DiscardedVideoUpdatePayload.md create mode 100644 test/payloads/videos/get_discarded/responses/200.json create mode 100644 test/payloads/videos/get_discarded/responses/404.json create mode 100644 test/payloads/videos/get_discarded/responses/429.json create mode 100644 test/payloads/videos/list_discarded/responses/200.json create mode 100644 test/payloads/videos/list_discarded/responses/400.json create mode 100644 test/payloads/videos/list_discarded/responses/429.json create mode 100644 test/payloads/videos/update_discarded/responses/200.json create mode 100644 test/payloads/videos/update_discarded/responses/400.json create mode 100644 test/payloads/videos/update_discarded/responses/404.json create mode 100644 test/payloads/videos/update_discarded/responses/429.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 860a0d7..4b40a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.4.2] - 2024-09-16 +- Add discarded video endpoints + ## [1.4.1] - 2024-09-05 - Add sort parameters in analytics endpoints diff --git a/README.md b/README.md index 4de5279..16becda 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,10 @@ Method | HTTP request | Description [**list**](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#list) | **GET** `/videos` | List all video objects [**upload_thumbnail**](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#upload_thumbnail) | **POST** `/videos/{videoId}/thumbnail` | Upload a thumbnail [**pick_thumbnail**](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#pick_thumbnail) | **PATCH** `/videos/{videoId}/thumbnail` | Set a thumbnail +[**get_discarded**](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#get_discarded) | **GET** `/discarded/videos/{videoId}` | Retrieve a discarded video object [**get_status**](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#get_status) | **GET** `/videos/{videoId}/status` | Retrieve video status and details +[**list_discarded**](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#list_discarded) | **GET** `/discarded/videos` | List all discarded video objects +[**update_discarded**](https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#update_discarded) | **PATCH** `/discarded/videos/{videoId}` | Update a discarded video object ### WatermarksApi @@ -251,6 +254,7 @@ Method | HTTP request | Description - [CaptionsUpdatePayload](https://github.com/apivideo/api.video-python-client/blob/main/docs/CaptionsUpdatePayload.md) - [Chapter](https://github.com/apivideo/api.video-python-client/blob/main/docs/Chapter.md) - [ChaptersListResponse](https://github.com/apivideo/api.video-python-client/blob/main/docs/ChaptersListResponse.md) + - [DiscardedVideoUpdatePayload](https://github.com/apivideo/api.video-python-client/blob/main/docs/DiscardedVideoUpdatePayload.md) - [FilterBy](https://github.com/apivideo/api.video-python-client/blob/main/docs/FilterBy.md) - [FilterBy1](https://github.com/apivideo/api.video-python-client/blob/main/docs/FilterBy1.md) - [FilterBy2](https://github.com/apivideo/api.video-python-client/blob/main/docs/FilterBy2.md) diff --git a/apivideo/__init__.py b/apivideo/__init__.py index 846f598..a66ffdc 100644 --- a/apivideo/__init__.py +++ b/apivideo/__init__.py @@ -9,7 +9,7 @@ """ -__version__ = "1.4.1" +__version__ = "1.4.2" # import ApiVideoClient from apivideo.auth_api_client import AuthenticatedApiClient diff --git a/apivideo/api/live_streams_api.py b/apivideo/api/live_streams_api.py index f6b8d41..97c632e 100644 --- a/apivideo/api/live_streams_api.py +++ b/apivideo/api/live_streams_api.py @@ -573,7 +573,7 @@ def list( Keyword Args: stream_key (str): The unique stream key that allows you to stream videos.. [optional] name (str): You can filter live streams by their name or a part of their name.. [optional] - sort_by (str): Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. . [optional] + sort_by (str): Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. . [optional] sort_order (str): Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending.. [optional] current_page (int): Choose the number of search results to return per page. Minimum value: 1. [optional] if omitted the server will use the default value of 1 page_size (int): Results per page. Allowed values 1-100, default is 25.. [optional] if omitted the server will use the default value of 25 diff --git a/apivideo/api/player_themes_api.py b/apivideo/api/player_themes_api.py index 31e9f4f..4c1e4c8 100644 --- a/apivideo/api/player_themes_api.py +++ b/apivideo/api/player_themes_api.py @@ -571,7 +571,7 @@ def list( Keyword Args: - sort_by (str): createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format.. [optional] + sort_by (str): createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format.. [optional] sort_order (str): Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones.. [optional] current_page (int): Choose the number of search results to return per page. Minimum value: 1. [optional] if omitted the server will use the default value of 1 page_size (int): Results per page. Allowed values 1-100, default is 25.. [optional] if omitted the server will use the default value of 25 diff --git a/apivideo/api/upload_tokens_api.py b/apivideo/api/upload_tokens_api.py index e4062ef..78f8b55 100644 --- a/apivideo/api/upload_tokens_api.py +++ b/apivideo/api/upload_tokens_api.py @@ -433,7 +433,7 @@ def list( Keyword Args: - sort_by (str): Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format.. [optional] + sort_by (str): Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format.. [optional] sort_order (str): Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A.. [optional] current_page (int): Choose the number of search results to return per page. Minimum value: 1. [optional] if omitted the server will use the default value of 1 page_size (int): Results per page. Allowed values 1-100, default is 25.. [optional] if omitted the server will use the default value of 25 diff --git a/apivideo/api/videos_api.py b/apivideo/api/videos_api.py index 4acacb4..282e7fe 100644 --- a/apivideo/api/videos_api.py +++ b/apivideo/api/videos_api.py @@ -26,6 +26,7 @@ ) from apivideo.exceptions import ApiTypeError, ApiValueError from apivideo.model.bad_request import BadRequest +from apivideo.model.discarded_video_update_payload import DiscardedVideoUpdatePayload from apivideo.model.not_found import NotFound from apivideo.model.too_many_requests import TooManyRequests from apivideo.model.video import Video @@ -1050,7 +1051,7 @@ def delete( ): """Delete a video object # noqa: E501 - If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. # noqa: E501 + If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. By default, deleted videos cannot be recovered. If you have the Video Restore feature enabled, this operation will discard the video instead of permanently deleting it. Make sure you subscribe to the Video Restore feature if you want to be able to restore deleted videos! The Video Restore feature retains videos for 90 days, after which the videos are permanently deleted # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -1188,7 +1189,7 @@ def list( Keyword Args: title (str): The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles.. [optional] tags ([str]): A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned.. [optional] - metadata ({str: (str,)}): Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair.. [optional] + metadata ({str: (str,)}): Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter.. [optional] description (str): Retrieve video objects by `description`.. [optional] live_stream_id (str): Retrieve video objects that were recorded from a live stream by `liveStreamId`.. [optional] sort_by (str): Use this parameter to sort videos by the their created time, published time, updated time, or by title.. [optional] @@ -1654,6 +1655,134 @@ def pick_thumbnail( _request_timeout=kwargs['_request_timeout'], collection_formats=params['collection_format']) + def get_discarded( + self, + video_id, + **kwargs + ): + """Retrieve a discarded video object # noqa: E501 + + This call provides the same information provided on video creation. For private videos, it will generate a unique token url. Use this to retrieve any details you need about a video, or set up a private viewing URL. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_discarded(video_id, async_req=True) + >>> result = thread.get() + + Args: + video_id (str): The unique identifier for the video you want details about. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + async_req (bool): execute request asynchronously + + Returns: + Video + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['video_id'] = \ + video_id + + params_map = { + 'all': [ + 'video_id', + 'async_req', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ], + 'required': [ + 'video_id', + ], + 'nullable': [ + '_request_timeout' + ], + 'enum': [ + ], + 'validation': [ + ] + } + validations = { + } + allowed_values = { + } + openapi_types = { + 'video_id': + (str,), + 'async_req': (bool,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,) + } + attribute_map = { + 'video_id': 'videoId', + } + location_map = { + 'video_id': 'path', + } + collection_format_map = { + } + + for key, value in kwargs.items(): + if key not in params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `get_discarded`" % + (key, ) + ) + if (key not in params_map['nullable'] and value is None): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `get_discarded`" % + (key, ) + ) + + for key in params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`get_discarded`" % (key, ) + ) + + self._validate_inputs(kwargs, params_map, allowed_values, validations, openapi_types) + params = self._gather_params(kwargs, location_map, attribute_map, openapi_types, collection_format_map) + return self.api_client.call_api( + "/discarded/videos/{videoId}", + "GET", + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=(Video,), + async_req=kwargs['async_req'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + collection_formats=params['collection_format']) + def get_status( self, video_id, @@ -1782,3 +1911,328 @@ def get_status( _request_timeout=kwargs['_request_timeout'], collection_formats=params['collection_format']) + def list_discarded( + self, + **kwargs + ): + """List all discarded video objects # noqa: E501 + + This method returns a list of your discarded videos (with all their details). With no parameters added, the API returns the first page of all discarded videos. You can filter discarded videos using the parameters described below. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_discarded(async_req=True) + >>> result = thread.get() + + + Keyword Args: + title (str): The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles.. [optional] + tags ([str]): A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned.. [optional] + metadata ({str: (str,)}): Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter.. [optional] + description (str): Retrieve video objects by `description`.. [optional] + live_stream_id (str): Retrieve video objects that were recorded from a live stream by `liveStreamId`.. [optional] + sort_by (str): Use this parameter to sort videos by the their created time, published time, updated time, or by title.. [optional] + sort_order (str): Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A.. [optional] + current_page (int): Choose the number of search results to return per page. Minimum value: 1. [optional] if omitted the server will use the default value of 1 + page_size (int): Results per page. Allowed values 1-100, default is 25.. [optional] if omitted the server will use the default value of 25 + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + async_req (bool): execute request asynchronously + + Returns: + VideosListResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + + params_map = { + 'all': [ + 'title', + 'tags', + 'metadata', + 'description', + 'live_stream_id', + 'sort_by', + 'sort_order', + 'current_page', + 'page_size', + 'async_req', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ], + 'required': [], + 'nullable': [ + '_request_timeout' + ], + 'enum': [ + 'sort_by', + 'sort_order', + ], + 'validation': [ + ] + } + validations = { + } + allowed_values = { + ('sort_by',): { + + "TITLE": "title", + "CREATEDAT": "createdAt", + "PUBLISHEDAT": "publishedAt", + "UPDATEDAT": "updatedAt" + }, + ('sort_order',): { + + "ASC": "asc", + "DESC": "desc" + }, + } + openapi_types = { + 'title': + (str,), + 'tags': + ([str],), + 'metadata': + ({str: (str,)},), + 'description': + (str,), + 'live_stream_id': + (str,), + 'sort_by': + (str,), + 'sort_order': + (str,), + 'current_page': + (int,), + 'page_size': + (int,), + 'async_req': (bool,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,) + } + attribute_map = { + 'title': 'title', + 'tags': 'tags[]', + 'metadata': 'metadata', + 'description': 'description', + 'live_stream_id': 'liveStreamId', + 'sort_by': 'sortBy', + 'sort_order': 'sortOrder', + 'current_page': 'currentPage', + 'page_size': 'pageSize', + } + location_map = { + 'title': 'query', + 'tags': 'query', + 'metadata': 'query', + 'description': 'query', + 'live_stream_id': 'query', + 'sort_by': 'query', + 'sort_order': 'query', + 'current_page': 'query', + 'page_size': 'query', + } + collection_format_map = { + 'tags': 'multi', + 'metadata': 'deepObject', + } + + for key, value in kwargs.items(): + if key not in params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `list_discarded`" % + (key, ) + ) + if (key not in params_map['nullable'] and value is None): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `list_discarded`" % + (key, ) + ) + + for key in params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`list_discarded`" % (key, ) + ) + + self._validate_inputs(kwargs, params_map, allowed_values, validations, openapi_types) + params = self._gather_params(kwargs, location_map, attribute_map, openapi_types, collection_format_map) + return self.api_client.call_api( + "/discarded/videos", + "GET", + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=(VideosListResponse,), + async_req=kwargs['async_req'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + collection_formats=params['collection_format']) + + def update_discarded( + self, + video_id, + discarded_video_update_payload, + **kwargs + ): + """Update a discarded video object # noqa: E501 + + Use this endpoint to restore a discarded video when you have the Video Restore feature enabled. + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_discarded(video_id, discarded_video_update_payload, async_req=True) + >>> result = thread.get() + + Args: + video_id (str): The video ID for the video you want to restore. + discarded_video_update_payload (DiscardedVideoUpdatePayload): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + async_req (bool): execute request asynchronously + + Returns: + Video + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['video_id'] = \ + video_id + kwargs['discarded_video_update_payload'] = \ + discarded_video_update_payload + + params_map = { + 'all': [ + 'video_id', + 'discarded_video_update_payload', + 'async_req', + '_preload_content', + '_request_timeout', + '_return_http_data_only' + ], + 'required': [ + 'video_id', + 'discarded_video_update_payload', + ], + 'nullable': [ + '_request_timeout' + ], + 'enum': [ + ], + 'validation': [ + ] + } + validations = { + } + allowed_values = { + } + openapi_types = { + 'video_id': + (str,), + 'discarded_video_update_payload': + (DiscardedVideoUpdatePayload,), + 'async_req': (bool,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,) + } + attribute_map = { + 'video_id': 'videoId', + } + location_map = { + 'video_id': 'path', + 'discarded_video_update_payload': 'body', + } + collection_format_map = { + } + + for key, value in kwargs.items(): + if key not in params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `update_discarded`" % + (key, ) + ) + if (key not in params_map['nullable'] and value is None): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `update_discarded`" % + (key, ) + ) + + for key in params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`update_discarded`" % (key, ) + ) + + self._validate_inputs(kwargs, params_map, allowed_values, validations, openapi_types) + params = self._gather_params(kwargs, location_map, attribute_map, openapi_types, collection_format_map) + return self.api_client.call_api( + "/discarded/videos/{videoId}", + "PATCH", + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=(Video,), + async_req=kwargs['async_req'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + collection_formats=params['collection_format']) + diff --git a/apivideo/api_client.py b/apivideo/api_client.py index b692c56..1f066ec 100644 --- a/apivideo/api_client.py +++ b/apivideo/api_client.py @@ -75,7 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie - self.default_headers['AV-Origin-Client'] = "python:1.4.1" + self.default_headers['AV-Origin-Client'] = "python:1.4.2" def __enter__(self): return self diff --git a/apivideo/configuration.py b/apivideo/configuration.py index 61f5bb0..1ff3bfd 100644 --- a/apivideo/configuration.py +++ b/apivideo/configuration.py @@ -391,7 +391,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1\n"\ - "SDK Package Version: 1.4.1".\ + "SDK Package Version: 1.4.2".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/apivideo/model/discarded_video_update_payload.py b/apivideo/model/discarded_video_update_payload.py new file mode 100644 index 0000000..ebc6a2b --- /dev/null +++ b/apivideo/model/discarded_video_update_payload.py @@ -0,0 +1,165 @@ +""" + api.video + + api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes. # noqa: E501 + + Contact: ecosystem@api.video +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from apivideo.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class DiscardedVideoUpdatePayload(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'discarded': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'discarded': 'discarded', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DiscardedVideoUpdatePayload - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + discarded (bool): Use this parameter to restore a discarded video when you have the Video Restore feature enabled. This parameter only accepts `false` as a value!. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/apivideo/model/live_stream.py b/apivideo/model/live_stream.py index 73c34f1..1db5480 100644 --- a/apivideo/model/live_stream.py +++ b/apivideo/model/live_stream.py @@ -164,8 +164,8 @@ def __init__(self, live_stream_id, restreams, *args, **kwargs): # noqa: E501 assets (LiveStreamAssets): [optional] # noqa: E501 player_id (str): The unique identifier for the player.. [optional] # noqa: E501 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] # noqa: E501 - created_at (datetime): When the player was created, presented in ISO-8601 format.. [optional] # noqa: E501 - updated_at (datetime): When the player was last updated, presented in ISO-8601 format.. [optional] # noqa: E501 + created_at (datetime): When the player was created, presented in ATOM UTC format.. [optional] # noqa: E501 + updated_at (datetime): When the player was last updated, presented in ATOM UTC format.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/apivideo/model/player_session_event.py b/apivideo/model/player_session_event.py index 04d76e9..956d659 100644 --- a/apivideo/model/player_session_event.py +++ b/apivideo/model/player_session_event.py @@ -138,7 +138,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) type (str): Possible values are: ready, play, pause, resume, seek.backward, seek.forward, end. [optional] # noqa: E501 - emitted_at (datetime): When an event occurred, presented in ISO-8601 format.. [optional] # noqa: E501 + emitted_at (datetime): When an event occurred, presented in ATOM UTC format.. [optional] # noqa: E501 at (int): [optional] # noqa: E501 _from (int): [optional] # noqa: E501 to (int): [optional] # noqa: E501 diff --git a/apivideo/model/player_theme.py b/apivideo/model/player_theme.py index 09c6f8c..09a52a6 100644 --- a/apivideo/model/player_theme.py +++ b/apivideo/model/player_theme.py @@ -191,8 +191,8 @@ def __init__(self, player_id, *args, **kwargs): # noqa: E501 force_autoplay (bool): enable/disable player autoplay. Default: false. [optional] # noqa: E501 hide_title (bool): enable/disable title. Default: false. [optional] # noqa: E501 force_loop (bool): enable/disable looping. Default: false. [optional] # noqa: E501 - created_at (datetime): When the player was created, presented in ISO-8601 format.. [optional] # noqa: E501 - updated_at (datetime): When the player was last updated, presented in ISO-8601 format.. [optional] # noqa: E501 + created_at (datetime): When the player was created, presented in ATOM UTC format.. [optional] # noqa: E501 + updated_at (datetime): When the player was last updated, presented in ATOM UTC format.. [optional] # noqa: E501 assets (PlayerThemeAssets): [optional] # noqa: E501 """ diff --git a/apivideo/model/upload_token.py b/apivideo/model/upload_token.py index 6c3f451..1ce6ee4 100644 --- a/apivideo/model/upload_token.py +++ b/apivideo/model/upload_token.py @@ -141,8 +141,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) token (str): The unique identifier for the token you will use to authenticate an upload.. [optional] # noqa: E501 ttl (int): Time-to-live - how long the upload token is valid for.. [optional] # noqa: E501 - created_at (datetime): When the token was created, displayed in ISO-8601 format.. [optional] # noqa: E501 - expires_at (datetime, none_type): When the token expires, displayed in ISO-8601 format.. [optional] # noqa: E501 + created_at (datetime): When the token was created, displayed in ATOM UTC format.. [optional] # noqa: E501 + expires_at (datetime, none_type): When the token expires, displayed in ATOM UTC format.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/apivideo/model/video.py b/apivideo/model/video.py index 9fc0673..d972a5b 100644 --- a/apivideo/model/video.py +++ b/apivideo/model/video.py @@ -86,6 +86,9 @@ def openapi_types(): 'description': (str,), # noqa: E501 'published_at': (datetime,), # noqa: E501 'updated_at': (datetime,), # noqa: E501 + 'discarded_at': (datetime, none_type,), # noqa: E501 + 'deletes_at': (datetime, none_type,), # noqa: E501 + 'discarded': (bool,), # noqa: E501 'tags': ([str],), # noqa: E501 'metadata': ([Metadata],), # noqa: E501 'source': (VideoSource,), # noqa: E501 @@ -108,6 +111,9 @@ def discriminator(): 'description': 'description', # noqa: E501 'published_at': 'publishedAt', # noqa: E501 'updated_at': 'updatedAt', # noqa: E501 + 'discarded_at': 'discardedAt', # noqa: E501 + 'deletes_at': 'deletesAt', # noqa: E501 + 'discarded': 'discarded', # noqa: E501 'tags': 'tags', # noqa: E501 'metadata': 'metadata', # noqa: E501 'source': 'source', # noqa: E501 @@ -167,13 +173,16 @@ def __init__(self, video_id, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - created_at (datetime): When a video was created, presented in ISO-8601 format.. [optional] # noqa: E501 + created_at (datetime): When a video was created, presented in ATOM UTC format.. [optional] # noqa: E501 title (str): The title of the video content. . [optional] # noqa: E501 description (str): A description for the video content. . [optional] # noqa: E501 - published_at (datetime): The date and time the API created the video. Date and time are provided using ISO-8601 UTC format.. [optional] # noqa: E501 - updated_at (datetime): The date and time the video was updated. Date and time are provided using ISO-8601 UTC format.. [optional] # noqa: E501 + published_at (datetime): The date and time the API created the video. Date and time are provided using ATOM UTC format.. [optional] # noqa: E501 + updated_at (datetime): The date and time the video was updated. Date and time are provided using ATOM UTC format.. [optional] # noqa: E501 + discarded_at (datetime, none_type): The date and time the video was discarded. The API populates this field only if you have the Video Restore feature enabled and discard a video. Date and time are provided using ATOM UTC format.. [optional] # noqa: E501 + deletes_at (datetime, none_type): The date and time the video will be permanently deleted. The API populates this field only if you have the Video Restore feature enabled and discard a video. Discarded videos are pemanently deleted after 90 days. Date and time are provided using ATOM UTC format.. [optional] # noqa: E501 + discarded (bool): Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video.. [optional] # noqa: E501 tags ([str]): One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. . [optional] # noqa: E501 - metadata ([Metadata]): Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. . [optional] # noqa: E501 + metadata ([Metadata]): Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. . [optional] # noqa: E501 source (VideoSource): [optional] # noqa: E501 assets (VideoAssets): [optional] # noqa: E501 player_id (str): The id of the player that will be applied on the video. . [optional] # noqa: E501 diff --git a/apivideo/model/video_creation_payload.py b/apivideo/model/video_creation_payload.py index e10582d..9a31ef2 100644 --- a/apivideo/model/video_creation_payload.py +++ b/apivideo/model/video_creation_payload.py @@ -168,7 +168,7 @@ def __init__(self, title, *args, **kwargs): # noqa: E501 mp4_support (bool): Enables mp4 version in addition to streamed version.. [optional] if omitted the server will use the default value of True # noqa: E501 player_id (str): The unique identification number for your video player.. [optional] # noqa: E501 tags ([str]): A list of tags you want to use to describe your video.. [optional] # noqa: E501 - 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. Read more on [dynamic metadata](https://api.video/blog/endpoints/dynamic-metadata/).. [optional] # noqa: E501 + metadata ([Metadata]): A list of key value pairs that you use to provide metadata for your video.. [optional] # noqa: E501 clip (VideoClip): [optional] # noqa: E501 watermark (VideoWatermark): [optional] # noqa: E501 """ diff --git a/apivideo/model/video_update_payload.py b/apivideo/model/video_update_payload.py index 8b45153..0398aab 100644 --- a/apivideo/model/video_update_payload.py +++ b/apivideo/model/video_update_payload.py @@ -155,7 +155,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 panoramic (bool): Whether the video is a 360 degree or immersive video.. [optional] # noqa: E501 mp4_support (bool): Whether the player supports the mp4 format.. [optional] # noqa: E501 tags ([str]): A list of terms or words you want to tag the video with. Make sure the list includes all the tags you want as whatever you send in this list will overwrite the existing list for the video.. [optional] # noqa: E501 - metadata ([Metadata]): A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair.. [optional] # noqa: E501 + metadata ([Metadata]): A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/apivideo/model/watermark.py b/apivideo/model/watermark.py index d88b2c1..70e1af7 100644 --- a/apivideo/model/watermark.py +++ b/apivideo/model/watermark.py @@ -132,7 +132,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) watermark_id (str): The unique identifier of the watermark.. [optional] # noqa: E501 - created_at (datetime): When the watermark was created, presented in ISO-8601 format.. [optional] # noqa: E501 + created_at (datetime): When the watermark was created, presented in ATOM UTC format.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/apivideo/model/webhook.py b/apivideo/model/webhook.py index 9db2def..878c4e0 100644 --- a/apivideo/model/webhook.py +++ b/apivideo/model/webhook.py @@ -136,7 +136,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) webhook_id (str): Unique identifier of the webhook. [optional] # noqa: E501 - created_at (datetime): When an webhook was created, presented in ISO-8601 format.. [optional] # noqa: E501 + created_at (datetime): When an webhook was created, presented in ATOM UTC format.. [optional] # noqa: E501 events ([str]): A list of events that will trigger the webhook.. [optional] # noqa: E501 url (str): URL of the webhook. [optional] # noqa: E501 """ diff --git a/docs/DiscardedVideoUpdatePayload.md b/docs/DiscardedVideoUpdatePayload.md new file mode 100644 index 0000000..9a00a76 --- /dev/null +++ b/docs/DiscardedVideoUpdatePayload.md @@ -0,0 +1,10 @@ +# DiscardedVideoUpdatePayload + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**discarded** | **bool** | Use this parameter to restore a discarded video when you have the Video Restore feature enabled. This parameter only accepts `false` as a 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 974c4b5..40d6bd4 100644 --- a/docs/LiveStream.md +++ b/docs/LiveStream.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **assets** | [**LiveStreamAssets**](LiveStreamAssets.md) | | [optional] **player_id** | **str** | 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] -**created_at** | **datetime** | When the player was created, presented in ISO-8601 format. | [optional] -**updated_at** | **datetime** | When the player was last updated, presented in ISO-8601 format. | [optional] +**created_at** | **datetime** | When the player was created, presented in ATOM UTC format. | [optional] +**updated_at** | **datetime** | When the player was last updated, presented in ATOM UTC 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/LiveStreamsApi.md b/docs/LiveStreamsApi.md index 32e16c5..8272454 100644 --- a/docs/LiveStreamsApi.md +++ b/docs/LiveStreamsApi.md @@ -292,7 +292,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: api_instance = live_streams_api.LiveStreamsApi(api_client) stream_key = "dw-dew8-q6w9-k67w-1ws8" # str | The unique stream key that allows you to stream videos. (optional) name = "My Video" # str | You can filter live streams by their name or a part of their name. (optional) - sort_by = "createdAt" # str | Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. (optional) + sort_by = "createdAt" # str | Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. (optional) sort_order = "desc" # str | Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. (optional) current_page = 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1 page_size = 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25 @@ -314,7 +314,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **stream_key** | **str**| The unique stream key that allows you to stream videos. | [optional] **name** | **str**| You can filter live streams by their name or a part of their name. | [optional] - **sort_by** | **str**| Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. | [optional] + **sort_by** | **str**| Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. | [optional] **sort_order** | **str**| Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. | [optional] **current_page** | **int**| Choose the number of search results to return per page. Minimum value: 1 | [optional] if omitted the server will use the default value of 1 **page_size** | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] if omitted the server will use the default value of 25 diff --git a/docs/PlayerSessionEvent.md b/docs/PlayerSessionEvent.md index a8168f6..088e326 100644 --- a/docs/PlayerSessionEvent.md +++ b/docs/PlayerSessionEvent.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | Possible values are: ready, play, pause, resume, seek.backward, seek.forward, end | [optional] -**emitted_at** | **datetime** | When an event occurred, presented in ISO-8601 format. | [optional] +**emitted_at** | **datetime** | When an event occurred, presented in ATOM UTC format. | [optional] **at** | **int** | | [optional] **_from** | **int** | | [optional] **to** | **int** | | [optional] diff --git a/docs/PlayerTheme.md b/docs/PlayerTheme.md index 2552a7e..80621c3 100644 --- a/docs/PlayerTheme.md +++ b/docs/PlayerTheme.md @@ -20,8 +20,8 @@ Name | Type | Description | Notes **force_autoplay** | **bool** | enable/disable player autoplay. Default: false | [optional] **hide_title** | **bool** | enable/disable title. Default: false | [optional] **force_loop** | **bool** | enable/disable looping. Default: false | [optional] -**created_at** | **datetime** | When the player was created, presented in ISO-8601 format. | [optional] -**updated_at** | **datetime** | When the player was last updated, presented in ISO-8601 format. | [optional] +**created_at** | **datetime** | When the player was created, presented in ATOM UTC format. | [optional] +**updated_at** | **datetime** | When the player was last updated, presented in ATOM UTC format. | [optional] **assets** | [**PlayerThemeAssets**](PlayerThemeAssets.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/PlayerThemesApi.md b/docs/PlayerThemesApi.md index 5ec8578..4929eba 100644 --- a/docs/PlayerThemesApi.md +++ b/docs/PlayerThemesApi.md @@ -304,7 +304,7 @@ from pprint import pprint with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: # Create an instance of the API class api_instance = player_themes_api.PlayerThemesApi(api_client) - sort_by = "createdAt" # str | createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. (optional) + sort_by = "createdAt" # str | createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. (optional) sort_order = "asc" # str | Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. (optional) current_page = 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1 page_size = 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25 @@ -324,7 +324,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sort_by** | **str**| createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. | [optional] + **sort_by** | **str**| createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. | [optional] **sort_order** | **str**| Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. | [optional] **current_page** | **int**| Choose the number of search results to return per page. Minimum value: 1 | [optional] if omitted the server will use the default value of 1 **page_size** | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] if omitted the server will use the default value of 25 diff --git a/docs/UploadToken.md b/docs/UploadToken.md index 40e63ac..9822a82 100644 --- a/docs/UploadToken.md +++ b/docs/UploadToken.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **token** | **str** | The unique identifier for the token you will use to authenticate an upload. | [optional] **ttl** | **int** | Time-to-live - how long the upload token is valid for. | [optional] -**created_at** | **datetime** | When the token was created, displayed in ISO-8601 format. | [optional] -**expires_at** | **datetime, none_type** | When the token expires, displayed in ISO-8601 format. | [optional] +**created_at** | **datetime** | When the token was created, displayed in ATOM UTC format. | [optional] +**expires_at** | **datetime, none_type** | When the token expires, displayed in ATOM UTC 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/UploadTokensApi.md b/docs/UploadTokensApi.md index 95f4bf1..94e1955 100644 --- a/docs/UploadTokensApi.md +++ b/docs/UploadTokensApi.md @@ -208,7 +208,7 @@ from pprint import pprint with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: # Create an instance of the API class api_instance = upload_tokens_api.UploadTokensApi(api_client) - sort_by = "ttl" # str | Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. (optional) + sort_by = "ttl" # str | Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. (optional) sort_order = "asc" # str | Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. (optional) current_page = 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1 page_size = 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25 @@ -228,7 +228,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sort_by** | **str**| Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. | [optional] + **sort_by** | **str**| Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. | [optional] **sort_order** | **str**| Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. | [optional] **current_page** | **int**| Choose the number of search results to return per page. Minimum value: 1 | [optional] if omitted the server will use the default value of 1 **page_size** | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] if omitted the server will use the default value of 25 diff --git a/docs/Video.md b/docs/Video.md index 3cfba44..3abcf95 100644 --- a/docs/Video.md +++ b/docs/Video.md @@ -4,13 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **video_id** | **str** | The unique identifier of the video object. | -**created_at** | **datetime** | When a video was created, presented in ISO-8601 format. | [optional] +**created_at** | **datetime** | When a video was created, presented in ATOM UTC format. | [optional] **title** | **str** | The title of the video content. | [optional] **description** | **str** | A description for the video content. | [optional] -**published_at** | **datetime** | The date and time the API created the video. Date and time are provided using ISO-8601 UTC format. | [optional] -**updated_at** | **datetime** | The date and time the video was updated. Date and time are provided using ISO-8601 UTC format. | [optional] +**published_at** | **datetime** | The date and time the API created the video. Date and time are provided using ATOM UTC format. | [optional] +**updated_at** | **datetime** | The date and time the video was updated. Date and time are provided using ATOM UTC format. | [optional] +**discarded_at** | **datetime, none_type** | The date and time the video was discarded. The API populates this field only if you have the Video Restore feature enabled and discard a video. Date and time are provided using ATOM UTC format. | [optional] +**deletes_at** | **datetime, none_type** | The date and time the video will be permanently deleted. The API populates this field only if you have the Video Restore feature enabled and discard a video. Discarded videos are pemanently deleted after 90 days. Date and time are provided using ATOM UTC format. | [optional] +**discarded** | **bool** | Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. | [optional] **tags** | **[str]** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional] -**metadata** | [**[Metadata]**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. | [optional] +**metadata** | [**[Metadata]**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. | [optional] **source** | [**VideoSource**](VideoSource.md) | | [optional] **assets** | [**VideoAssets**](VideoAssets.md) | | [optional] **player_id** | **str** | The id of the player that will be applied on the video. | [optional] diff --git a/docs/VideoCreationPayload.md b/docs/VideoCreationPayload.md index 13bd05b..d4b34eb 100644 --- a/docs/VideoCreationPayload.md +++ b/docs/VideoCreationPayload.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **mp4_support** | **bool** | Enables mp4 version in addition to streamed version. | [optional] if omitted the server will use the default value of True **player_id** | **str** | The unique identification number for your video player. | [optional] **tags** | **[str]** | A list of tags you want to use to describe your video. | [optional] -**metadata** | [**[Metadata]**](Metadata.md) | 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. Read more on [dynamic metadata](https://api.video/blog/endpoints/dynamic-metadata/). | [optional] +**metadata** | [**[Metadata]**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. | [optional] **clip** | [**VideoClip**](VideoClip.md) | | [optional] **watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional] diff --git a/docs/VideoUpdatePayload.md b/docs/VideoUpdatePayload.md index e16f10c..2da683d 100644 --- a/docs/VideoUpdatePayload.md +++ b/docs/VideoUpdatePayload.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **panoramic** | **bool** | Whether the video is a 360 degree or immersive video. | [optional] **mp4_support** | **bool** | Whether the player supports the mp4 format. | [optional] **tags** | **[str]** | A list of terms or words you want to tag the video with. Make sure the list includes all the tags you want as whatever you send in this list will overwrite the existing list for the video. | [optional] -**metadata** | [**[Metadata]**](Metadata.md) | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. | [optional] +**metadata** | [**[Metadata]**](Metadata.md) | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. | [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/VideosApi.md b/docs/VideosApi.md index 9fc2906..c256b1b 100644 --- a/docs/VideosApi.md +++ b/docs/VideosApi.md @@ -13,7 +13,10 @@ Method | HTTP request | Description [**list**](VideosApi.md#list) | **GET** /videos | List all video objects [**upload_thumbnail**](VideosApi.md#upload_thumbnail) | **POST** /videos/{videoId}/thumbnail | Upload a thumbnail [**pick_thumbnail**](VideosApi.md#pick_thumbnail) | **PATCH** /videos/{videoId}/thumbnail | Set a thumbnail +[**get_discarded**](VideosApi.md#get_discarded) | **GET** /discarded/videos/{videoId} | Retrieve a discarded video object [**get_status**](VideosApi.md#get_status) | **GET** /videos/{videoId}/status | Retrieve video status and details +[**list_discarded**](VideosApi.md#list_discarded) | **GET** /discarded/videos | List all discarded video objects +[**update_discarded**](VideosApi.md#update_discarded) | **PATCH** /discarded/videos/{videoId} | Update a discarded video object # **create** @@ -463,7 +466,7 @@ Name | Type | Description | Notes Delete a video object -If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. +If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. By default, deleted videos cannot be recovered. If you have the Video Restore feature enabled, this operation will discard the video instead of permanently deleting it. Make sure you subscribe to the Video Restore feature if you want to be able to restore deleted videos! The Video Restore feature retains videos for 90 days, after which the videos are permanently deleted ### Example @@ -540,7 +543,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: tags = ["captions", "dialogue"] # [str] | A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. (optional) metadata = { "key": "key_example", - } # {str: (str,)} | Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. (optional) + } # {str: (str,)} | Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. (optional) description = "New Zealand" # str | Retrieve video objects by `description`. (optional) live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | Retrieve video objects that were recorded from a live stream by `liveStreamId`. (optional) sort_by = "publishedAt" # str | Use this parameter to sort videos by the their created time, published time, updated time, or by title. (optional) @@ -565,7 +568,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **title** | **str**| The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. | [optional] **tags** | **[str]**| A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. | [optional] - **metadata** | **{str: (str,)}**| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. | [optional] + **metadata** | **{str: (str,)}**| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. | [optional] **description** | **str**| Retrieve video objects by `description`. | [optional] **live_stream_id** | **str**| Retrieve video objects that were recorded from a live stream by `liveStreamId`. | [optional] **sort_by** | **str**| Use this parameter to sort videos by the their created time, published time, updated time, or by title. | [optional] @@ -733,6 +736,65 @@ Name | Type | Description | Notes - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**404** | Not Found | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**429** | Too Many Requests | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_discarded** +> Video get_discarded(video_id) + +Retrieve a discarded video object + +This call provides the same information provided on video creation. For private videos, it will generate a unique token url. Use this to retrieve any details you need about a video, or set up a private viewing URL. + +### Example + +```python +import apivideo +from apivideo.api import videos_api +from apivideo.model.too_many_requests import TooManyRequests +from apivideo.model.not_found import NotFound +from apivideo.model.video import Video +from pprint import pprint + +# Enter a context with an instance of the API client +with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: + # Create an instance of the API class + api_instance = videos_api.VideosApi(api_client) + video_id = "videoId_example" # str | The unique identifier for the video you want details about. + + # example passing only required values which don't have defaults set + try: + # Retrieve a discarded video object + api_response = api_instance.get_discarded(video_id) + pprint(api_response) + except apivideo.ApiException as e: + print("Exception when calling VideosApi->get_discarded: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **video_id** | **str**| The unique identifier for the video you want details about. | + +### Return type + +[**Video**](Video.md) + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| @@ -801,3 +863,149 @@ 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) +# **list_discarded** +> VideosListResponse list_discarded() + +List all discarded video objects + +This method returns a list of your discarded videos (with all their details). With no parameters added, the API returns the first page of all discarded videos. You can filter discarded videos using the parameters described below. + +### Example + +```python +import apivideo +from apivideo.api import videos_api +from apivideo.model.too_many_requests import TooManyRequests +from apivideo.model.videos_list_response import VideosListResponse +from apivideo.model.bad_request import BadRequest +from pprint import pprint + +# Enter a context with an instance of the API client +with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: + # Create an instance of the API class + api_instance = videos_api.VideosApi(api_client) + title = "My Video.mp4" # str | The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. (optional) + tags = ["captions", "dialogue"] # [str] | A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. (optional) + metadata = { + "key": "key_example", + } # {str: (str,)} | Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. (optional) + description = "New Zealand" # str | Retrieve video objects by `description`. (optional) + live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | Retrieve video objects that were recorded from a live stream by `liveStreamId`. (optional) + sort_by = "publishedAt" # str | Use this parameter to sort videos by the their created time, published time, updated time, or by title. (optional) + sort_order = "asc" # str | Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A. (optional) + current_page = 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1 + page_size = 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25 + + # example passing only required values which don't have defaults set + # and optional values + try: + # List all discarded video objects + api_response = api_instance.list_discarded(title=title, tags=tags, metadata=metadata, description=description, live_stream_id=live_stream_id, sort_by=sort_by, sort_order=sort_order, current_page=current_page, page_size=page_size) + pprint(api_response) + except apivideo.ApiException as e: + print("Exception when calling VideosApi->list_discarded: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **title** | **str**| The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. | [optional] + **tags** | **[str]**| A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. | [optional] + **metadata** | **{str: (str,)}**| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. | [optional] + **description** | **str**| Retrieve video objects by `description`. | [optional] + **live_stream_id** | **str**| Retrieve video objects that were recorded from a live stream by `liveStreamId`. | [optional] + **sort_by** | **str**| Use this parameter to sort videos by the their created time, published time, updated time, or by title. | [optional] + **sort_order** | **str**| Use this parameter to sort results. `asc` is ascending and sorts from A to Z. `desc` is descending and sorts from Z to A. | [optional] + **current_page** | **int**| Choose the number of search results to return per page. Minimum value: 1 | [optional] if omitted the server will use the default value of 1 + **page_size** | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] if omitted the server will use the default value of 25 + +### Return type + +[**VideosListResponse**](VideosListResponse.md) + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**400** | Bad Request | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**429** | Too Many Requests | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_discarded** +> Video update_discarded(video_id, discarded_video_update_payload) + +Update a discarded video object + +Use this endpoint to restore a discarded video when you have the Video Restore feature enabled. + + + +### Example + +```python +import apivideo +from apivideo.api import videos_api +from apivideo.model.too_many_requests import TooManyRequests +from apivideo.model.bad_request import BadRequest +from apivideo.model.not_found import NotFound +from apivideo.model.discarded_video_update_payload import DiscardedVideoUpdatePayload +from apivideo.model.video import Video +from pprint import pprint + +# Enter a context with an instance of the API client +with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: + # Create an instance of the API class + api_instance = videos_api.VideosApi(api_client) + video_id = "vi4k0jvEUuaTdRAEjQ4Jfrgz" # str | The video ID for the video you want to restore. + discarded_video_update_payload = DiscardedVideoUpdatePayload( + discarded=True, + ) # DiscardedVideoUpdatePayload | + + # example passing only required values which don't have defaults set + try: + # Update a discarded video object + api_response = api_instance.update_discarded(video_id, discarded_video_update_payload) + pprint(api_response) + except apivideo.ApiException as e: + print("Exception when calling VideosApi->update_discarded: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **video_id** | **str**| The video ID for the video you want to restore. | + **discarded_video_update_payload** | [**DiscardedVideoUpdatePayload**](DiscardedVideoUpdatePayload.md)| | + +### Return type + +[**Video**](Video.md) + + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**400** | Bad Request | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**404** | Not Found | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| +**429** | Too Many Requests | * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
| + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Watermark.md b/docs/Watermark.md index 628aba7..29cd2c8 100644 --- a/docs/Watermark.md +++ b/docs/Watermark.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **watermark_id** | **str** | The unique identifier of the watermark. | [optional] -**created_at** | **datetime** | When the watermark was created, presented in ISO-8601 format. | [optional] +**created_at** | **datetime** | When the watermark was created, presented in ATOM UTC 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/Webhook.md b/docs/Webhook.md index 6cc736a..c940287 100644 --- a/docs/Webhook.md +++ b/docs/Webhook.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **webhook_id** | **str** | Unique identifier of the webhook | [optional] -**created_at** | **datetime** | When an webhook was created, presented in ISO-8601 format. | [optional] +**created_at** | **datetime** | When an webhook was created, presented in ATOM UTC format. | [optional] **events** | **[str]** | A list of events that will trigger the webhook. | [optional] **url** | **str** | URL of the webhook | [optional] diff --git a/setup.py b/setup.py index 07aeb4b..93a5a8c 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "api.video" -VERSION = "1.4.1" +VERSION = "1.4.2" # To install the library, run the following # # python setup.py install diff --git a/test/payloads/analytics/get_metrics_over_time/responses/200.json b/test/payloads/analytics/get_metrics_over_time/responses/200.json index b5a6342..9eccd0a 100644 --- a/test/payloads/analytics/get_metrics_over_time/responses/200.json +++ b/test/payloads/analytics/get_metrics_over_time/responses/200.json @@ -8,13 +8,13 @@ } }, "data" : [ { - "emittedAt" : "2024-05-29T07:00:00+00:00", + "emittedAt" : "2024-05-29T07+00:00:00:00", "metricValue" : 2 }, { - "emittedAt" : "2024-05-29T08:00:00+00:00", + "emittedAt" : "2024-05-29T08+00:00:00:00", "metricValue" : 1 }, { - "emittedAt" : "2024-05-29T09:00:00+00:00", + "emittedAt" : "2024-05-29T09+00:00:00:00", "metricValue" : 1 } ], "pagination" : { diff --git a/test/payloads/live_streams/create/responses/200.json b/test/payloads/live_streams/create/responses/200.json index 306bbd5..42772d8 100644 --- a/test/payloads/live_streams/create/responses/200.json +++ b/test/payloads/live_streams/create/responses/200.json @@ -1,7 +1,7 @@ { "liveStreamId" : "li4pqNqGUkhKfWcBGpZVLRY5", - "createdAt" : "2020-07-29T10:45:35.000Z", - "updatedAt" : "2020-07-29T10:45:35.000Z", + "createdAt" : "2020-07-29T10:45:35+00:00", + "updatedAt" : "2020-07-29T10:45:35+00:00", "streamKey" : "cc1b4df0-d1c5-4064-a8f9-9f0368385135", "restreams" : [ { "name" : "YouTube", diff --git a/test/payloads/live_streams/get/responses/200.json b/test/payloads/live_streams/get/responses/200.json index 306bbd5..42772d8 100644 --- a/test/payloads/live_streams/get/responses/200.json +++ b/test/payloads/live_streams/get/responses/200.json @@ -1,7 +1,7 @@ { "liveStreamId" : "li4pqNqGUkhKfWcBGpZVLRY5", - "createdAt" : "2020-07-29T10:45:35.000Z", - "updatedAt" : "2020-07-29T10:45:35.000Z", + "createdAt" : "2020-07-29T10:45:35+00:00", + "updatedAt" : "2020-07-29T10:45:35+00:00", "streamKey" : "cc1b4df0-d1c5-4064-a8f9-9f0368385135", "restreams" : [ { "name" : "YouTube", diff --git a/test/payloads/live_streams/list/responses/200.json b/test/payloads/live_streams/list/responses/200.json index 5bed3fe..b99ee55 100644 --- a/test/payloads/live_streams/list/responses/200.json +++ b/test/payloads/live_streams/list/responses/200.json @@ -1,8 +1,8 @@ { "data" : [ { "liveStreamId" : "li400mYKSgQ6xs7taUeSaEKr", - "createdAt" : "2020-01-31T10:17:47.000Z", - "updatedAt" : "2020-03-09T13:19:43.000Z", + "createdAt" : "2020-01-31T10:17:47+00:00", + "updatedAt" : "2020-03-09T13:19:43+00:00", "streamKey" : "30087931-229e-42cf-b5f9-e91bcc1f7332", "restreams" : [ { "name" : "YouTube", @@ -24,8 +24,8 @@ } }, { "liveStreamId" : "li4pqNqGUkhKfWcBGpZVLRY5", - "createdAt" : "2020-07-29T10:45:35.000Z", - "updatedAt" : "2020-07-29T10:45:35.000Z", + "createdAt" : "2020-07-29T10:45:35+00:00", + "updatedAt" : "2020-07-29T10:45:35+00:00", "streamKey" : "cc1b4df0-d1c5-4064-a8f9-9f0368385135", "restreams" : [ { "name" : "YouTube", diff --git a/test/payloads/live_streams/update/responses/200.json b/test/payloads/live_streams/update/responses/200.json index 306bbd5..42772d8 100644 --- a/test/payloads/live_streams/update/responses/200.json +++ b/test/payloads/live_streams/update/responses/200.json @@ -1,7 +1,7 @@ { "liveStreamId" : "li4pqNqGUkhKfWcBGpZVLRY5", - "createdAt" : "2020-07-29T10:45:35.000Z", - "updatedAt" : "2020-07-29T10:45:35.000Z", + "createdAt" : "2020-07-29T10:45:35+00:00", + "updatedAt" : "2020-07-29T10:45:35+00:00", "streamKey" : "cc1b4df0-d1c5-4064-a8f9-9f0368385135", "restreams" : [ { "name" : "YouTube", diff --git a/test/payloads/upload_tokens/create_token/responses/200.json b/test/payloads/upload_tokens/create_token/responses/200.json index 84ec55c..9d04c9d 100644 --- a/test/payloads/upload_tokens/create_token/responses/200.json +++ b/test/payloads/upload_tokens/create_token/responses/200.json @@ -1,6 +1,6 @@ { "token" : "to1tcmSFHeYY5KzyhOqVKMKb", "ttl" : 3600, - "createdAt" : "2020-12-02T10:13:19.000Z", - "expiresAt" : "2020-12-02T11:13:19.000Z" + "createdAt" : "2020-12-02T10:13:19+00:00", + "expiresAt" : "2020-12-02T11:13:19+00:00" } \ No newline at end of file diff --git a/test/payloads/upload_tokens/get_token/responses/200.json b/test/payloads/upload_tokens/get_token/responses/200.json index 15f20af..99c81b1 100644 --- a/test/payloads/upload_tokens/get_token/responses/200.json +++ b/test/payloads/upload_tokens/get_token/responses/200.json @@ -1,5 +1,5 @@ { "token" : "to1tcmSFHeYY5KzyhOqVKMKb", "ttl" : 0, - "createdAt" : "2020-12-02T10:13:19.000Z" + "createdAt" : "2020-12-02T10:13:19+00:00" } \ No newline at end of file diff --git a/test/payloads/upload_tokens/list/responses/200.json b/test/payloads/upload_tokens/list/responses/200.json index 073e66c..d9854ae 100644 --- a/test/payloads/upload_tokens/list/responses/200.json +++ b/test/payloads/upload_tokens/list/responses/200.json @@ -2,12 +2,12 @@ "data" : [ { "token" : "to37YfoPDRR2pcDKa6LsUE0M", "ttl" : 3600, - "createdAt" : "2020-12-02T10:26:46.000Z", - "expiresAt" : "2020-12-02T11:26:46.000Z" + "createdAt" : "2020-12-02T10:26:46+00:00", + "expiresAt" : "2020-12-02T11:26:46+00:00" }, { "token" : "to1W3ZS9PdUBZWzzTEZr1B79", "ttl" : 0, - "createdAt" : "2020-12-02T10:26:28.000Z" + "createdAt" : "2020-12-02T10:26:28+00:00" } ], "pagination" : { "currentPage" : 1, diff --git a/test/payloads/videos/create/responses/201.json b/test/payloads/videos/create/responses/201.json index 788e067..fbcda04 100644 --- a/test/payloads/videos/create/responses/201.json +++ b/test/payloads/videos/create/responses/201.json @@ -14,7 +14,8 @@ "key" : "Format", "value" : "Tutorial" } ], - "publishedAt" : "4665-07-14T23:36:18.598Z", + "publishedAt" : "2024-07-14T23:36:07+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" }, diff --git a/test/payloads/videos/create/responses/400.json b/test/payloads/videos/create/responses/400.json index c6358bf..0c3cae6 100644 --- a/test/payloads/videos/create/responses/400.json +++ b/test/payloads/videos/create/responses/400.json @@ -9,7 +9,7 @@ "name" : "title" }, { "type" : "https://docs.api.video/reference/invalid-attribute", - "title" : "This attribute must be a ISO8601 date.", + "title" : "This attribute must be a ISO-8601 date.", "name" : "scheduledAt" }, { "type" : "https://docs.api.video/reference/invalid-attribute", diff --git a/test/payloads/videos/get/responses/200.json b/test/payloads/videos/get/responses/200.json index 546d096..c6df209 100644 --- a/test/payloads/videos/get/responses/200.json +++ b/test/payloads/videos/get/responses/200.json @@ -14,8 +14,9 @@ "key" : "Format", "value" : "Tutorial" } ], - "publishedAt" : "2019-12-16T08:25:51.000Z", - "updatedAt" : "2019-12-16T08:48:49.000Z", + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" }, diff --git a/test/payloads/videos/get_discarded/responses/200.json b/test/payloads/videos/get_discarded/responses/200.json new file mode 100644 index 0000000..9bf0365 --- /dev/null +++ b/test/payloads/videos/get_discarded/responses/200.json @@ -0,0 +1,25 @@ +{ + "videoId" : "vi4blUQJFrYWbaG44NChkH27", + "playerId" : "pl45KFKdlddgk654dspkze", + "title" : "Maths video", + "description" : "An amazing video explaining string theory", + "public" : false, + "panoramic" : false, + "mp4Support" : true, + "tags" : [ "maths", "string theory", "video" ], + "metadata" : [ { + "key" : "Author", + "value" : "John Doe" + }, { + "key" : "Format", + "value" : "Tutorial" + } ], + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : true, + "discardedAt" : "2024-10-16T08:48:49+00:00", + "deletesAt" : "2024-11-16T08:48:49+00:00", + "source" : { + "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" + } +} \ No newline at end of file diff --git a/test/payloads/videos/get_discarded/responses/404.json b/test/payloads/videos/get_discarded/responses/404.json new file mode 100644 index 0000000..27275e1 --- /dev/null +++ b/test/payloads/videos/get_discarded/responses/404.json @@ -0,0 +1,6 @@ +{ + "type" : "https://docs.api.video/reference/resource-not-found", + "title" : "The requested resource was not found.", + "name" : "videoId", + "status" : 404 +} \ No newline at end of file diff --git a/test/payloads/videos/get_discarded/responses/429.json b/test/payloads/videos/get_discarded/responses/429.json new file mode 100644 index 0000000..d312e2b --- /dev/null +++ b/test/payloads/videos/get_discarded/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/test/payloads/videos/list/responses/200.json b/test/payloads/videos/list/responses/200.json index c569685..16b27a5 100644 --- a/test/payloads/videos/list/responses/200.json +++ b/test/payloads/videos/list/responses/200.json @@ -15,8 +15,9 @@ "key" : "Format", "value" : "Tutorial" } ], - "publishedAt" : "2019-12-16T08:25:51.000Z", - "updatedAt" : "2019-12-16T08:48:49.000Z", + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : false, "source" : { "uri" : "/videos/c188ed58-3403-46a2-b91b-44603d10b2c9/source" }, @@ -45,8 +46,9 @@ "key" : "Technology", "value" : "Computers" } ], - "publishedAt" : "2019-12-16T08:25:51.000Z", - "updatedAt" : "2019-12-16T08:48:49.000Z", + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" }, @@ -70,8 +72,9 @@ "key" : "Length", "value" : "Short" } ], - "publishedAt" : "2019-12-16T08:25:51.000Z", - "updatedAt" : "2019-12-16T08:48:49.000Z", + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" }, diff --git a/test/payloads/videos/list_discarded/responses/200.json b/test/payloads/videos/list_discarded/responses/200.json new file mode 100644 index 0000000..51658be --- /dev/null +++ b/test/payloads/videos/list_discarded/responses/200.json @@ -0,0 +1,91 @@ +{ + "data" : [ { + "videoId" : "vi4blUQJFrYWbaG44NChkH27", + "playerId" : "pl45KFKdlddgk654dspkze", + "title" : "Maths video", + "description" : "An amazing video explaining the string theory", + "public" : false, + "panoramic" : false, + "mp4Support" : true, + "tags" : [ "maths", "string theory", "video" ], + "metadata" : [ { + "key" : "Author", + "value" : "John Doe" + }, { + "key" : "Format", + "value" : "Tutorial" + } ], + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : true, + "discardedAt" : "2024-10-16T08:48:49+00:00", + "deletesAt" : "2024-11-16T08:48:49+00:00", + "source" : { + "uri" : "/videos/c188ed58-3403-46a2-b91b-44603d10b2c9/source" + } + }, { + "videoId" : "vi4blUQJFrYWbaG44NChkH27", + "title" : "Video Title", + "description" : "A description for your video.", + "public" : false, + "panoramic" : false, + "mp4Support" : true, + "tags" : [ "books", "short stories" ], + "metadata" : [ { + "key" : "Author", + "value" : "John Doe" + }, { + "key" : "Science Fiction", + "value" : "Cyberpunk" + }, { + "key" : "Technology", + "value" : "Computers" + } ], + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : true, + "discardedAt" : "2024-10-16T08:48:49+00:00", + "deletesAt" : "2024-11-16T08:48:49+00:00", + "source" : { + "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" + } + }, { + "videoId" : "vi4blUQJFrYWbaG44NChkH27", + "playerId" : "pl45KFKdlddgk654dspkze", + "title" : "My Video Title", + "description" : "A brief description of the video.", + "public" : false, + "panoramic" : false, + "mp4Support" : true, + "tags" : [ "General", "Videos" ], + "metadata" : [ { + "key" : "Length", + "value" : "Short" + } ], + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : true, + "discardedAt" : "2024-10-16T08:48:49+00:00", + "deletesAt" : "2024-11-16T08:48:49+00:00", + "source" : { + "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" + } + } ], + "pagination" : { + "currentPage" : 1, + "pageSize" : 25, + "pagesTotal" : 1, + "itemsTotal" : 11, + "currentPageItems" : 11, + "links" : [ { + "rel" : "self", + "uri" : "https://ws.api.video/videos?currentPage=1" + }, { + "rel" : "first", + "uri" : "https://ws.api.video/videos?currentPage=1" + }, { + "rel" : "last", + "uri" : "https://ws.api.video/videos?currentPage=1" + } ] + } +} \ No newline at end of file diff --git a/test/payloads/videos/list_discarded/responses/400.json b/test/payloads/videos/list_discarded/responses/400.json new file mode 100644 index 0000000..3a63da9 --- /dev/null +++ b/test/payloads/videos/list_discarded/responses/400.json @@ -0,0 +1,22 @@ +{ + "title" : "This parameter is out of the allowed range of values.", + "name" : "page", + "status" : 400, + "range" : { + "min" : 1 + }, + "problems" : [ { + "title" : "This parameter is out of the allowed range of values.", + "name" : "page", + "range" : { + "min" : 1 + } + }, { + "title" : "This parameter is out of the allowed range of values.", + "name" : "pageSize", + "range" : { + "min" : 10, + "max" : 100 + } + } ] +} \ No newline at end of file diff --git a/test/payloads/videos/list_discarded/responses/429.json b/test/payloads/videos/list_discarded/responses/429.json new file mode 100644 index 0000000..d312e2b --- /dev/null +++ b/test/payloads/videos/list_discarded/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/test/payloads/videos/pick_thumbnail/responses/200.json b/test/payloads/videos/pick_thumbnail/responses/200.json index b83fd7f..18a9112 100644 --- a/test/payloads/videos/pick_thumbnail/responses/200.json +++ b/test/payloads/videos/pick_thumbnail/responses/200.json @@ -14,7 +14,8 @@ "key" : "Format", "value" : "Tutorial" } ], - "publishedAt" : "4665-07-14T23:36:18.598Z", + "publishedAt" : "2024-07-14T23:36:07+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" }, diff --git a/test/payloads/videos/update/responses/200.json b/test/payloads/videos/update/responses/200.json index 246950c..f466a51 100644 --- a/test/payloads/videos/update/responses/200.json +++ b/test/payloads/videos/update/responses/200.json @@ -14,8 +14,9 @@ "key" : "Format", "value" : "Tutorial" } ], - "publishedAt" : "2019-12-16T08:25:51.000Z", - "updatedAt" : "2019-12-16T08:48:49.000Z", + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" }, diff --git a/test/payloads/videos/update_discarded/responses/200.json b/test/payloads/videos/update_discarded/responses/200.json new file mode 100644 index 0000000..63ddac0 --- /dev/null +++ b/test/payloads/videos/update_discarded/responses/200.json @@ -0,0 +1,25 @@ +{ + "videoId" : "vi4blUQJFrYWbaG44NChkH27", + "playerId" : "pl45KFKdlddgk654dspkze", + "title" : "Maths video", + "description" : "An amazing video explaining the string theory", + "public" : false, + "panoramic" : false, + "mp4Support" : true, + "tags" : [ "maths", "string theory", "video" ], + "metadata" : [ { + "key" : "Author", + "value" : "John Doe" + }, { + "key" : "Format", + "value" : "Tutorial" + } ], + "publishedAt" : "2019-12-16T08:25:51+00:00", + "updatedAt" : "2019-12-16T08:48:49+00:00", + "discarded" : true, + "discardedAt" : "2024-10-16T08:48:49+00:00", + "deletesAt" : "2024-11-16T08:48:49+00:00", + "source" : { + "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" + } +} \ No newline at end of file diff --git a/test/payloads/videos/update_discarded/responses/400.json b/test/payloads/videos/update_discarded/responses/400.json new file mode 100644 index 0000000..2efd14b --- /dev/null +++ b/test/payloads/videos/update_discarded/responses/400.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/invalid-attribute", + "title" : "An attribute is invalid.", + "detail" : "Value must be false.", + "name" : "discarded", + "status" : 400 +} \ No newline at end of file diff --git a/test/payloads/videos/update_discarded/responses/404.json b/test/payloads/videos/update_discarded/responses/404.json new file mode 100644 index 0000000..27275e1 --- /dev/null +++ b/test/payloads/videos/update_discarded/responses/404.json @@ -0,0 +1,6 @@ +{ + "type" : "https://docs.api.video/reference/resource-not-found", + "title" : "The requested resource was not found.", + "name" : "videoId", + "status" : 404 +} \ No newline at end of file diff --git a/test/payloads/videos/update_discarded/responses/429.json b/test/payloads/videos/update_discarded/responses/429.json new file mode 100644 index 0000000..d312e2b --- /dev/null +++ b/test/payloads/videos/update_discarded/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/test/payloads/videos/upload/responses/201.json b/test/payloads/videos/upload/responses/201.json index a7f6cca..38528b6 100644 --- a/test/payloads/videos/upload/responses/201.json +++ b/test/payloads/videos/upload/responses/201.json @@ -14,7 +14,8 @@ "key" : "Format", "value" : "Tutorial" } ], - "publishedAt" : "4665-07-14T23:36:18.598Z", + "publishedAt" : "2024-07-14T23:36:07+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" }, diff --git a/test/payloads/videos/upload_thumbnail/responses/200.json b/test/payloads/videos/upload_thumbnail/responses/200.json index 3418769..038c3b6 100644 --- a/test/payloads/videos/upload_thumbnail/responses/200.json +++ b/test/payloads/videos/upload_thumbnail/responses/200.json @@ -14,8 +14,9 @@ "key" : "Format", "value" : "Tutorial" } ], - "createdAt" : "2020-03-03T12:52:03.085Z", - "publishedAt" : "2020-07-14T23:36:18.598Z", + "createdAt" : "2020-03-03T12:52:03+00:00", + "publishedAt" : "2020-07-14T23:36:07+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4blUQJFrYWbaG44NChkH27/source" }, diff --git a/test/payloads/videos/upload_with_upload_token/responses/201.json b/test/payloads/videos/upload_with_upload_token/responses/201.json index 4769217..8aeb102 100644 --- a/test/payloads/videos/upload_with_upload_token/responses/201.json +++ b/test/payloads/videos/upload_with_upload_token/responses/201.json @@ -13,7 +13,8 @@ "key" : "Format", "value" : "Tutorial" } ], - "publishedAt" : "4665-07-14T23:36:18.598Z", + "publishedAt" : "2024-07-14T23:36:07+00:00", + "discarded" : false, "source" : { "uri" : "/videos/vi4k0jvEUuaTdRAEjQ4Jfrgz/source" }, diff --git a/test/payloads/watermarks/list/responses/200.json b/test/payloads/watermarks/list/responses/200.json index 2780655..bb35f32 100644 --- a/test/payloads/watermarks/list/responses/200.json +++ b/test/payloads/watermarks/list/responses/200.json @@ -1,10 +1,10 @@ { "data" : [ { "watermarkId" : "watermark_1BWr2L5MTQwxGkuxKjzh6i", - "createdAt" : "2019-12-16T08:25:51.000Z" + "createdAt" : "2019-12-16T08:25:51+00:00" }, { "watermarkId" : "watermark_3BWC2L5MTQwxGkuxKjzh7g", - "createdAt" : "2019-12-16T08:25:51.000Z" + "createdAt" : "2019-12-16T08:25:51+00:00" } ], "pagination" : { "currentPage" : 1, diff --git a/test/payloads/watermarks/upload/responses/200.json b/test/payloads/watermarks/upload/responses/200.json index 81e2a36..6286d74 100644 --- a/test/payloads/watermarks/upload/responses/200.json +++ b/test/payloads/watermarks/upload/responses/200.json @@ -1,4 +1,4 @@ { "watermarkId" : "watermark_1BWr2L5MTQwxGkuxKjzh6i", - "createdAt" : "2020-03-03T12:52:03.085Z" + "createdAt" : "2020-03-03T12:52:03+00:00" } \ No newline at end of file diff --git a/test/payloads/webhooks/create/responses/201.json b/test/payloads/webhooks/create/responses/201.json index 18acbdd..8311de4 100644 --- a/test/payloads/webhooks/create/responses/201.json +++ b/test/payloads/webhooks/create/responses/201.json @@ -1,6 +1,6 @@ { "webhookId" : "webhook_XXXXXXXXXXXXXXX", - "createdAt" : "2021-01-08T14:12:18.000Z", + "createdAt" : "2021-01-08T14:12:18+00:00", "events" : [ "video.encoding.quality.completed" ], "url" : "http://clientnotificationserver.com/notif?myquery=query" } \ No newline at end of file diff --git a/test/payloads/webhooks/get/responses/200.json b/test/payloads/webhooks/get/responses/200.json index 18acbdd..8311de4 100644 --- a/test/payloads/webhooks/get/responses/200.json +++ b/test/payloads/webhooks/get/responses/200.json @@ -1,6 +1,6 @@ { "webhookId" : "webhook_XXXXXXXXXXXXXXX", - "createdAt" : "2021-01-08T14:12:18.000Z", + "createdAt" : "2021-01-08T14:12:18+00:00", "events" : [ "video.encoding.quality.completed" ], "url" : "http://clientnotificationserver.com/notif?myquery=query" } \ No newline at end of file diff --git a/test/payloads/webhooks/list/responses/200.json b/test/payloads/webhooks/list/responses/200.json index ccd8aef..c9490be 100644 --- a/test/payloads/webhooks/list/responses/200.json +++ b/test/payloads/webhooks/list/responses/200.json @@ -1,12 +1,12 @@ { "data" : [ { "webhookId" : "webhook_XXXXXXXXXXXXXXX", - "createdAt" : "2021-01-08T14:12:18.000Z", + "createdAt" : "2021-01-08T14:12:18+00:00", "events" : [ "video.encoding.quality.completed" ], "url" : "http://clientnotificationserver.com/notif?myquery=query" }, { "webhookId" : "webhook_XXXXXXXXXYYYYYY", - "createdAt" : "2021-01-12T12:12:12.000Z", + "createdAt" : "2021-01-12T12:12:12+00:00", "events" : [ "video.encoding.quality.completed" ], "url" : "http://clientnotificationserver.com/notif?myquery=query2" } ], diff --git a/test/test_videos_api.py b/test/test_videos_api.py index 05e52fa..212f74c 100644 --- a/test/test_videos_api.py +++ b/test/test_videos_api.py @@ -17,6 +17,7 @@ from apivideo.model.restreams_request_object import RestreamsRequestObject from apivideo.model.bad_request import BadRequest +from apivideo.model.discarded_video_update_payload import DiscardedVideoUpdatePayload from apivideo.model.not_found import NotFound from apivideo.model.too_many_requests import TooManyRequests from apivideo.model.video import Video @@ -296,6 +297,31 @@ def test_pick_thumbnail(self): else: self.api.pick_thumbnail(**kwargs) + @responses.activate + def test_get_discarded(self): + """Test case for get_discarded + + Retrieve a discarded video object # noqa: E501 + """ + for file_name, json in self.load_json('videos', 'get_discarded'): + status = file_name.split("-")[0] + responses.reset() + + kwargs = { + 'video_id': "videoId_example", + } + url = '/discarded/videos/{video_id}'.format(**kwargs) + + responses.add('GET', url, body=json, status=int(status), content_type='application/json') + + if status[0] == '4': + with self.assertRaises(ApiException) as context: + self.api.get_discarded(**kwargs) + if status == '404': + self.assertIsInstance(context.exception, NotFoundException) + else: + self.api.get_discarded(**kwargs) + @responses.activate def test_get_status(self): """Test case for get_status @@ -321,3 +347,55 @@ def test_get_status(self): else: self.api.get_status(**kwargs) + @responses.activate + def test_list_discarded(self): + """Test case for list_discarded + + List all discarded video objects # noqa: E501 + """ + for file_name, json in self.load_json('videos', 'list_discarded'): + status = file_name.split("-")[0] + responses.reset() + + kwargs = { + } + url = '/discarded/videos'.format(**kwargs) + + responses.add('GET', url, body=json, status=int(status), content_type='application/json') + + if status[0] == '4': + with self.assertRaises(ApiException) as context: + self.api.list_discarded(**kwargs) + if status == '404': + self.assertIsInstance(context.exception, NotFoundException) + else: + self.api.list_discarded(**kwargs) + + @responses.activate + def test_update_discarded(self): + """Test case for update_discarded + + Update a discarded video object # noqa: E501 + """ + for file_name, json in self.load_json('videos', 'update_discarded'): + status = file_name.split("-")[0] + responses.reset() + + kwargs = { + 'video_id': "vi4k0jvEUuaTdRAEjQ4Jfrgz", + 'discarded_video_update_payload': DiscardedVideoUpdatePayload( + discarded=True, + ), + } + url = '/discarded/videos/{video_id}'.format(**kwargs) + + responses.add('PATCH', url, body=json, status=int(status), content_type='application/json') + + if status[0] == '4': + with self.assertRaises(ApiException) as context: + self.api.update_discarded(**kwargs) + if status == '404': + self.assertIsInstance(context.exception, NotFoundException) + else: + self.api.update_discarded(**kwargs) +