Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add video tags endpoint #98

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [1.4.3] - 2024-09-30
- Add /tags API endpoint

## [1.4.2] - 2024-09-16
- Add discarded video endpoints

Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [ChaptersApi](#)
- [LiveStreamsApi](#)
- [PlayerThemesApi](#)
- [TagsApi](#)
- [UploadTokensApi](#)
- [VideosApi](#)
- [WatermarksApi](#)
Expand Down Expand Up @@ -176,6 +177,14 @@ Method | HTTP request | Description
[**delete_logo**](https://github.com/apivideo/api.video-python-client/blob/main/docs/PlayerThemesApi.md#delete_logo) | **DELETE** `/players/{playerId}/logo` | Delete logo


### TagsApi


Method | HTTP request | Description
------------- | ------------- | -------------
[**list**](https://github.com/apivideo/api.video-python-client/blob/main/docs/TagsApi.md#list) | **GET** `/tags` | List all video tags


### UploadTokensApi


Expand Down Expand Up @@ -259,6 +268,8 @@ Method | HTTP request | Description
- [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)
- [Link](https://github.com/apivideo/api.video-python-client/blob/main/docs/Link.md)
- [ListTagsResponse](https://github.com/apivideo/api.video-python-client/blob/main/docs/ListTagsResponse.md)
- [ListTagsResponseData](https://github.com/apivideo/api.video-python-client/blob/main/docs/ListTagsResponseData.md)
- [LiveStream](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStream.md)
- [LiveStreamAssets](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamAssets.md)
- [LiveStreamCreationPayload](https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamCreationPayload.md)
Expand Down
2 changes: 1 addition & 1 deletion apivideo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""


__version__ = "1.4.2"
__version__ = "1.4.3"

# import ApiVideoClient
from apivideo.auth_api_client import AuthenticatedApiClient
Expand Down
191 changes: 191 additions & 0 deletions apivideo/api/tags_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
"""
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 os # noqa: F401
import re # noqa: F401
import sys # noqa: F401
from types import MethodType
from types import FunctionType

from apivideo.api_client import ApiClient
from apivideo.endpoint import EndPoint as _EndPoint, ChunkIO
from apivideo.model.video_id import VideoId
from apivideo.model_utils import ( # noqa: F401
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from apivideo.exceptions import ApiTypeError, ApiValueError
from apivideo.model.list_tags_response import ListTagsResponse
from apivideo.model.too_many_requests import TooManyRequests


class TagsApi(_EndPoint):

def list(
self,
**kwargs
):
"""List all video tags # noqa: E501
This endpoint enables you to search for video tags in a project and see how many videos are tagged with them. If you do not define any query parameters, the endpoint lists all video tags and the numbers of times they are used in a project. # 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(async_req=True)
>>> result = thread.get()
Keyword Args:
value (str): Use this parameter to search for specific video tags. The API filters results even on partial values, and ignores accents, uppercase, and lowercase. . [optional]
sort_by (str): Use this parameter to choose which field the API will use to sort the response data. The default is `value`. These are the available fields to sort by: - `value`: Sorts the results based on tag values in alphabetic order. - `videoCount`: Sorts the results based on the number of times a video tag is used. . [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:
ListTagsResponse
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': [
'value',
'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',): {

"VALUE": "value",
"VIDEOCOUNT": "videoCount"
},
('sort_order',): {

"ASC": "asc",
"DESC": "desc"
},
}
openapi_types = {
'value':
(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 = {
'value': 'value',
'sort_by': 'sortBy',
'sort_order': 'sortOrder',
'current_page': 'currentPage',
'page_size': 'pageSize',
}
location_map = {
'value': 'query',
'sort_by': 'query',
'sort_order': 'query',
'current_page': 'query',
'page_size': 'query',
}
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 `list`" %
(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`" %
(key, )
)

for key in params_map['required']:
if key not in kwargs.keys():
raise ApiValueError(
"Missing the required parameter `%s` when calling "
"`list`" % (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(
"/tags",
"GET",
params['path'],
params['query'],
params['header'],
body=params['body'],
post_params=params['form'],
files=params['file'],
response_type=(ListTagsResponse,),
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'])

2 changes: 1 addition & 1 deletion apivideo/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.2"
self.default_headers['AV-Origin-Client'] = "python:1.4.3"

def __enter__(self):
return self
Expand Down
1 change: 1 addition & 0 deletions apivideo/apis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from apivideo.api.chapters_api import ChaptersApi
from apivideo.api.live_streams_api import LiveStreamsApi
from apivideo.api.player_themes_api import PlayerThemesApi
from apivideo.api.tags_api import TagsApi
from apivideo.api.upload_tokens_api import UploadTokensApi
from apivideo.api.videos_api import VideosApi
from apivideo.api.watermarks_api import WatermarksApi
Expand Down
2 changes: 1 addition & 1 deletion apivideo/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.2".\
"SDK Package Version: 1.4.3".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
Loading
Loading