diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 436c911..cdc3d69 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -39,6 +39,7 @@ docs/GetAssetOrLiveStreamIdResponse.md docs/GetAssetOrLiveStreamIdResponseData.md docs/GetAssetOrLiveStreamIdResponseDataObject.md docs/GetAssetPlaybackIDResponse.md +docs/GetLiveStreamPlaybackIDResponse.md docs/GetMetricTimeseriesDataResponse.md docs/GetOverallValuesResponse.md docs/GetRealTimeBreakdownResponse.md @@ -163,6 +164,7 @@ mux_python/models/get_asset_or_live_stream_id_response.py mux_python/models/get_asset_or_live_stream_id_response_data.py mux_python/models/get_asset_or_live_stream_id_response_data_object.py mux_python/models/get_asset_playback_id_response.py +mux_python/models/get_live_stream_playback_id_response.py mux_python/models/get_metric_timeseries_data_response.py mux_python/models/get_overall_values_response.py mux_python/models/get_real_time_breakdown_response.py @@ -235,4 +237,5 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_get_live_stream_playback_id_response.py tox.ini diff --git a/.tool-versions b/.tool-versions index 765660d..549aba0 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,4 @@ python 3.7.2 java zulu-16.32.15 +yarn 1.22.10 +nodejs 16.5.0 diff --git a/docs/GetLiveStreamPlaybackIDResponse.md b/docs/GetLiveStreamPlaybackIDResponse.md new file mode 100644 index 0000000..55151f0 --- /dev/null +++ b/docs/GetLiveStreamPlaybackIDResponse.md @@ -0,0 +1,10 @@ +# GetLiveStreamPlaybackIDResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PlaybackID**](.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/LiveStreamsApi.md b/docs/LiveStreamsApi.md index 53856c1..d43cfe6 100644 --- a/docs/LiveStreamsApi.md +++ b/docs/LiveStreamsApi.md @@ -13,6 +13,7 @@ Method | HTTP request | Description [**disable_live_stream**](LiveStreamsApi.md#disable_live_stream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/disable | Disable a live stream [**enable_live_stream**](LiveStreamsApi.md#enable_live_stream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/enable | Enable a live stream [**get_live_stream**](LiveStreamsApi.md#get_live_stream) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream +[**get_live_stream_playback_id**](LiveStreamsApi.md#get_live_stream_playback_id) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a live stream playback ID [**get_live_stream_simulcast_target**](LiveStreamsApi.md#get_live_stream_simulcast_target) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target [**list_live_streams**](LiveStreamsApi.md#list_live_streams) | **GET** /video/v1/live-streams | List live streams [**reset_stream_key**](LiveStreamsApi.md#reset_stream_key) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key | Reset a live stream’s stream key @@ -673,6 +674,79 @@ 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) +# **get_live_stream_playback_id** +> GetLiveStreamPlaybackIDResponse get_live_stream_playback_id(live_stream_id, playback_id) + +Retrieve a live stream playback ID + +### Example + +* Basic Authentication (accessToken): +```python +from __future__ import print_function +import time +import mux_python +from mux_python.rest import ApiException +from pprint import pprint +# Defining the host is optional and defaults to https://api.mux.com +# See configuration.py for a list of all supported configuration parameters. +configuration = mux_python.Configuration( + host = "https://api.mux.com" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: accessToken +configuration = mux_python.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) + +# Enter a context with an instance of the API client +with mux_python.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mux_python.LiveStreamsApi(api_client) + live_stream_id = 'live_stream_id_example' # str | The live stream ID +playback_id = 'playback_id_example' # str | The live stream's playback ID. + + try: + # Retrieve a live stream playback ID + api_response = api_instance.get_live_stream_playback_id(live_stream_id, playback_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling LiveStreamsApi->get_live_stream_playback_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **live_stream_id** | **str**| The live stream ID | + **playback_id** | **str**| The live stream's playback ID. | + +### Return type + +[**GetLiveStreamPlaybackIDResponse**](GetLiveStreamPlaybackIDResponse.md) + +### Authorization + +[accessToken](../README.md#accessToken) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[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_live_stream_simulcast_target** > SimulcastTargetResponse get_live_stream_simulcast_target(live_stream_id, simulcast_target_id) diff --git a/gen/generator-config.json b/gen/generator-config.json index 003ae55..c867f96 100644 --- a/gen/generator-config.json +++ b/gen/generator-config.json @@ -2,5 +2,5 @@ "!!source": "https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/python.md", "packageName": "mux_python", "projectName": "mux_python", - "packageVersion": "2.1.1" + "packageVersion": "2.2.0" } diff --git a/mux_python/__init__.py b/mux_python/__init__.py index cec5645..fc1d0f2 100644 --- a/mux_python/__init__.py +++ b/mux_python/__init__.py @@ -15,7 +15,7 @@ from __future__ import absolute_import -__version__ = "2.1.1" +__version__ = "2.2.0" # import apis into sdk package from mux_python.api.assets_api import AssetsApi @@ -74,6 +74,7 @@ from mux_python.models.get_asset_or_live_stream_id_response_data import GetAssetOrLiveStreamIdResponseData from mux_python.models.get_asset_or_live_stream_id_response_data_object import GetAssetOrLiveStreamIdResponseDataObject from mux_python.models.get_asset_playback_id_response import GetAssetPlaybackIDResponse +from mux_python.models.get_live_stream_playback_id_response import GetLiveStreamPlaybackIDResponse from mux_python.models.get_metric_timeseries_data_response import GetMetricTimeseriesDataResponse from mux_python.models.get_overall_values_response import GetOverallValuesResponse from mux_python.models.get_real_time_breakdown_response import GetRealTimeBreakdownResponse diff --git a/mux_python/api/live_streams_api.py b/mux_python/api/live_streams_api.py index f3fc707..ba42a4a 100644 --- a/mux_python/api/live_streams_api.py +++ b/mux_python/api/live_streams_api.py @@ -1282,6 +1282,150 @@ def get_live_stream_with_http_info(self, live_stream_id, **kwargs): # noqa: E50 collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth')) + def get_live_stream_playback_id(self, live_stream_id, playback_id, **kwargs): # noqa: E501 + """Retrieve a live stream playback ID # 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_live_stream_playback_id(live_stream_id, playback_id, async_req=True) + >>> result = thread.get() + + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: 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. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: GetLiveStreamPlaybackIDResponse + """ + kwargs['_return_http_data_only'] = True + return self.get_live_stream_playback_id_with_http_info(live_stream_id, playback_id, **kwargs) # noqa: E501 + + def get_live_stream_playback_id_with_http_info(self, live_stream_id, playback_id, **kwargs): # noqa: E501 + """Retrieve a live stream playback ID # 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_live_stream_playback_id_with_http_info(live_stream_id, playback_id, async_req=True) + >>> result = thread.get() + + :param live_stream_id: The live stream ID (required) + :type live_stream_id: str + :param playback_id: The live stream's playback ID. (required) + :type playback_id: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: 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. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(GetLiveStreamPlaybackIDResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'live_stream_id', + 'playback_id' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_live_stream_playback_id" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'live_stream_id' is set + if self.api_client.client_side_validation and ('live_stream_id' not in local_var_params or # noqa: E501 + local_var_params['live_stream_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `live_stream_id` when calling `get_live_stream_playback_id`") # noqa: E501 + # verify the required parameter 'playback_id' is set + if self.api_client.client_side_validation and ('playback_id' not in local_var_params or # noqa: E501 + local_var_params['playback_id'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `playback_id` when calling `get_live_stream_playback_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'live_stream_id' in local_var_params: + path_params['LIVE_STREAM_ID'] = local_var_params['live_stream_id'] # noqa: E501 + if 'playback_id' in local_var_params: + path_params['PLAYBACK_ID'] = local_var_params['playback_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['accessToken'] # noqa: E501 + + response_types_map = { + 200: "GetLiveStreamPlaybackIDResponse", + } + + return self.api_client.call_api( + '/video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + def get_live_stream_simulcast_target(self, live_stream_id, simulcast_target_id, **kwargs): # noqa: E501 """Retrieve a Live Stream Simulcast Target # noqa: E501 diff --git a/mux_python/api_client.py b/mux_python/api_client.py index 12b6be8..3e2bef0 100644 --- a/mux_python/api_client.py +++ b/mux_python/api_client.py @@ -79,7 +79,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/2.1.1/python' + self.user_agent = 'OpenAPI-Generator/2.2.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/mux_python/configuration.py b/mux_python/configuration.py index a021bf4..313cf01 100644 --- a/mux_python/configuration.py +++ b/mux_python/configuration.py @@ -406,7 +406,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v1\n"\ - "SDK Package Version: 2.1.1".\ + "SDK Package Version: 2.2.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/mux_python/models/__init__.py b/mux_python/models/__init__.py index 1fbe1ba..5dd40fc 100644 --- a/mux_python/models/__init__.py +++ b/mux_python/models/__init__.py @@ -46,6 +46,7 @@ from mux_python.models.get_asset_or_live_stream_id_response_data import GetAssetOrLiveStreamIdResponseData from mux_python.models.get_asset_or_live_stream_id_response_data_object import GetAssetOrLiveStreamIdResponseDataObject from mux_python.models.get_asset_playback_id_response import GetAssetPlaybackIDResponse +from mux_python.models.get_live_stream_playback_id_response import GetLiveStreamPlaybackIDResponse from mux_python.models.get_metric_timeseries_data_response import GetMetricTimeseriesDataResponse from mux_python.models.get_overall_values_response import GetOverallValuesResponse from mux_python.models.get_real_time_breakdown_response import GetRealTimeBreakdownResponse diff --git a/mux_python/models/get_live_stream_playback_id_response.py b/mux_python/models/get_live_stream_playback_id_response.py new file mode 100644 index 0000000..77738a4 --- /dev/null +++ b/mux_python/models/get_live_stream_playback_id_response.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + Mux API + + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Contact: devex@mux.com + Generated by: https://openapi-generator.tech +""" + + +import inspect +import pprint +import re # noqa: F401 +import six + +from mux_python.configuration import Configuration + + +class GetLiveStreamPlaybackIDResponse(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'data': 'PlaybackID' + } + + attribute_map = { + 'data': 'data' + } + + def __init__(self, data=None, local_vars_configuration=None): # noqa: E501 + """GetLiveStreamPlaybackIDResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._data = None + self.discriminator = None + + if data is not None: + self.data = data + + @property + def data(self): + """Gets the data of this GetLiveStreamPlaybackIDResponse. # noqa: E501 + + + :return: The data of this GetLiveStreamPlaybackIDResponse. # noqa: E501 + :rtype: PlaybackID + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this GetLiveStreamPlaybackIDResponse. + + + :param data: The data of this GetLiveStreamPlaybackIDResponse. # noqa: E501 + :type data: PlaybackID + """ + + self._data = data + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = inspect.getargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetLiveStreamPlaybackIDResponse): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, GetLiveStreamPlaybackIDResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/setup.py b/setup.py index 471f713..b667083 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "mux_python" -VERSION = "2.1.1" +VERSION = "2.2.0" # To install the library, run the following # # python setup.py install diff --git a/test/test_get_live_stream_playback_id_response.py b/test/test_get_live_stream_playback_id_response.py new file mode 100644 index 0000000..c4eba35 --- /dev/null +++ b/test/test_get_live_stream_playback_id_response.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Mux API + + Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 + + The version of the OpenAPI document: v1 + Contact: devex@mux.com + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest +import datetime + +import mux_python +from mux_python.models.get_live_stream_playback_id_response import GetLiveStreamPlaybackIDResponse # noqa: E501 +from mux_python.rest import ApiException + +class TestGetLiveStreamPlaybackIDResponse(unittest.TestCase): + """GetLiveStreamPlaybackIDResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional): + """Test GetLiveStreamPlaybackIDResponse + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = mux_python.models.get_live_stream_playback_id_response.GetLiveStreamPlaybackIDResponse() # noqa: E501 + if include_optional : + return GetLiveStreamPlaybackIDResponse( + data = mux_python.models.playback_id.PlaybackID( + id = '', + policy = 'public', ) + ) + else : + return GetLiveStreamPlaybackIDResponse( + ) + + def testGetLiveStreamPlaybackIDResponse(self): + """Test GetLiveStreamPlaybackIDResponse""" + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()