diff --git a/docs/mozart-api.yaml b/docs/mozart-api.yaml index 1858e24..dbf118a 100644 --- a/docs/mozart-api.yaml +++ b/docs/mozart-api.yaml @@ -3866,7 +3866,7 @@ info: - [Beosound Level](https://www.bang-olufsen.com/en/dk/speakers/beosound-level)\n\ - [Beosound Theatre](https://www.bang-olufsen.com/en/dk/soundbars/beosound-theatre)\n\ \n\nThis API documentation has been generated for version 3.4.1.8 of the Mozart\ - \ platform and API generation version 3.4.1.8.2.\n\n## Python API\n\nThe Python\ + \ platform and API generation version 3.4.1.8.3.\n\n## Python API\n\nThe Python\ \ package has been generated using the [OpenAPI Generator](https:/openapi-generator.tech/)\ \ version 7.4.0. On top of the generated API, a helper file, mozart_client.py,\ \ has been made that makes the API more pythonic. We recommend using this.\n\ diff --git a/python_client/PKG-INFO b/python_client/PKG-INFO index ba07b02..6d77446 100644 --- a/python_client/PKG-INFO +++ b/python_client/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mozart_api -Version: 3.4.1.8.2 +Version: 3.4.1.8.3 Summary: Mozart platform API Home-page: https://pypi.org/project/mozart-api/ License: MIT @@ -16,11 +16,11 @@ Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Topic :: Multimedia +Requires-Dist: aenum (>=3.1.11) Requires-Dist: aioconsole (>=0.4.1) Requires-Dist: aiohttp (>=3.8.3) -Requires-Dist: aiohttp-retry (>=2.8.3) Requires-Dist: inflection (>=0.5.1) -Requires-Dist: pydantic (>=2) +Requires-Dist: pydantic (>=1.10.5,<2.0.0) Requires-Dist: python-dateutil (>=2.8.2) Requires-Dist: typing-extensions (>=4.7.1) Requires-Dist: urllib3 (>=1.25.3) diff --git a/python_client/mozart_api/__init__.py b/python_client/mozart_api/__init__.py index 73445be..119da82 100644 --- a/python_client/mozart_api/__init__.py +++ b/python_client/mozart_api/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "3.4.1.8.2" +__version__ = "3.4.1.8.3" # import apis into sdk package from mozart_api.api.beolink_api import BeolinkApi diff --git a/python_client/mozart_api/api/beolink_api.py b/python_client/mozart_api/api/beolink_api.py index 0f0a580..9fb5ac0 100644 --- a/python_client/mozart_api/api/beolink_api.py +++ b/python_client/mozart_api/api/beolink_api.py @@ -12,23 +12,28 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import Optional +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field, StrictStr + +from typing import List, Optional + from mozart_api.models.beolink_available_listener import BeolinkAvailableListener from mozart_api.models.beolink_join_request import BeolinkJoinRequest from mozart_api.models.beolink_join_result import BeolinkJoinResult from mozart_api.models.beolink_listener import BeolinkListener from mozart_api.models.beolink_peer import BeolinkPeer -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class BeolinkApi: @@ -43,2600 +48,1411 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def get_beolink_available_listeners( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[BeolinkAvailableListener]: - """Get available listeners + self, **kwargs + ) -> List[BeolinkAvailableListener]: # noqa: E501 + """Get available listeners # noqa: E501 - Get a list of devices that can be listening to this device active experience. + Get a list of devices that can be listening to this device active experience. # noqa: E501 + :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: List[BeolinkAvailableListener] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_available_listeners_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_available_listeners_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_beolink_available_listeners_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get available listeners # noqa: E501 + + Get a list of devices that can be listening to this device active experience. # noqa: E501 + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[BeolinkAvailableListener], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_available_listeners" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} - _param = self._get_beolink_available_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { + _response_types_map = { "200": "List[BeolinkAvailableListener]", "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/beolink/available-listeners", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, - ).data + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) - @validate_call - async def get_beolink_available_listeners_with_http_info( + @validate_arguments + async def get_beolink_join_result( self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[BeolinkAvailableListener]]: - """Get available listeners + id: Annotated[StrictStr, Field(..., description="Join request ID")], + **kwargs + ) -> BeolinkJoinResult: # noqa: E501 + """Get Beolink join result, test-endpoint # noqa: E501 + + Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. # noqa: E501 + + :param id: Join request ID (required) + :type id: str + :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: BeolinkJoinResult + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_join_result_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_join_result_with_http_info( + id, **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_beolink_join_result_with_http_info( + self, + id: Annotated[StrictStr, Field(..., description="Join request ID")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Get Beolink join result, test-endpoint # noqa: E501 - Get a list of devices that can be listening to this device active experience. + Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. # noqa: E501 + :param id: Join request ID (required) + :type id: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeolinkJoinResult, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_join_result" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} - _param = self._get_beolink_available_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the path parameters + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkAvailableListener]", - "400": "ErrorModel", + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BeolinkJoinResult", + "404": None, } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/beolink/join-result/{id}", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_available_listeners_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get available listeners + @validate_arguments + async def get_beolink_listeners( + self, **kwargs + ) -> List[BeolinkListener]: # noqa: E501 + """Get joined peers # noqa: E501 - Get a list of devices that can be listening to this device active experience. + Get a list of devices that are listening to this device active experience (that have joined). # noqa: E501 + :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: List[BeolinkListener] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_listeners_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_listeners_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_beolink_listeners_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get joined peers # noqa: E501 + + Get a list of devices that are listening to this device active experience (that have joined). # noqa: E501 + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_available_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkAvailableListener]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_beolink_available_listeners_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[BeolinkListener], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_listeners" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/available-listeners", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "List[BeolinkListener]", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/beolink/listeners", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_join_result( - self, - id: Annotated[StrictStr, Field(description="Join request ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BeolinkJoinResult: - """Get Beolink join result, test-endpoint + @validate_arguments + async def get_beolink_peers(self, **kwargs) -> List[BeolinkPeer]: # noqa: E501 + """Get discovered peers # noqa: E501 - Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. + Get information about the Beolink peers discovered by this device. # noqa: E501 - :param id: Join request ID (required) - :type id: str + :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: List[BeolinkPeer] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_peers_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_peers_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_beolink_peers_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get discovered peers # noqa: E501 + + Get information about the Beolink peers discovered by this device. # noqa: E501 + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_join_result_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkJoinResult", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[BeolinkPeer], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_peers" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} - @validate_call - async def get_beolink_join_result_with_http_info( - self, - id: Annotated[StrictStr, Field(description="Join request ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BeolinkJoinResult]: - """Get Beolink join result, test-endpoint + # process the path parameters + _path_params = {} - Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - :param id: Join request ID (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_join_result_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # authentication setting + _auth_settings = [] # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkJoinResult", - "404": None, + _response_types_map = { + "200": "List[BeolinkPeer]", + "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/beolink/peers", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_join_result_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="Join request ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Beolink join result, test-endpoint + @validate_arguments + async def get_beolink_self(self, **kwargs) -> BeolinkPeer: # noqa: E501 + """Get information about this device # noqa: E501 - Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. + Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. # noqa: E501 - :param id: Join request ID (required) - :type id: str + :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: BeolinkPeer + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_self_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_self_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_beolink_self_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get information about this device # noqa: E501 + + Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. # noqa: E501 + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_join_result_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkJoinResult", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_beolink_join_result_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeolinkPeer, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_self" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/join-result/{id}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BeolinkPeer", + } + + return await self.api_client.call_api( + "/api/v1/beolink/self", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_listeners( + @validate_arguments + async def join_beolink_peer( self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + jid: Annotated[StrictStr, Field(..., description="Jabber ID of peer to join")], + source: Annotated[ + Optional[StrictStr], + Field(description="Ask to join a specific source on peer"), ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[BeolinkListener]: - """Get joined peers + **kwargs + ) -> BeolinkJoinRequest: # noqa: E501 + """Join multi-room experience # noqa: E501 - Get a list of devices that are listening to this device active experience (that have joined). + Join the experience currently active on peer with Jabber ID `{jid}`. # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :param jid: Jabber ID of peer to join (required) + :type jid: str + :param source: Ask to join a specific source on peer + :type source: str + :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. - """ # noqa: E501 - - _param = self._get_beolink_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkListener]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_beolink_listeners_with_http_info( + If the method is called asynchronously, + returns the request thread. + :rtype: BeolinkJoinRequest + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the join_beolink_peer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.join_beolink_peer_with_http_info( + jid, source, **kwargs + ) # noqa: E501 + + @validate_arguments + async def join_beolink_peer_with_http_info( self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + jid: Annotated[StrictStr, Field(..., description="Jabber ID of peer to join")], + source: Annotated[ + Optional[StrictStr], + Field(description="Ask to join a specific source on peer"), ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[BeolinkListener]]: - """Get joined peers + **kwargs + ) -> ApiResponse: # noqa: E501 + """Join multi-room experience # noqa: E501 - Get a list of devices that are listening to this device active experience (that have joined). + Join the experience currently active on peer with Jabber ID `{jid}`. # noqa: E501 + :param jid: Jabber ID of peer to join (required) + :type jid: str + :param source: Ask to join a specific source on peer + :type source: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeolinkJoinRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = ["jid", "source"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method join_beolink_peer" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} - _param = self._get_beolink_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the path parameters + _path_params = {} + if _params["jid"] is not None: + _path_params["jid"] = _params["jid"] - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkListener]", + # process the query parameters + _query_params = [] + if _params.get("source") is not None: # noqa: E501 + _query_params.append(("source", _params["source"])) + + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "202": "BeolinkJoinRequest", "400": "ErrorModel", + "403": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/beolink/join/{jid}", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_listeners_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get joined peers + @validate_arguments + async def join_latest_beolink_experience( + self, **kwargs + ) -> BeolinkJoinRequest: # noqa: E501 + """Trigger touch to join # noqa: E501 - Get a list of devices that are listening to this device active experience (that have joined). + :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: BeolinkJoinRequest + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the join_latest_beolink_experience_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.join_latest_beolink_experience_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def join_latest_beolink_experience_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger touch to join # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkListener]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_beolink_listeners_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeolinkJoinRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method join_latest_beolink_experience" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/listeners", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "202": "BeolinkJoinRequest", + "400": "ErrorModel", + "403": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/beolink/join", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_peers( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[BeolinkPeer]: - """Get discovered peers + @validate_arguments + async def post_beolink_allstandby(self, **kwargs) -> None: # noqa: E501 + """Broadcast an all standby event to turn all Beolink devices off # noqa: E501 - Get information about the Beolink peers discovered by this device. + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_beolink_allstandby_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_beolink_allstandby_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def post_beolink_allstandby_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Broadcast an all standby event to turn all Beolink devices off # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_beolink_allstandby" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} - _param = self._get_beolink_peers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the path parameters + _path_params = {} - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkPeer]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_beolink_peers_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[BeolinkPeer]]: - """Get discovered peers - - Get information about the Beolink peers discovered by this device. - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_peers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkPeer]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_beolink_peers_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get discovered peers - - Get information about the Beolink peers discovered by this device. - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_peers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkPeer]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_beolink_peers_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/peers", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_beolink_self( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BeolinkPeer: - """Get information about this device - - Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_self_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkPeer", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_beolink_self_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BeolinkPeer]: - """Get information about this device - - Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_self_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkPeer", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_beolink_self_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get information about this device - - Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_beolink_self_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkPeer", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_beolink_self_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/self", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def join_beolink_peer( - self, - jid: Annotated[StrictStr, Field(description="Jabber ID of peer to join")], - source: Annotated[ - Optional[StrictStr], - Field(description="Ask to join a specific source on peer"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BeolinkJoinRequest: - """Join multi-room experience - - Join the experience currently active on peer with Jabber ID `{jid}`. - - :param jid: Jabber ID of peer to join (required) - :type jid: str - :param source: Ask to join a specific source on peer - :type source: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_beolink_peer_serialize( - jid=jid, - source=source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def join_beolink_peer_with_http_info( - self, - jid: Annotated[StrictStr, Field(description="Jabber ID of peer to join")], - source: Annotated[ - Optional[StrictStr], - Field(description="Ask to join a specific source on peer"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BeolinkJoinRequest]: - """Join multi-room experience - - Join the experience currently active on peer with Jabber ID `{jid}`. - - :param jid: Jabber ID of peer to join (required) - :type jid: str - :param source: Ask to join a specific source on peer - :type source: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_beolink_peer_serialize( - jid=jid, - source=source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def join_beolink_peer_without_preload_content( - self, - jid: Annotated[StrictStr, Field(description="Jabber ID of peer to join")], - source: Annotated[ - Optional[StrictStr], - Field(description="Ask to join a specific source on peer"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Join multi-room experience - - Join the experience currently active on peer with Jabber ID `{jid}`. - - :param jid: Jabber ID of peer to join (required) - :type jid: str - :param source: Ask to join a specific source on peer - :type source: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_beolink_peer_serialize( - jid=jid, - source=source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _join_beolink_peer_serialize( - self, - jid, - source, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if jid is not None: - _path_params["jid"] = jid - # process the query parameters - if source is not None: - - _query_params.append(("source", source)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/join/{jid}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def join_latest_beolink_experience( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BeolinkJoinRequest: - """Trigger touch to join - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_latest_beolink_experience_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def join_latest_beolink_experience_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BeolinkJoinRequest]: - """Trigger touch to join - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_latest_beolink_experience_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def join_latest_beolink_experience_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger touch to join - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_latest_beolink_experience_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _join_latest_beolink_experience_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/join", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_beolink_allstandby( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Broadcast an all standby event to turn all Beolink devices off - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_allstandby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_beolink_allstandby_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Broadcast an all standby event to turn all Beolink devices off - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_allstandby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_beolink_allstandby_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Broadcast an all standby event to turn all Beolink devices off - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_allstandby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_beolink_allstandby_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/allstandby", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/beolink/allstandby", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def post_beolink_expand( self, jid: Annotated[ StrictStr, - Field(description="Jabber id of peer to expand the active experience to"), + Field( + ..., description="Jabber id of peer to expand the active experience to" + ), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Expand the current active experience + **kwargs + ) -> None: # noqa: E501 + """Expand the current active experience # noqa: E501 - Expand the current active experience to another device with jabber id `{jid}`. + Expand the current active experience to another device with jabber id `{jid}`. # noqa: E501 :param jid: Jabber id of peer to expand the active experience to (required) :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_beolink_expand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "403": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_beolink_expand_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_beolink_expand_with_http_info( + jid, **kwargs + ) # noqa: E501 + + @validate_arguments async def post_beolink_expand_with_http_info( self, jid: Annotated[ StrictStr, - Field(description="Jabber id of peer to expand the active experience to"), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Expand the current active experience - - Expand the current active experience to another device with jabber id `{jid}`. - - :param jid: Jabber id of peer to expand the active experience to (required) - :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_expand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "403": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_beolink_expand_without_preload_content( - self, - jid: Annotated[ - StrictStr, - Field(description="Jabber id of peer to expand the active experience to"), + Field( + ..., description="Jabber id of peer to expand the active experience to" + ), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Expand the current active experience + **kwargs + ) -> ApiResponse: # noqa: E501 + """Expand the current active experience # noqa: E501 - Expand the current active experience to another device with jabber id `{jid}`. + Expand the current active experience to another device with jabber id `{jid}`. # noqa: E501 :param jid: Jabber id of peer to expand the active experience to (required) :type jid: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_expand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "403": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_beolink_expand_serialize( - self, - jid, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["jid"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_beolink_expand" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - if jid is not None: - _path_params["jid"] = jid + _path_params = {} + if _params["jid"] is not None: + _path_params["jid"] = _params["jid"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/expand/{jid}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/beolink/expand/{jid}", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def post_beolink_leave( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Leave the ongoing experience (disconnect this device from remote) + @validate_arguments + async def post_beolink_leave(self, **kwargs) -> None: # noqa: E501 + """Leave the ongoing experience (disconnect this device from remote) # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_beolink_leave_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_beolink_leave_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_beolink_leave_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def post_beolink_leave_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Leave the ongoing experience (disconnect this device from remote) - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_leave_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_beolink_leave_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Leave the ongoing experience (disconnect this device from remote) - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Leave the ongoing experience (disconnect this device from remote) # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_leave_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_beolink_leave_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_beolink_leave" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/leave", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/beolink/leave", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def post_beolink_unexpand( self, - jid: Annotated[StrictStr, Field(description="Jabber id of peer to unexpand")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Unexpand (disconnect) a device from the multiroom session + jid: Annotated[ + StrictStr, Field(..., description="Jabber id of peer to unexpand") + ], + **kwargs + ) -> None: # noqa: E501 + """Unexpand (disconnect) a device from the multiroom session # noqa: E501 - Disconnect the device with jabber id `{jid}` from the current active experience. + Disconnect the device with jabber id `{jid}` from the current active experience. # noqa: E501 :param jid: Jabber id of peer to unexpand (required) :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_beolink_unexpand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_beolink_unexpand_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_beolink_unexpand_with_http_info( + jid, **kwargs + ) # noqa: E501 + + @validate_arguments async def post_beolink_unexpand_with_http_info( self, - jid: Annotated[StrictStr, Field(description="Jabber id of peer to unexpand")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Unexpand (disconnect) a device from the multiroom session - - Disconnect the device with jabber id `{jid}` from the current active experience. - - :param jid: Jabber id of peer to unexpand (required) - :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_unexpand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_beolink_unexpand_without_preload_content( - self, - jid: Annotated[StrictStr, Field(description="Jabber id of peer to unexpand")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Unexpand (disconnect) a device from the multiroom session + jid: Annotated[ + StrictStr, Field(..., description="Jabber id of peer to unexpand") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Unexpand (disconnect) a device from the multiroom session # noqa: E501 - Disconnect the device with jabber id `{jid}` from the current active experience. + Disconnect the device with jabber id `{jid}` from the current active experience. # noqa: E501 :param jid: Jabber id of peer to unexpand (required) :type jid: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_unexpand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_beolink_unexpand_serialize( - self, - jid, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["jid"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_beolink_unexpand" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - if jid is not None: - _path_params["jid"] = jid + _path_params = {} + if _params["jid"] is not None: + _path_params["jid"] = _params["jid"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/unexpand/{jid}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/beolink/unexpand/{jid}", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/bluetooth_api.py b/python_client/mozart_api/api/bluetooth_api.py index fc65b78..17b42c0 100644 --- a/python_client/mozart_api/api/bluetooth_api.py +++ b/python_client/mozart_api/api/bluetooth_api.py @@ -12,16 +12,19 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated + +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable from mozart_api.models.bluetooth_device_list import BluetoothDeviceList -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class BluetoothApi: @@ -36,226 +39,125 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def get_bluetooth_devices_status( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BluetoothDeviceList: - """Get the bluetooth devices status + self, **kwargs + ) -> BluetoothDeviceList: # noqa: E501 + """Get the bluetooth devices status # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_bluetooth_devices_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BluetoothDeviceList", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: BluetoothDeviceList + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_bluetooth_devices_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_bluetooth_devices_status_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments async def get_bluetooth_devices_status_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BluetoothDeviceList]: - """Get the bluetooth devices status - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_bluetooth_devices_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BluetoothDeviceList", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_bluetooth_devices_status_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the bluetooth devices status - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the bluetooth devices status # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_bluetooth_devices_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BluetoothDeviceList, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "BluetoothDeviceList", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_bluetooth_devices_status_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_bluetooth_devices_status" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BluetoothDeviceList", + "400": "ErrorModel", + } - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/setup/bluetooth/devices", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + return await self.api_client.call_api( + "/api/v1/setup/bluetooth/devices", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/content_api.py b/python_client/mozart_api/api/content_api.py index 02f713a..1072aa0 100644 --- a/python_client/mozart_api/api/content_api.py +++ b/python_client/mozart_api/api/content_api.py @@ -12,19 +12,24 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import Optional +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field, StrictStr + +from typing import Dict, Optional + from mozart_api.models.content_item import ContentItem -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class ContentApi: @@ -39,7 +44,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def get_content( self, start_with: Annotated[ @@ -48,66 +53,29 @@ async def get_content( description='Filter result that start with x. It could be input source "tv", "netradio" or content "tv://TV", "tv://netflix"' ), ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, ContentItem]: - """Get a list of available content + **kwargs + ) -> Dict[str, ContentItem]: # noqa: E501 + """Get a list of available content # noqa: E501 :param start_with: Filter result that start with x. It could be input source \"tv\", \"netradio\" or content \"tv://TV\", \"tv://netflix\" :type start_with: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_content_serialize( - start_with=start_with, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, ContentItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: Dict[str, ContentItem] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_content_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_content_with_http_info(start_with, **kwargs) # noqa: E501 + + @validate_arguments async def get_content_with_http_info( self, start_with: Annotated[ @@ -116,178 +84,103 @@ async def get_content_with_http_info( description='Filter result that start with x. It could be input source "tv", "netradio" or content "tv://TV", "tv://netflix"' ), ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, ContentItem]]: - """Get a list of available content + **kwargs + ) -> ApiResponse: # noqa: E501 + """Get a list of available content # noqa: E501 :param start_with: Filter result that start with x. It could be input source \"tv\", \"netradio\" or content \"tv://TV\", \"tv://netflix\" :type start_with: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_content_serialize( - start_with=start_with, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, ContentItem], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = ["start_with"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, ContentItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_content" % _key + ) + _params[_key] = _val + del _params["kwargs"] - @validate_call - async def get_content_without_preload_content( - self, - start_with: Annotated[ - Optional[StrictStr], - Field( - description='Filter result that start with x. It could be input source "tv", "netradio" or content "tv://TV", "tv://netflix"' - ), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a list of available content - - - :param start_with: Filter result that start with x. It could be input source \"tv\", \"netradio\" or content \"tv://TV\", \"tv://netflix\" - :type start_with: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_content_serialize( - start_with=start_with, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, ContentItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_content_serialize( - self, - start_with, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - # process the query parameters - if start_with is not None: + _path_params = {} - _query_params.append(("startWith", start_with)) + # process the query parameters + _query_params = [] + if _params.get("start_with") is not None: # noqa: E501 + _query_params.append(("startWith", _params["start_with"])) # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] + _auth_settings = [] # noqa: E501 - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/content", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _response_types_map = { + "200": "Dict[str, ContentItem]", + } + + return await self.api_client.call_api( + "/api/v1/content", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/deezer_api.py b/python_client/mozart_api/api/deezer_api.py index 954cb28..9b9489f 100644 --- a/python_client/mozart_api/api/deezer_api.py +++ b/python_client/mozart_api/api/deezer_api.py @@ -12,19 +12,24 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + +from typing_extensions import Annotated from pydantic import Field + from typing import Optional -from typing_extensions import Annotated + from mozart_api.models.user_flow import UserFlow -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class DeezerApi: @@ -39,257 +44,145 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def start_deezer_flow( self, user_flow: Annotated[ Optional[UserFlow], Field(description="Select user") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Play users flow. If no provided user id it will play the flow connected to the active account + **kwargs + ) -> None: # noqa: E501 + """Play users flow. If no provided user id it will play the flow connected to the active account # noqa: E501 :param user_flow: Select user :type user_flow: UserFlow - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the start_deezer_flow_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.start_deezer_flow_with_http_info( + user_flow, **kwargs + ) # noqa: E501 + + @validate_arguments async def start_deezer_flow_with_http_info( self, user_flow: Annotated[ Optional[UserFlow], Field(description="Select user") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Play users flow. If no provided user id it will play the flow connected to the active account + **kwargs + ) -> ApiResponse: # noqa: E501 + """Play users flow. If no provided user id it will play the flow connected to the active account # noqa: E501 :param user_flow: Select user :type user_flow: UserFlow + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["user_flow"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method start_deezer_flow" % _key + ) + _params[_key] = _val + del _params["kwargs"] - @validate_call - async def start_deezer_flow_without_preload_content( - self, - user_flow: Annotated[ - Optional[UserFlow], Field(description="Select user") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Play users flow. If no provided user id it will play the flow connected to the active account - - - :param user_flow: Select user - :type user_flow: UserFlow - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _start_deezer_flow_serialize( - self, - user_flow, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if user_flow is not None: - _body_params = user_flow + _body_params = None + if _params["user_flow"] is not None: + _body_params = _params["user_flow"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/deezer/flow", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/deezer/flow", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/mozart_api.py b/python_client/mozart_api/api/mozart_api.py index 3ccd08e..ff8908e 100644 --- a/python_client/mozart_api/api/mozart_api.py +++ b/python_client/mozart_api/api/mozart_api.py @@ -12,14 +12,19 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Optional +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field, StrictBool, StrictInt, StrictStr, conint + +from typing import Any, Dict, List, Optional + from mozart_api.models.bass import Bass from mozart_api.models.battery_state import BatteryState from mozart_api.models.beolink_available_listener import BeolinkAvailableListener @@ -62,9 +67,9 @@ from mozart_api.models.volume_settings import VolumeSettings from mozart_api.models.volume_state import VolumeState -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class MozartApi: @@ -79,14119 +84,7718 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def activate_listening_mode( - self, - id: Annotated[int, Field(strict=True, ge=0)], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Activate a listening mode + self, id: conint(strict=True, ge=0), **kwargs + ) -> None: # noqa: E501 + """Activate a listening mode # noqa: E501 :param id: (required) :type id: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_listening_mode_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the activate_listening_mode_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.activate_listening_mode_with_http_info( + id, **kwargs + ) # noqa: E501 + + @validate_arguments async def activate_listening_mode_with_http_info( - self, - id: Annotated[int, Field(strict=True, ge=0)], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Activate a listening mode - - - :param id: (required) - :type id: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_listening_mode_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def activate_listening_mode_without_preload_content( - self, - id: Annotated[int, Field(strict=True, ge=0)], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Activate a listening mode + self, id: conint(strict=True, ge=0), **kwargs + ) -> ApiResponse: # noqa: E501 + """Activate a listening mode # noqa: E501 :param id: (required) :type id: int + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._activate_listening_mode_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _activate_listening_mode_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method activate_listening_mode" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/sound/listening-modes/{id}/activate", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/listening-modes/{id}/activate", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def activate_preset( self, id: Annotated[ - StrictInt, Field(description="the id of the preset you want to trigger") + StrictInt, + Field(..., description="the id of the preset you want to trigger"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Trigger a preset + **kwargs + ) -> None: # noqa: E501 + """Trigger a preset # noqa: E501 :param id: the id of the preset you want to trigger (required) :type id: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_preset_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "412": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the activate_preset_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.activate_preset_with_http_info(id, **kwargs) # noqa: E501 + + @validate_arguments async def activate_preset_with_http_info( self, id: Annotated[ - StrictInt, Field(description="the id of the preset you want to trigger") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Trigger a preset - - - :param id: the id of the preset you want to trigger (required) - :type id: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_preset_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "412": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def activate_preset_without_preload_content( - self, - id: Annotated[ - StrictInt, Field(description="the id of the preset you want to trigger") + StrictInt, + Field(..., description="the id of the preset you want to trigger"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger a preset + **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger a preset # noqa: E501 :param id: the id of the preset you want to trigger (required) :type id: int + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._activate_preset_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "412": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _activate_preset_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method activate_preset" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/preset/{id}/trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/preset/{id}/trigger", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def add_to_queue( self, play_queue_item: Annotated[ - PlayQueueItem, Field(description="the queue element you want to add") + PlayQueueItem, Field(..., description="the queue element you want to add") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Add an element to the queue + **kwargs + ) -> None: # noqa: E501 + """Add an element to the queue # noqa: E501 :param play_queue_item: the queue element you want to add (required) :type play_queue_item: PlayQueueItem - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_to_queue_serialize( - play_queue_item=play_queue_item, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the add_to_queue_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.add_to_queue_with_http_info( + play_queue_item, **kwargs + ) # noqa: E501 + + @validate_arguments async def add_to_queue_with_http_info( self, play_queue_item: Annotated[ - PlayQueueItem, Field(description="the queue element you want to add") + PlayQueueItem, Field(..., description="the queue element you want to add") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Add an element to the queue + **kwargs + ) -> ApiResponse: # noqa: E501 + """Add an element to the queue # noqa: E501 :param play_queue_item: the queue element you want to add (required) :type play_queue_item: PlayQueueItem + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() - _param = self._add_to_queue_serialize( - play_queue_item=play_queue_item, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _all_params = ["play_queue_item"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method add_to_queue" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params["play_queue_item"] is not None: + _body_params = _params["play_queue_item"] + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/queue", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def add_to_queue_without_preload_content( - self, - play_queue_item: Annotated[ - PlayQueueItem, Field(description="the queue element you want to add") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Add an element to the queue + @validate_arguments + async def get_active_listening_mode( + self, **kwargs + ) -> ListeningModeRef: # noqa: E501 + """Get the active listening mode # noqa: E501 + + + :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: ListeningModeRef + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_active_listening_mode_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_active_listening_mode_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_active_listening_mode_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the active listening mode # noqa: E501 - :param play_queue_item: the queue element you want to add (required) - :type play_queue_item: PlayQueueItem + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ListeningModeRef, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._add_to_queue_serialize( - play_queue_item=play_queue_item, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _add_to_queue_serialize( - self, - play_queue_item, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_active_listening_mode" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if play_queue_item is not None: - _body_params = play_queue_item - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/queue", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "ListeningModeRef", + } + + return await self.api_client.call_api( + "/api/v1/sound/listening-modes/active", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_active_listening_mode( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListeningModeRef: - """Get the active listening mode + @validate_arguments + async def get_all_scenes(self, **kwargs) -> Dict[str, Scene]: # noqa: E501 + """Get a list of configured scenes # noqa: E501 + + + :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: Dict[str, Scene] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_all_scenes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_all_scenes_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_all_scenes_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get a list of configured scenes # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, Scene], status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_active_listening_mode_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListeningModeRef", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_active_listening_mode_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListeningModeRef]: - """Get the active listening mode + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_scenes" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._get_active_listening_mode_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListeningModeRef", + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, Scene]", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/scenes", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_active_listening_mode_without_preload_content( + @validate_arguments + async def get_available_sources( + self, + target_remote: Annotated[ + Optional[StrictBool], Field(description="filter sources for remote control") + ] = None, + **kwargs + ) -> SourceArray: # noqa: E501 + """Get all the available sources # noqa: E501 + + + :param target_remote: filter sources for remote control + :type target_remote: bool + :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: SourceArray + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_available_sources_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_available_sources_with_http_info( + target_remote, **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_available_sources_with_http_info( self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + target_remote: Annotated[ + Optional[StrictBool], Field(description="filter sources for remote control") ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the active listening mode + **kwargs + ) -> ApiResponse: # noqa: E501 + """Get all the available sources # noqa: E501 + :param target_remote: filter sources for remote control + :type target_remote: bool + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(SourceArray, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_active_listening_mode_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListeningModeRef", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["target_remote"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _get_active_listening_mode_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_available_sources" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] + if _params.get("target_remote") is not None: # noqa: E501 + _query_params.append(("target-remote", _params["target_remote"])) + # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/listening-modes/active", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "SourceArray", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/playback/sources", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_all_scenes( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, Scene]: - """Get a list of configured scenes + @validate_arguments + async def get_battery_state(self, **kwargs) -> BatteryState: # noqa: E501 + """Get battery state of the product # noqa: E501 + + + :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: BatteryState + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_battery_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_battery_state_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_battery_state_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get battery state of the product # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BatteryState, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_all_scenes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Scene]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_all_scenes_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, Scene]]: - """Get a list of configured scenes + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_battery_state" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._get_all_scenes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Scene]", + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BatteryState", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/battery", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_all_scenes_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a list of configured scenes + @validate_arguments + async def get_beolink_available_listeners( + self, **kwargs + ) -> List[BeolinkAvailableListener]: # noqa: E501 + """Get available listeners # noqa: E501 + + Get a list of devices that can be listening to this device active experience. # noqa: E501 + + :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: List[BeolinkAvailableListener] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_available_listeners_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_available_listeners_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_beolink_available_listeners_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get available listeners # noqa: E501 + Get a list of devices that can be listening to this device active experience. # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[BeolinkAvailableListener], status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_all_scenes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Scene]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _get_all_scenes_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_available_listeners" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/scenes", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "List[BeolinkAvailableListener]", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/beolink/available-listeners", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_available_sources( + @validate_arguments + async def get_beolink_join_result( self, - target_remote: Annotated[ - Optional[StrictBool], Field(description="filter sources for remote control") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SourceArray: - """Get all the available sources + id: Annotated[StrictStr, Field(..., description="Join request ID")], + **kwargs + ) -> BeolinkJoinResult: # noqa: E501 + """Get Beolink join result, test-endpoint # noqa: E501 + Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. # noqa: E501 - :param target_remote: filter sources for remote control - :type target_remote: bool + :param id: Join request ID (required) + :type id: str + :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: BeolinkJoinResult + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_join_result_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_join_result_with_http_info( + id, **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_beolink_join_result_with_http_info( + self, + id: Annotated[StrictStr, Field(..., description="Join request ID")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Get Beolink join result, test-endpoint # noqa: E501 + + Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. # noqa: E501 + + :param id: Join request ID (required) + :type id: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeolinkJoinResult, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_available_sources_serialize( - target_remote=target_remote, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "SourceArray", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_available_sources_with_http_info( - self, - target_remote: Annotated[ - Optional[StrictBool], Field(description="filter sources for remote control") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SourceArray]: - """Get all the available sources + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_join_result" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param target_remote: filter sources for remote control - :type target_remote: bool - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] - _param = self._get_available_sources_serialize( - target_remote=target_remote, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "SourceArray", - "400": "ErrorModel", + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BeolinkJoinResult", + "404": None, } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/beolink/join-result/{id}", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_available_sources_without_preload_content( - self, - target_remote: Annotated[ - Optional[StrictBool], Field(description="filter sources for remote control") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get all the available sources + @validate_arguments + async def get_beolink_listeners( + self, **kwargs + ) -> List[BeolinkListener]: # noqa: E501 + """Get joined peers # noqa: E501 + + Get a list of devices that are listening to this device active experience (that have joined). # noqa: E501 + + :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: List[BeolinkListener] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_listeners_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_listeners_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_beolink_listeners_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get joined peers # noqa: E501 + Get a list of devices that are listening to this device active experience (that have joined). # noqa: E501 - :param target_remote: filter sources for remote control - :type target_remote: bool + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[BeolinkListener], status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_available_sources_serialize( - target_remote=target_remote, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "SourceArray", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _get_available_sources_serialize( - self, - target_remote, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_listeners" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - # process the query parameters - if target_remote is not None: - - _query_params.append(("target-remote", target_remote)) + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/playback/sources", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "List[BeolinkListener]", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/beolink/listeners", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_battery_state( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BatteryState: - """Get battery state of the product + @validate_arguments + async def get_beolink_peers(self, **kwargs) -> List[BeolinkPeer]: # noqa: E501 + """Get discovered peers # noqa: E501 + + Get information about the Beolink peers discovered by this device. # noqa: E501 + + :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: List[BeolinkPeer] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_peers_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_peers_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_beolink_peers_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get discovered peers # noqa: E501 + Get information about the Beolink peers discovered by this device. # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[BeolinkPeer], status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_battery_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "BatteryState", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_battery_state_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BatteryState]: - """Get battery state of the product + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_peers" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._get_battery_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "BatteryState", + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "List[BeolinkPeer]", + "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/beolink/peers", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_battery_state_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get battery state of the product + @validate_arguments + async def get_beolink_self(self, **kwargs) -> BeolinkPeer: # noqa: E501 + """Get information about this device # noqa: E501 + + Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. # noqa: E501 + + :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: BeolinkPeer + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_beolink_self_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_beolink_self_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_beolink_self_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get information about this device # noqa: E501 + Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeolinkPeer, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_battery_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "BatteryState", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _get_battery_state_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_beolink_self" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/battery", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BeolinkPeer", + } + + return await self.api_client.call_api( + "/api/v1/beolink/self", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_available_listeners( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[BeolinkAvailableListener]: - """Get available listeners + @validate_arguments + async def get_bluetooth_devices_status( + self, **kwargs + ) -> BluetoothDeviceList: # noqa: E501 + """Get the bluetooth devices status # noqa: E501 + + + :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: BluetoothDeviceList + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_bluetooth_devices_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_bluetooth_devices_status_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_bluetooth_devices_status_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the bluetooth devices status # noqa: E501 - Get a list of devices that can be listening to this device active experience. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BluetoothDeviceList, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_available_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkAvailableListener]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_beolink_available_listeners_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[BeolinkAvailableListener]]: - """Get available listeners + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_bluetooth_devices_status" % _key + ) + _params[_key] = _val + del _params["kwargs"] - Get a list of devices that can be listening to this device active experience. + _collection_formats = {} - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._get_beolink_available_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkAvailableListener]", + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BluetoothDeviceList", "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/setup/bluetooth/devices", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_available_listeners_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get available listeners + @validate_arguments + async def get_bluetooth_remotes( + self, **kwargs + ) -> PairedRemoteResponse: # noqa: E501 + """Get a list of paired bluetooth remotes # noqa: E501 + + + :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: PairedRemoteResponse + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_bluetooth_remotes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_bluetooth_remotes_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_bluetooth_remotes_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get a list of paired bluetooth remotes # noqa: E501 - Get a list of devices that can be listening to this device active experience. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PairedRemoteResponse, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_available_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkAvailableListener]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _get_beolink_available_listeners_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_bluetooth_remotes" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/available-listeners", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "PairedRemoteResponse", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/setup/remotes", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_join_result( + @validate_arguments + async def get_content( self, - id: Annotated[StrictStr, Field(description="Join request ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + start_with: Annotated[ + Optional[StrictStr], + Field( + description='Filter result that start with x. It could be input source "tv", "netradio" or content "tv://TV", "tv://netflix"' + ), ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BeolinkJoinResult: - """Get Beolink join result, test-endpoint + **kwargs + ) -> Dict[str, ContentItem]: # noqa: E501 + """Get a list of available content # noqa: E501 - Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. - :param id: Join request ID (required) - :type id: str + :param start_with: Filter result that start with x. It could be input source \"tv\", \"netradio\" or content \"tv://TV\", \"tv://netflix\" + :type start_with: str + :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: Dict[str, ContentItem] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_content_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_content_with_http_info(start_with, **kwargs) # noqa: E501 + + @validate_arguments + async def get_content_with_http_info( + self, + start_with: Annotated[ + Optional[StrictStr], + Field( + description='Filter result that start with x. It could be input source "tv", "netradio" or content "tv://TV", "tv://netflix"' + ), + ] = None, + **kwargs + ) -> ApiResponse: # noqa: E501 + """Get a list of available content # noqa: E501 + + + :param start_with: Filter result that start with x. It could be input source \"tv\", \"netradio\" or content \"tv://TV\", \"tv://netflix\" + :type start_with: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, ContentItem], status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_join_result_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkJoinResult", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["start_with"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_beolink_join_result_with_http_info( - self, - id: Annotated[StrictStr, Field(description="Join request ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BeolinkJoinResult]: - """Get Beolink join result, test-endpoint + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_content" % _key + ) + _params[_key] = _val + del _params["kwargs"] - Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. + _collection_formats = {} - :param id: Join request ID (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._get_beolink_join_result_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + if _params.get("start_with") is not None: # noqa: E501 + _query_params.append(("startWith", _params["start_with"])) - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkJoinResult", - "404": None, + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, ContentItem]", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/content", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_join_result_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="Join request ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Beolink join result, test-endpoint + @validate_arguments + async def get_current_volume(self, **kwargs) -> VolumeState: # noqa: E501 + """Get the current volume state # noqa: E501 - Returns the result of a join request. **WARNING:** This end-point is only for testing purposes. Only a limited number of results are kept, so if there are multiple API clients using the device at the same time, and you are polling this end-point, you may miss the result of your join request. - :param id: Join request ID (required) - :type id: str + :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: VolumeState + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_current_volume_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_current_volume_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_current_volume_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current volume state # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VolumeState, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_join_result_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkJoinResult", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _get_beolink_join_result_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_current_volume" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/join-result/{id}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "VolumeState", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/sound/volume", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_listeners( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[BeolinkListener]: - """Get joined peers + @validate_arguments + async def get_listening_mode_set( + self, **kwargs + ) -> List[ListeningMode]: # noqa: E501 + """Get available listening modes that match the current role (standalone, multichannel or both(all)). # noqa: E501 + + + :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: List[ListeningMode] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_listening_mode_set_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_listening_mode_set_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_listening_mode_set_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get available listening modes that match the current role (standalone, multichannel or both(all)). # noqa: E501 - Get a list of devices that are listening to this device active experience (that have joined). + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[ListeningMode], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() - _param = self._get_beolink_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkListener]", - "400": "ErrorModel", + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_listening_mode_set" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "List[ListeningMode]", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/sound/listening-modes", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, - ).data + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) - @validate_call - async def get_beolink_listeners_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[BeolinkListener]]: - """Get joined peers + @validate_arguments + async def get_playback_state(self, **kwargs) -> PlaybackState: # noqa: E501 + """Get the current playback state # noqa: E501 - Get a list of devices that are listening to this device active experience (that have joined). + :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: PlaybackState + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_playback_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_playback_state_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_playback_state_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current playback state # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PlaybackState, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() - _param = self._get_beolink_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkListener]", + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_playback_state" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "PlaybackState", "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/playback/state", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_listeners_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get joined peers + @validate_arguments + async def get_power_state(self, **kwargs) -> PowerStateEnum: # noqa: E501 + """Get power state of the product # noqa: E501 + + + :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: PowerStateEnum + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_power_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_power_state_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_power_state_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get power state of the product # noqa: E501 - Get a list of devices that are listening to this device active experience (that have joined). + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PowerStateEnum, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_listeners_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkListener]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _get_beolink_listeners_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_power_state" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/listeners", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "PowerStateEnum", + } + + return await self.api_client.call_api( + "/api/v1/state/power", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_peers( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[BeolinkPeer]: - """Get discovered peers + @validate_arguments + async def get_presets(self, **kwargs) -> Dict[str, Preset]: # noqa: E501 + """Get the preset configuration # noqa: E501 + + + :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: Dict[str, Preset] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_presets_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_presets_with_http_info(**kwargs) # noqa: E501 - Get information about the Beolink peers discovered by this device. + @validate_arguments + async def get_presets_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 + """Get the preset configuration # noqa: E501 + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, Preset], status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_peers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkPeer]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_beolink_peers_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[BeolinkPeer]]: - """Get discovered peers + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_presets" % _key + ) + _params[_key] = _val + del _params["kwargs"] - Get information about the Beolink peers discovered by this device. + _collection_formats = {} - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._get_beolink_peers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkPeer]", - "400": "ErrorModel", + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, Preset]", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/setup/presets", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_peers_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get discovered peers + @validate_arguments + async def get_product_state(self, **kwargs) -> ProductState: # noqa: E501 + """Get the overall state from the product # noqa: E501 + + + :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: ProductState + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_product_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_product_state_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_product_state_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the overall state from the product # noqa: E501 - Get information about the Beolink peers discovered by this device. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ProductState, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_peers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[BeolinkPeer]", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _get_beolink_peers_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_product_state" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/peers", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "ProductState", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/state", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_self( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BeolinkPeer: - """Get information about this device + @validate_arguments + async def get_remote_home_control_uri( + self, **kwargs + ) -> HomeControlUri: # noqa: E501 + """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page # noqa: E501 + + + :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: HomeControlUri + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_remote_home_control_uri_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_remote_home_control_uri_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_remote_home_control_uri_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page # noqa: E501 - Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(HomeControlUri, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_self_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkPeer", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_beolink_self_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BeolinkPeer]: - """Get information about this device + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_remote_home_control_uri" % _key + ) + _params[_key] = _val + del _params["kwargs"] - Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. + _collection_formats = {} - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._get_beolink_self_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkPeer", + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "HomeControlUri", + "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/setup/remote/home-control-uri", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_beolink_self_without_preload_content( + @validate_arguments + async def get_remote_menu( + self, + descendants_to: Annotated[ + Optional[StrictStr], Field(description="Get all descendants to this item") + ] = None, + **kwargs + ) -> Dict[str, RemoteMenuItem]: # noqa: E501 + """Get all remote menu items # noqa: E501 + + + :param descendants_to: Get all descendants to this item + :type descendants_to: str + :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: Dict[str, RemoteMenuItem] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_remote_menu_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_remote_menu_with_http_info( + descendants_to, **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_remote_menu_with_http_info( self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + descendants_to: Annotated[ + Optional[StrictStr], Field(description="Get all descendants to this item") ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get information about this device + **kwargs + ) -> ApiResponse: # noqa: E501 + """Get all remote menu items # noqa: E501 - Returns Beolink information like about this device. This can be useful if you want to expand _to_ this device. + :param descendants_to: Get all descendants to this item + :type descendants_to: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, RemoteMenuItem], status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_beolink_self_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "BeolinkPeer", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["descendants_to"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _get_beolink_self_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_remote_menu" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] + if _params.get("descendants_to") is not None: # noqa: E501 + _query_params.append(("descendantsTo", _params["descendants_to"])) + # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/beolink/self", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, RemoteMenuItem]", + } + + return await self.api_client.call_api( + "/api/v1/remote", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_bluetooth_devices_status( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BluetoothDeviceList: - """Get the bluetooth devices status + @validate_arguments + async def get_settings_queue(self, **kwargs) -> PlayQueueSettings: # noqa: E501 + """Get the current queue settings # noqa: E501 + + + :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: PlayQueueSettings + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_settings_queue_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_settings_queue_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_settings_queue_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current queue settings # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PlayQueueSettings, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_bluetooth_devices_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "BluetoothDeviceList", + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_settings_queue" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "PlayQueueSettings", "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/playback/queue/settings", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, - ).data + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) - @validate_call - async def get_bluetooth_devices_status_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BluetoothDeviceList]: - """Get the bluetooth devices status + @validate_arguments + async def get_softwareupdate_status( + self, **kwargs + ) -> SoftwareUpdateStatus: # noqa: E501 + """Get the current software update status # noqa: E501 + + + :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: SoftwareUpdateStatus + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_softwareupdate_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_softwareupdate_status_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def get_softwareupdate_status_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current software update status # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(SoftwareUpdateStatus, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_bluetooth_devices_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "BluetoothDeviceList", + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_softwareupdate_status" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "SoftwareUpdateStatus", "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/softwareupdate", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_bluetooth_devices_status_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the bluetooth devices status + @validate_arguments + async def get_sound_features( + self, **kwargs + ) -> Dict[str, SoundFeatureSet]: # noqa: E501 + """Get available sound features that match the current role (standalone or multichannel). # noqa: E501 + + + :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: Dict[str, SoundFeatureSet] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_sound_features_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_sound_features_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_sound_features_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get available sound features that match the current role (standalone or multichannel). # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, SoundFeatureSet], status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_bluetooth_devices_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "BluetoothDeviceList", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _get_bluetooth_devices_status_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_sound_features" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/setup/bluetooth/devices", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, SoundFeatureSet]", + } + + return await self.api_client.call_api( + "/api/v1/sound/features", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_bluetooth_remotes( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PairedRemoteResponse: - """Get a list of paired bluetooth remotes + @validate_arguments + async def get_speakergroup_active( + self, **kwargs + ) -> SpeakerGroupOverview: # noqa: E501 + """Get the active speaker group # noqa: E501 + + + :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: SpeakerGroupOverview + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_speakergroup_active_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_speakergroup_active_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_speakergroup_active_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the active speaker group # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(SpeakerGroupOverview, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_bluetooth_remotes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "PairedRemoteResponse", - "400": "ErrorModel", + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_speakergroup_active" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "SpeakerGroupOverview", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/sound/speakergroup/active", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, - ).data + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) - @validate_call - async def get_bluetooth_remotes_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PairedRemoteResponse]: - """Get a list of paired bluetooth remotes + @validate_arguments + async def get_volume_settings(self, **kwargs) -> VolumeSettings: # noqa: E501 + """Get the current volume settings for default and maximum volume level # noqa: E501 + + + :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: VolumeSettings + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_volume_settings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_volume_settings_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_volume_settings_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current volume settings for default and maximum volume level # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VolumeSettings, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_bluetooth_remotes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "PairedRemoteResponse", + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_volume_settings" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "VolumeSettings", "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/sound/volume/settings", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_bluetooth_remotes_without_preload_content( + @validate_arguments + async def join_beolink_peer( + self, + jid: Annotated[StrictStr, Field(..., description="Jabber ID of peer to join")], + source: Annotated[ + Optional[StrictStr], + Field(description="Ask to join a specific source on peer"), + ] = None, + **kwargs + ) -> BeolinkJoinRequest: # noqa: E501 + """Join multi-room experience # noqa: E501 + + Join the experience currently active on peer with Jabber ID `{jid}`. # noqa: E501 + + :param jid: Jabber ID of peer to join (required) + :type jid: str + :param source: Ask to join a specific source on peer + :type source: str + :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: BeolinkJoinRequest + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the join_beolink_peer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.join_beolink_peer_with_http_info( + jid, source, **kwargs + ) # noqa: E501 + + @validate_arguments + async def join_beolink_peer_with_http_info( self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], + jid: Annotated[StrictStr, Field(..., description="Jabber ID of peer to join")], + source: Annotated[ + Optional[StrictStr], + Field(description="Ask to join a specific source on peer"), ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a list of paired bluetooth remotes + **kwargs + ) -> ApiResponse: # noqa: E501 + """Join multi-room experience # noqa: E501 + Join the experience currently active on peer with Jabber ID `{jid}`. # noqa: E501 + :param jid: Jabber ID of peer to join (required) + :type jid: str + :param source: Ask to join a specific source on peer + :type source: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeolinkJoinRequest, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_bluetooth_remotes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "PairedRemoteResponse", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["jid", "source"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _get_bluetooth_remotes_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method join_beolink_peer" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + if _params["jid"] is not None: + _path_params["jid"] = _params["jid"] + # process the query parameters + _query_params = [] + if _params.get("source") is not None: # noqa: E501 + _query_params.append(("source", _params["source"])) + # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/setup/remotes", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "202": "BeolinkJoinRequest", + "400": "ErrorModel", + "403": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/beolink/join/{jid}", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_content( - self, - start_with: Annotated[ - Optional[StrictStr], - Field( - description='Filter result that start with x. It could be input source "tv", "netradio" or content "tv://TV", "tv://netflix"' - ), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, ContentItem]: - """Get a list of available content + @validate_arguments + async def join_latest_beolink_experience( + self, **kwargs + ) -> BeolinkJoinRequest: # noqa: E501 + """Trigger touch to join # noqa: E501 + + + :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: BeolinkJoinRequest + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the join_latest_beolink_experience_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.join_latest_beolink_experience_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments + async def join_latest_beolink_experience_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger touch to join # noqa: E501 - :param start_with: Filter result that start with x. It could be input source \"tv\", \"netradio\" or content \"tv://TV\", \"tv://netflix\" - :type start_with: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BeolinkJoinRequest, status_code(int), headers(HTTPHeaderDict)) + """ - _param = self._get_content_serialize( - start_with=start_with, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, ContentItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_content_with_http_info( - self, - start_with: Annotated[ - Optional[StrictStr], - Field( - description='Filter result that start with x. It could be input source "tv", "netradio" or content "tv://TV", "tv://netflix"' - ), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, ContentItem]]: - """Get a list of available content - - - :param start_with: Filter result that start with x. It could be input source \"tv\", \"netradio\" or content \"tv://TV\", \"tv://netflix\" - :type start_with: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_content_serialize( - start_with=start_with, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, ContentItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_content_without_preload_content( - self, - start_with: Annotated[ - Optional[StrictStr], - Field( - description='Filter result that start with x. It could be input source "tv", "netradio" or content "tv://TV", "tv://netflix"' - ), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a list of available content - - - :param start_with: Filter result that start with x. It could be input source \"tv\", \"netradio\" or content \"tv://TV\", \"tv://netflix\" - :type start_with: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_content_serialize( - start_with=start_with, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, ContentItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_content_serialize( - self, - start_with, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if start_with is not None: - - _query_params.append(("startWith", start_with)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/content", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_current_volume( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeState: - """Get the current volume state - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_current_volume_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_current_volume_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumeState]: - """Get the current volume state - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_current_volume_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_current_volume_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current volume state - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_current_volume_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_current_volume_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/volume", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_listening_mode_set( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[ListeningMode]: - """Get available listening modes that match the current role (standalone, multichannel or both(all)). - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_listening_mode_set_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListeningMode]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_listening_mode_set_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[ListeningMode]]: - """Get available listening modes that match the current role (standalone, multichannel or both(all)). - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_listening_mode_set_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListeningMode]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_listening_mode_set_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get available listening modes that match the current role (standalone, multichannel or both(all)). - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_listening_mode_set_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListeningMode]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_listening_mode_set_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/listening-modes", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_playback_state( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaybackState: - """Get the current playback state - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_playback_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlaybackState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_playback_state_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaybackState]: - """Get the current playback state - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_playback_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlaybackState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_playback_state_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current playback state - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_playback_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlaybackState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_playback_state_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/playback/state", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_power_state( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PowerStateEnum: - """Get power state of the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_power_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PowerStateEnum", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_power_state_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PowerStateEnum]: - """Get power state of the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_power_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PowerStateEnum", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_power_state_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get power state of the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_power_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PowerStateEnum", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_power_state_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/state/power", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_presets( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, Preset]: - """Get the preset configuration - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_presets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Preset]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_presets_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, Preset]]: - """Get the preset configuration - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_presets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Preset]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_presets_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the preset configuration - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_presets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Preset]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_presets_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/setup/presets", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_product_state( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProductState: - """Get the overall state from the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_product_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ProductState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_product_state_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ProductState]: - """Get the overall state from the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_product_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ProductState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_product_state_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the overall state from the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_product_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ProductState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_product_state_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/state", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_remote_home_control_uri( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> HomeControlUri: - """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_home_control_uri_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "HomeControlUri", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_remote_home_control_uri_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[HomeControlUri]: - """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_home_control_uri_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "HomeControlUri", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_remote_home_control_uri_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_home_control_uri_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "HomeControlUri", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_remote_home_control_uri_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/setup/remote/home-control-uri", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_remote_menu( - self, - descendants_to: Annotated[ - Optional[StrictStr], Field(description="Get all descendants to this item") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, RemoteMenuItem]: - """Get all remote menu items - - - :param descendants_to: Get all descendants to this item - :type descendants_to: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_menu_serialize( - descendants_to=descendants_to, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, RemoteMenuItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_remote_menu_with_http_info( - self, - descendants_to: Annotated[ - Optional[StrictStr], Field(description="Get all descendants to this item") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, RemoteMenuItem]]: - """Get all remote menu items - - - :param descendants_to: Get all descendants to this item - :type descendants_to: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_menu_serialize( - descendants_to=descendants_to, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, RemoteMenuItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_remote_menu_without_preload_content( - self, - descendants_to: Annotated[ - Optional[StrictStr], Field(description="Get all descendants to this item") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get all remote menu items - - - :param descendants_to: Get all descendants to this item - :type descendants_to: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_menu_serialize( - descendants_to=descendants_to, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, RemoteMenuItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_remote_menu_serialize( - self, - descendants_to, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if descendants_to is not None: - - _query_params.append(("descendantsTo", descendants_to)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/remote", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_settings_queue( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlayQueueSettings: - """Get the current queue settings - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_settings_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlayQueueSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_settings_queue_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlayQueueSettings]: - """Get the current queue settings - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_settings_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlayQueueSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_settings_queue_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current queue settings - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_settings_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlayQueueSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_settings_queue_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/playback/queue/settings", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_softwareupdate_status( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SoftwareUpdateStatus: - """Get the current software update status - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_softwareupdate_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SoftwareUpdateStatus", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_softwareupdate_status_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SoftwareUpdateStatus]: - """Get the current software update status - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_softwareupdate_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SoftwareUpdateStatus", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_softwareupdate_status_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current software update status - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_softwareupdate_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SoftwareUpdateStatus", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_softwareupdate_status_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/softwareupdate", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_sound_features( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, SoundFeatureSet]: - """Get available sound features that match the current role (standalone or multichannel). - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_sound_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, SoundFeatureSet]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_sound_features_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, SoundFeatureSet]]: - """Get available sound features that match the current role (standalone or multichannel). - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_sound_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, SoundFeatureSet]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_sound_features_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get available sound features that match the current role (standalone or multichannel). - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_sound_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, SoundFeatureSet]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_sound_features_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/features", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_speakergroup_active( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SpeakerGroupOverview: - """Get the active speaker group - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_speakergroup_active_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SpeakerGroupOverview", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_speakergroup_active_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SpeakerGroupOverview]: - """Get the active speaker group - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_speakergroup_active_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SpeakerGroupOverview", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_speakergroup_active_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the active speaker group - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_speakergroup_active_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SpeakerGroupOverview", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_speakergroup_active_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/speakergroup/active", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_volume_settings( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeSettings: - """Get the current volume settings for default and maximum volume level - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_volume_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_volume_settings_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumeSettings]: - """Get the current volume settings for default and maximum volume level - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_volume_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_volume_settings_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current volume settings for default and maximum volume level - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_volume_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_volume_settings_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/volume/settings", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def join_beolink_peer( - self, - jid: Annotated[StrictStr, Field(description="Jabber ID of peer to join")], - source: Annotated[ - Optional[StrictStr], - Field(description="Ask to join a specific source on peer"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BeolinkJoinRequest: - """Join multi-room experience - - Join the experience currently active on peer with Jabber ID `{jid}`. - - :param jid: Jabber ID of peer to join (required) - :type jid: str - :param source: Ask to join a specific source on peer - :type source: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_beolink_peer_serialize( - jid=jid, - source=source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def join_beolink_peer_with_http_info( - self, - jid: Annotated[StrictStr, Field(description="Jabber ID of peer to join")], - source: Annotated[ - Optional[StrictStr], - Field(description="Ask to join a specific source on peer"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BeolinkJoinRequest]: - """Join multi-room experience - - Join the experience currently active on peer with Jabber ID `{jid}`. - - :param jid: Jabber ID of peer to join (required) - :type jid: str - :param source: Ask to join a specific source on peer - :type source: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_beolink_peer_serialize( - jid=jid, - source=source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def join_beolink_peer_without_preload_content( - self, - jid: Annotated[StrictStr, Field(description="Jabber ID of peer to join")], - source: Annotated[ - Optional[StrictStr], - Field(description="Ask to join a specific source on peer"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Join multi-room experience - - Join the experience currently active on peer with Jabber ID `{jid}`. - - :param jid: Jabber ID of peer to join (required) - :type jid: str - :param source: Ask to join a specific source on peer - :type source: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_beolink_peer_serialize( - jid=jid, - source=source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _join_beolink_peer_serialize( - self, - jid, - source, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if jid is not None: - _path_params["jid"] = jid - # process the query parameters - if source is not None: - - _query_params.append(("source", source)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/join/{jid}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def join_latest_beolink_experience( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BeolinkJoinRequest: - """Trigger touch to join - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_latest_beolink_experience_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def join_latest_beolink_experience_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BeolinkJoinRequest]: - """Trigger touch to join - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_latest_beolink_experience_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def join_latest_beolink_experience_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger touch to join - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._join_latest_beolink_experience_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": "BeolinkJoinRequest", - "400": "ErrorModel", - "403": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _join_latest_beolink_experience_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/join", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_beolink_allstandby( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Broadcast an all standby event to turn all Beolink devices off - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_allstandby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_beolink_allstandby_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Broadcast an all standby event to turn all Beolink devices off - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_allstandby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_beolink_allstandby_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Broadcast an all standby event to turn all Beolink devices off - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_allstandby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_beolink_allstandby_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/allstandby", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_beolink_expand( - self, - jid: Annotated[ - StrictStr, - Field(description="Jabber id of peer to expand the active experience to"), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Expand the current active experience - - Expand the current active experience to another device with jabber id `{jid}`. - - :param jid: Jabber id of peer to expand the active experience to (required) - :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_expand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "403": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_beolink_expand_with_http_info( - self, - jid: Annotated[ - StrictStr, - Field(description="Jabber id of peer to expand the active experience to"), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Expand the current active experience - - Expand the current active experience to another device with jabber id `{jid}`. - - :param jid: Jabber id of peer to expand the active experience to (required) - :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_expand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "403": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_beolink_expand_without_preload_content( - self, - jid: Annotated[ - StrictStr, - Field(description="Jabber id of peer to expand the active experience to"), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Expand the current active experience - - Expand the current active experience to another device with jabber id `{jid}`. - - :param jid: Jabber id of peer to expand the active experience to (required) - :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_expand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "403": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_beolink_expand_serialize( - self, - jid, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if jid is not None: - _path_params["jid"] = jid - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/expand/{jid}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_beolink_leave( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Leave the ongoing experience (disconnect this device from remote) - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_leave_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_beolink_leave_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Leave the ongoing experience (disconnect this device from remote) - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_leave_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_beolink_leave_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Leave the ongoing experience (disconnect this device from remote) - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_leave_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_beolink_leave_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/leave", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_beolink_unexpand( - self, - jid: Annotated[StrictStr, Field(description="Jabber id of peer to unexpand")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Unexpand (disconnect) a device from the multiroom session - - Disconnect the device with jabber id `{jid}` from the current active experience. - - :param jid: Jabber id of peer to unexpand (required) - :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_unexpand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_beolink_unexpand_with_http_info( - self, - jid: Annotated[StrictStr, Field(description="Jabber id of peer to unexpand")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Unexpand (disconnect) a device from the multiroom session - - Disconnect the device with jabber id `{jid}` from the current active experience. - - :param jid: Jabber id of peer to unexpand (required) - :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_unexpand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_beolink_unexpand_without_preload_content( - self, - jid: Annotated[StrictStr, Field(description="Jabber id of peer to unexpand")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Unexpand (disconnect) a device from the multiroom session - - Disconnect the device with jabber id `{jid}` from the current active experience. - - :param jid: Jabber id of peer to unexpand (required) - :type jid: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_beolink_unexpand_serialize( - jid=jid, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_beolink_unexpand_serialize( - self, - jid, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if jid is not None: - _path_params["jid"] = jid - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/beolink/unexpand/{jid}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_clear_queue( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Clear the queue - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_clear_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_clear_queue_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Clear the queue - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_clear_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_clear_queue_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Clear the queue - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_clear_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_clear_queue_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/queue/clear", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_overlay_play( - self, - overlay_play_request: Annotated[ - OverlayPlayRequest, Field(description="settings to use for the overlay") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Play overlay - - Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. - - :param overlay_play_request: settings to use for the overlay (required) - :type overlay_play_request: OverlayPlayRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_overlay_play_serialize( - overlay_play_request=overlay_play_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_overlay_play_with_http_info( - self, - overlay_play_request: Annotated[ - OverlayPlayRequest, Field(description="settings to use for the overlay") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Play overlay - - Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. - - :param overlay_play_request: settings to use for the overlay (required) - :type overlay_play_request: OverlayPlayRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_overlay_play_serialize( - overlay_play_request=overlay_play_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_overlay_play_without_preload_content( - self, - overlay_play_request: Annotated[ - OverlayPlayRequest, Field(description="settings to use for the overlay") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Play overlay - - Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. - - :param overlay_play_request: settings to use for the overlay (required) - :type overlay_play_request: OverlayPlayRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_overlay_play_serialize( - overlay_play_request=overlay_play_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_overlay_play_serialize( - self, - overlay_play_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if overlay_play_request is not None: - _body_params = overlay_play_request - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/overlay/play", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_playback_command( - self, - command: Annotated[ - StrictStr, Field(description="the named command to execute") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Send a specific playback command to the product - - - :param command: the named command to execute (required) - :type command: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_playback_command_serialize( - command=command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_playback_command_with_http_info( - self, - command: Annotated[ - StrictStr, Field(description="the named command to execute") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Send a specific playback command to the product - - - :param command: the named command to execute (required) - :type command: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_playback_command_serialize( - command=command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_playback_command_without_preload_content( - self, - command: Annotated[ - StrictStr, Field(description="the named command to execute") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Send a specific playback command to the product - - - :param command: the named command to execute (required) - :type command: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_playback_command_serialize( - command=command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_playback_command_serialize( - self, - command, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if command is not None: - _path_params["command"] = command - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/command/{command}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_remote_home_control_ixp( - self, - home_control_ixp: Annotated[HomeControlIxp, Field(description="The new IXP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Change any active Immersive Experience (IXP) - - - :param home_control_ixp: The new IXP (required) - :type home_control_ixp: HomeControlIxp - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_home_control_ixp_serialize( - home_control_ixp=home_control_ixp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_remote_home_control_ixp_with_http_info( - self, - home_control_ixp: Annotated[HomeControlIxp, Field(description="The new IXP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Change any active Immersive Experience (IXP) - - - :param home_control_ixp: The new IXP (required) - :type home_control_ixp: HomeControlIxp - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_home_control_ixp_serialize( - home_control_ixp=home_control_ixp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_remote_home_control_ixp_without_preload_content( - self, - home_control_ixp: Annotated[HomeControlIxp, Field(description="The new IXP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Change any active Immersive Experience (IXP) - - - :param home_control_ixp: The new IXP (required) - :type home_control_ixp: HomeControlIxp - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_home_control_ixp_serialize( - home_control_ixp=home_control_ixp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_remote_home_control_ixp_serialize( - self, - home_control_ixp, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if home_control_ixp is not None: - _body_params = home_control_ixp - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/setup/remote/home-control-ixp", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_remote_key_trigger( - self, - id: Annotated[StrictStr, Field(description="Key identifier")], - remote_ui_key_state: RemoteUIKeyState, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Remote input key press - - - :param id: Key identifier (required) - :type id: str - :param remote_ui_key_state: (required) - :type remote_ui_key_state: RemoteUIKeyState - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_key_trigger_serialize( - id=id, - remote_ui_key_state=remote_ui_key_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_remote_key_trigger_with_http_info( - self, - id: Annotated[StrictStr, Field(description="Key identifier")], - remote_ui_key_state: RemoteUIKeyState, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Remote input key press - - - :param id: Key identifier (required) - :type id: str - :param remote_ui_key_state: (required) - :type remote_ui_key_state: RemoteUIKeyState - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_key_trigger_serialize( - id=id, - remote_ui_key_state=remote_ui_key_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_remote_key_trigger_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="Key identifier")], - remote_ui_key_state: RemoteUIKeyState, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Remote input key press - - - :param id: Key identifier (required) - :type id: str - :param remote_ui_key_state: (required) - :type remote_ui_key_state: RemoteUIKeyState - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_key_trigger_serialize( - id=id, - remote_ui_key_state=remote_ui_key_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_remote_key_trigger_serialize( - self, - id, - remote_ui_key_state, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if id is not None: - _path_params["id"] = id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if remote_ui_key_state is not None: - _body_params = remote_ui_key_state - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/remote/key/{id}/trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_remote_trigger( - self, - id: Annotated[StrictStr, Field(description="Remote menu item ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Trigger a remote menu item - - - :param id: Remote menu item ID (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_remote_trigger_with_http_info( - self, - id: Annotated[StrictStr, Field(description="Remote menu item ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Trigger a remote menu item - - - :param id: Remote menu item ID (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_remote_trigger_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="Remote menu item ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger a remote menu item - - - :param id: Remote menu item ID (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_remote_trigger_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if id is not None: - _path_params["id"] = id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/remote/{id}/trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_scene_match_trigger( - self, - scene_match: SceneMatch, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Trigger the first scene with same non null objects provided in the SceneMatch object - - - :param scene_match: (required) - :type scene_match: SceneMatch - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_match_trigger_serialize( - scene_match=scene_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_scene_match_trigger_with_http_info( - self, - scene_match: SceneMatch, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Trigger the first scene with same non null objects provided in the SceneMatch object - - - :param scene_match: (required) - :type scene_match: SceneMatch - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_match_trigger_serialize( - scene_match=scene_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_scene_match_trigger_without_preload_content( - self, - scene_match: SceneMatch, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger the first scene with same non null objects provided in the SceneMatch object - - - :param scene_match: (required) - :type scene_match: SceneMatch - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_match_trigger_serialize( - scene_match=scene_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_scene_match_trigger_serialize( - self, - scene_match, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if scene_match is not None: - _body_params = scene_match - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/scene/match-trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_scene_trigger( - self, - id: Annotated[StrictStr, Field(description="ID of the scene")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Trigger a specific scene - - - :param id: ID of the scene (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_scene_trigger_with_http_info( - self, - id: Annotated[StrictStr, Field(description="ID of the scene")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Trigger a specific scene - - - :param id: ID of the scene (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_scene_trigger_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="ID of the scene")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger a specific scene - - - :param id: ID of the scene (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_scene_trigger_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method join_latest_beolink_experience" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/scene/{id}/trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "202": "BeolinkJoinRequest", + "400": "ErrorModel", + "403": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/beolink/join", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_standby( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Put the device in standby - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_standby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _request_auth=_params.get("_request_auth"), ) - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + @validate_arguments + async def post_beolink_allstandby(self, **kwargs) -> None: # noqa: E501 + """Broadcast an all standby event to turn all Beolink devices off # noqa: E501 - @validate_call - async def post_standby_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Put the device in standby - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_standby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_beolink_allstandby_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_beolink_allstandby_with_http_info(**kwargs) # noqa: E501 - @validate_call - async def post_standby_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Put the device in standby + @validate_arguments + async def post_beolink_allstandby_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Broadcast an all standby event to turn all Beolink devices off # noqa: E501 + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._post_standby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _post_standby_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_beolink_allstandby" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/state/standby", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/beolink/allstandby", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_uri_source( - self, - uri: Annotated[ - Uri, Field(description="the desired uri from which to stream data") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the URI from which sound is streamed - - - :param uri: the desired uri from which to stream data (required) - :type uri: Uri - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_uri_source_serialize( - uri=uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _request_auth=_params.get("_request_auth"), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def post_uri_source_with_http_info( + @validate_arguments + async def post_beolink_expand( self, - uri: Annotated[ - Uri, Field(description="the desired uri from which to stream data") + jid: Annotated[ + StrictStr, + Field( + ..., description="Jabber id of peer to expand the active experience to" + ), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the URI from which sound is streamed - - - :param uri: the desired uri from which to stream data (required) - :type uri: Uri - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_uri_source_serialize( - uri=uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + **kwargs + ) -> None: # noqa: E501 + """Expand the current active experience # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) + Expand the current active experience to another device with jabber id `{jid}`. # noqa: E501 - @validate_call - async def post_uri_source_without_preload_content( + :param jid: Jabber id of peer to expand the active experience to (required) + :type jid: str + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_beolink_expand_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_beolink_expand_with_http_info( + jid, **kwargs + ) # noqa: E501 + + @validate_arguments + async def post_beolink_expand_with_http_info( self, - uri: Annotated[ - Uri, Field(description="the desired uri from which to stream data") + jid: Annotated[ + StrictStr, + Field( + ..., description="Jabber id of peer to expand the active experience to" + ), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the URI from which sound is streamed + **kwargs + ) -> ApiResponse: # noqa: E501 + """Expand the current active experience # noqa: E501 + Expand the current active experience to another device with jabber id `{jid}`. # noqa: E501 - :param uri: the desired uri from which to stream data (required) - :type uri: Uri + :param jid: Jabber id of peer to expand the active experience to (required) + :type jid: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._post_uri_source_serialize( - uri=uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["jid"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _post_uri_source_serialize( - self, - uri, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_beolink_expand" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + if _params["jid"] is not None: + _path_params["jid"] = _params["jid"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if uri is not None: - _body_params = uri - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/uri", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/beolink/expand/{jid}", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def run_provided_scene( - self, - scene_properties: Annotated[ - SceneProperties, Field(description="The scene you want to run") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Run provided scene + @validate_arguments + async def post_beolink_leave(self, **kwargs) -> None: # noqa: E501 + """Leave the ongoing experience (disconnect this device from remote) # noqa: E501 - :param scene_properties: The scene you want to run (required) - :type scene_properties: SceneProperties + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_beolink_leave_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_beolink_leave_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def post_beolink_leave_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Leave the ongoing experience (disconnect this device from remote) # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._run_provided_scene_serialize( - scene_properties=scene_properties, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def run_provided_scene_with_http_info( - self, - scene_properties: Annotated[ - SceneProperties, Field(description="The scene you want to run") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Run provided scene + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_beolink_leave" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param scene_properties: The scene you want to run (required) - :type scene_properties: SceneProperties - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._run_provided_scene_serialize( - scene_properties=scene_properties, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/beolink/leave", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def run_provided_scene_without_preload_content( + @validate_arguments + async def post_beolink_unexpand( self, - scene_properties: Annotated[ - SceneProperties, Field(description="The scene you want to run") + jid: Annotated[ + StrictStr, Field(..., description="Jabber id of peer to unexpand") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Run provided scene + **kwargs + ) -> None: # noqa: E501 + """Unexpand (disconnect) a device from the multiroom session # noqa: E501 + Disconnect the device with jabber id `{jid}` from the current active experience. # noqa: E501 - :param scene_properties: The scene you want to run (required) - :type scene_properties: SceneProperties + :param jid: Jabber id of peer to unexpand (required) + :type jid: str + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_beolink_unexpand_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_beolink_unexpand_with_http_info( + jid, **kwargs + ) # noqa: E501 + + @validate_arguments + async def post_beolink_unexpand_with_http_info( + self, + jid: Annotated[ + StrictStr, Field(..., description="Jabber id of peer to unexpand") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Unexpand (disconnect) a device from the multiroom session # noqa: E501 + + Disconnect the device with jabber id `{jid}` from the current active experience. # noqa: E501 + + :param jid: Jabber id of peer to unexpand (required) + :type jid: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._run_provided_scene_serialize( - scene_properties=scene_properties, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["jid"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _run_provided_scene_serialize( - self, - scene_properties, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_beolink_unexpand" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + if _params["jid"] is not None: + _path_params["jid"] = _params["jid"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if scene_properties is not None: - _body_params = scene_properties - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/scene/run", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/beolink/unexpand/{jid}", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def seek_to_position( - self, - position_ms: Annotated[ - StrictInt, Field(description="position in milliseconds") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Seek to position in stream + @validate_arguments + async def post_clear_queue(self, **kwargs) -> None: # noqa: E501 + """Clear the queue # noqa: E501 - :param position_ms: position in milliseconds (required) - :type position_ms: int + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_clear_queue_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_clear_queue_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def post_clear_queue_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Clear the queue # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._seek_to_position_serialize( - position_ms=position_ms, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def seek_to_position_with_http_info( - self, - position_ms: Annotated[ - StrictInt, Field(description="position in milliseconds") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Seek to position in stream + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_clear_queue" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param position_ms: position in milliseconds (required) - :type position_ms: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 - _param = self._seek_to_position_serialize( - position_ms=position_ms, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _response_types_map = {} - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + return await self.api_client.call_api( + "/api/v1/playback/queue/clear", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def seek_to_position_without_preload_content( + @validate_arguments + async def post_overlay_play( self, - position_ms: Annotated[ - StrictInt, Field(description="position in milliseconds") + overlay_play_request: Annotated[ + OverlayPlayRequest, + Field(..., description="settings to use for the overlay"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Seek to position in stream + **kwargs + ) -> None: # noqa: E501 + """Play overlay # noqa: E501 + Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. # noqa: E501 - :param position_ms: position in milliseconds (required) - :type position_ms: int + :param overlay_play_request: settings to use for the overlay (required) + :type overlay_play_request: OverlayPlayRequest + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_overlay_play_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_overlay_play_with_http_info( + overlay_play_request, **kwargs + ) # noqa: E501 + + @validate_arguments + async def post_overlay_play_with_http_info( + self, + overlay_play_request: Annotated[ + OverlayPlayRequest, + Field(..., description="settings to use for the overlay"), + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Play overlay # noqa: E501 + + Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. # noqa: E501 + + :param overlay_play_request: settings to use for the overlay (required) + :type overlay_play_request: OverlayPlayRequest + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._seek_to_position_serialize( - position_ms=position_ms, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["overlay_play_request"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _seek_to_position_serialize( - self, - position_ms, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_overlay_play" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - # process the query parameters - if position_ms is not None: - - _query_params.append(("position_ms", position_ms)) + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter + _body_params = None + if _params["overlay_play_request"] is not None: + _body_params = _params["overlay_play_request"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/playback/seek", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/overlay/play", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_active_source( + @validate_arguments + async def post_playback_command( self, - source_id: Annotated[ - StrictStr, Field(description="the id of the source to activate") + command: Annotated[ + StrictStr, Field(..., description="the named command to execute") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the active source + **kwargs + ) -> None: # noqa: E501 + """Send a specific playback command to the product # noqa: E501 - :param source_id: the id of the source to activate (required) - :type source_id: str + :param command: the named command to execute (required) + :type command: str + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_playback_command_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_playback_command_with_http_info( + command, **kwargs + ) # noqa: E501 + + @validate_arguments + async def post_playback_command_with_http_info( + self, + command: Annotated[ + StrictStr, Field(..., description="the named command to execute") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Send a specific playback command to the product # noqa: E501 + + + :param command: the named command to execute (required) + :type command: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_active_source_serialize( - source_id=source_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["command"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_active_source_with_http_info( - self, - source_id: Annotated[ - StrictStr, Field(description="the id of the source to activate") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the active source + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_playback_command" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param source_id: the id of the source to activate (required) - :type source_id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} + if _params["command"] is not None: + _path_params["command"] = _params["command"] - _param = self._set_active_source_serialize( - source_id=source_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/command/{command}", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_active_source_without_preload_content( + @validate_arguments + async def post_remote_home_control_ixp( self, - source_id: Annotated[ - StrictStr, Field(description="the id of the source to activate") + home_control_ixp: Annotated[ + HomeControlIxp, Field(..., description="The new IXP") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the active source + **kwargs + ) -> None: # noqa: E501 + """Change any active Immersive Experience (IXP) # noqa: E501 - :param source_id: the id of the source to activate (required) - :type source_id: str + :param home_control_ixp: The new IXP (required) + :type home_control_ixp: HomeControlIxp + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_remote_home_control_ixp_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_remote_home_control_ixp_with_http_info( + home_control_ixp, **kwargs + ) # noqa: E501 + + @validate_arguments + async def post_remote_home_control_ixp_with_http_info( + self, + home_control_ixp: Annotated[ + HomeControlIxp, Field(..., description="The new IXP") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Change any active Immersive Experience (IXP) # noqa: E501 + + + :param home_control_ixp: The new IXP (required) + :type home_control_ixp: HomeControlIxp + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_active_source_serialize( - source_id=source_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["home_control_ixp"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_active_source_serialize( - self, - source_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_remote_home_control_ixp" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - if source_id is not None: - _path_params["sourceId"] = source_id + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter + _body_params = None + if _params["home_control_ixp"] is not None: + _body_params = _params["home_control_ixp"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/sources/active/{sourceId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/setup/remote/home-control-ixp", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_current_volume_level( + @validate_arguments + async def post_remote_key_trigger( self, - volume_level: Annotated[ - VolumeLevel, Field(description="The volume level to apply") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the current volume level + id: Annotated[StrictStr, Field(..., description="Key identifier")], + remote_ui_key_state: RemoteUIKeyState, + **kwargs + ) -> None: # noqa: E501 + """Remote input key press # noqa: E501 - :param volume_level: The volume level to apply (required) - :type volume_level: VolumeLevel + :param id: Key identifier (required) + :type id: str + :param remote_ui_key_state: (required) + :type remote_ui_key_state: RemoteUIKeyState + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_remote_key_trigger_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_remote_key_trigger_with_http_info( + id, remote_ui_key_state, **kwargs + ) # noqa: E501 + + @validate_arguments + async def post_remote_key_trigger_with_http_info( + self, + id: Annotated[StrictStr, Field(..., description="Key identifier")], + remote_ui_key_state: RemoteUIKeyState, + **kwargs + ) -> ApiResponse: # noqa: E501 + """Remote input key press # noqa: E501 + + + :param id: Key identifier (required) + :type id: str + :param remote_ui_key_state: (required) + :type remote_ui_key_state: RemoteUIKeyState + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_current_volume_level_serialize( - volume_level=volume_level, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["id", "remote_ui_key_state"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_current_volume_level_with_http_info( - self, - volume_level: Annotated[ - VolumeLevel, Field(description="The volume level to apply") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the current volume level + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_remote_key_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param volume_level: The volume level to apply (required) - :type volume_level: VolumeLevel - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] - _param = self._set_current_volume_level_serialize( - volume_level=volume_level, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params["remote_ui_key_state"] is not None: + _body_params = _params["remote_ui_key_state"] - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/remote/key/{id}/trigger", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_current_volume_level_without_preload_content( + @validate_arguments + async def post_remote_trigger( self, - volume_level: Annotated[ - VolumeLevel, Field(description="The volume level to apply") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the current volume level + id: Annotated[StrictStr, Field(..., description="Remote menu item ID")], + **kwargs + ) -> None: # noqa: E501 + """Trigger a remote menu item # noqa: E501 - :param volume_level: The volume level to apply (required) - :type volume_level: VolumeLevel + :param id: Remote menu item ID (required) + :type id: str + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_remote_trigger_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_remote_trigger_with_http_info(id, **kwargs) # noqa: E501 + + @validate_arguments + async def post_remote_trigger_with_http_info( + self, + id: Annotated[StrictStr, Field(..., description="Remote menu item ID")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger a remote menu item # noqa: E501 + + + :param id: Remote menu item ID (required) + :type id: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_current_volume_level_serialize( - volume_level=volume_level, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_current_volume_level_serialize( - self, - volume_level, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_remote_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if volume_level is not None: - _body_params = volume_level - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/volume/level", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/remote/{id}/trigger", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_product_friendly_name( - self, - product_friendly_name: Annotated[ - ProductFriendlyName, Field(description="the friendly name for the product") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the friendly name + @validate_arguments + async def post_scene_match_trigger( + self, scene_match: SceneMatch, **kwargs + ) -> None: # noqa: E501 + """Trigger the first scene with same non null objects provided in the SceneMatch object # noqa: E501 - :param product_friendly_name: the friendly name for the product (required) - :type product_friendly_name: ProductFriendlyName + :param scene_match: (required) + :type scene_match: SceneMatch + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_scene_match_trigger_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_scene_match_trigger_with_http_info( + scene_match, **kwargs + ) # noqa: E501 + + @validate_arguments + async def post_scene_match_trigger_with_http_info( + self, scene_match: SceneMatch, **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger the first scene with same non null objects provided in the SceneMatch object # noqa: E501 + + + :param scene_match: (required) + :type scene_match: SceneMatch + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_product_friendly_name_serialize( - product_friendly_name=product_friendly_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["scene_match"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_product_friendly_name_with_http_info( - self, - product_friendly_name: Annotated[ - ProductFriendlyName, Field(description="the friendly name for the product") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the friendly name + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_scene_match_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param product_friendly_name: the friendly name for the product (required) - :type product_friendly_name: ProductFriendlyName - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params["scene_match"] is not None: + _body_params = _params["scene_match"] - _param = self._set_product_friendly_name_serialize( - product_friendly_name=product_friendly_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + return await self.api_client.call_api( + "/api/v1/scene/match-trigger", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_product_friendly_name_without_preload_content( + @validate_arguments + async def post_scene_trigger( self, - product_friendly_name: Annotated[ - ProductFriendlyName, Field(description="the friendly name for the product") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the friendly name + id: Annotated[StrictStr, Field(..., description="ID of the scene")], + **kwargs + ) -> None: # noqa: E501 + """Trigger a specific scene # noqa: E501 - :param product_friendly_name: the friendly name for the product (required) - :type product_friendly_name: ProductFriendlyName + :param id: ID of the scene (required) + :type id: str + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_scene_trigger_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_scene_trigger_with_http_info(id, **kwargs) # noqa: E501 + + @validate_arguments + async def post_scene_trigger_with_http_info( + self, + id: Annotated[StrictStr, Field(..., description="ID of the scene")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger a specific scene # noqa: E501 + + + :param id: ID of the scene (required) + :type id: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_product_friendly_name_serialize( - product_friendly_name=product_friendly_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_product_friendly_name_serialize( - self, - product_friendly_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_scene_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if product_friendly_name is not None: - _body_params = product_friendly_name - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/product/info/friendlyname", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/scene/{id}/trigger", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_remote_home_control_uri( - self, - home_control_uri: Annotated[ - HomeControlUri, - Field( - description="The new uri for HomeControl dashboard and IXP start page" - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page + @validate_arguments + async def post_standby(self, **kwargs) -> None: # noqa: E501 + """Put the device in standby # noqa: E501 - :param home_control_uri: The new uri for HomeControl dashboard and IXP start page (required) - :type home_control_uri: HomeControlUri + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_standby_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_standby_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def post_standby_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 + """Put the device in standby # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_remote_home_control_uri_serialize( - home_control_uri=home_control_uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_remote_home_control_uri_with_http_info( - self, - home_control_uri: Annotated[ - HomeControlUri, - Field( - description="The new uri for HomeControl dashboard and IXP start page" - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_standby" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param home_control_uri: The new uri for HomeControl dashboard and IXP start page (required) - :type home_control_uri: HomeControlUri - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._set_remote_home_control_uri_serialize( - home_control_uri=home_control_uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/state/standby", + "PUT", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_remote_home_control_uri_without_preload_content( + @validate_arguments + async def post_uri_source( self, - home_control_uri: Annotated[ - HomeControlUri, - Field( - description="The new uri for HomeControl dashboard and IXP start page" - ), + uri: Annotated[ + Uri, Field(..., description="the desired uri from which to stream data") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page + **kwargs + ) -> None: # noqa: E501 + """Set the URI from which sound is streamed # noqa: E501 - :param home_control_uri: The new uri for HomeControl dashboard and IXP start page (required) - :type home_control_uri: HomeControlUri + :param uri: the desired uri from which to stream data (required) + :type uri: Uri + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_uri_source_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_uri_source_with_http_info(uri, **kwargs) # noqa: E501 + + @validate_arguments + async def post_uri_source_with_http_info( + self, + uri: Annotated[ + Uri, Field(..., description="the desired uri from which to stream data") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the URI from which sound is streamed # noqa: E501 + + + :param uri: the desired uri from which to stream data (required) + :type uri: Uri + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_remote_home_control_uri_serialize( - home_control_uri=home_control_uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["uri"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_remote_home_control_uri_serialize( - self, - home_control_uri, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_uri_source" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if home_control_uri is not None: - _body_params = home_control_uri + _body_params = None + if _params["uri"] is not None: + _body_params = _params["uri"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/setup/remote/home-control-uri", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/uri", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_settings_queue( + @validate_arguments + async def run_provided_scene( self, - play_queue_settings: Annotated[ - PlayQueueSettings, Field(description="the desired settings") + scene_properties: Annotated[ + SceneProperties, Field(..., description="The scene you want to run") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set queue settings + **kwargs + ) -> None: # noqa: E501 + """Run provided scene # noqa: E501 - :param play_queue_settings: the desired settings (required) - :type play_queue_settings: PlayQueueSettings + :param scene_properties: The scene you want to run (required) + :type scene_properties: SceneProperties + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the run_provided_scene_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.run_provided_scene_with_http_info( + scene_properties, **kwargs + ) # noqa: E501 + + @validate_arguments + async def run_provided_scene_with_http_info( + self, + scene_properties: Annotated[ + SceneProperties, Field(..., description="The scene you want to run") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Run provided scene # noqa: E501 + + + :param scene_properties: The scene you want to run (required) + :type scene_properties: SceneProperties + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_settings_queue_serialize( - play_queue_settings=play_queue_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["scene_properties"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_settings_queue_with_http_info( - self, - play_queue_settings: Annotated[ - PlayQueueSettings, Field(description="the desired settings") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set queue settings + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method run_provided_scene" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param play_queue_settings: the desired settings (required) - :type play_queue_settings: PlayQueueSettings - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._set_settings_queue_serialize( - play_queue_settings=play_queue_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params["scene_properties"] is not None: + _body_params = _params["scene_properties"] - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/scene/run", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_settings_queue_without_preload_content( + @validate_arguments + async def seek_to_position( + self, + position_ms: Annotated[ + StrictInt, Field(..., description="position in milliseconds") + ], + **kwargs + ) -> None: # noqa: E501 + """Seek to position in stream # noqa: E501 + + + :param position_ms: position in milliseconds (required) + :type position_ms: int + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the seek_to_position_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.seek_to_position_with_http_info( + position_ms, **kwargs + ) # noqa: E501 + + @validate_arguments + async def seek_to_position_with_http_info( self, - play_queue_settings: Annotated[ - PlayQueueSettings, Field(description="the desired settings") + position_ms: Annotated[ + StrictInt, Field(..., description="position in milliseconds") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set queue settings + **kwargs + ) -> ApiResponse: # noqa: E501 + """Seek to position in stream # noqa: E501 - :param play_queue_settings: the desired settings (required) - :type play_queue_settings: PlayQueueSettings + :param position_ms: position in milliseconds (required) + :type position_ms: int + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_settings_queue_serialize( - play_queue_settings=play_queue_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["position_ms"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_settings_queue_serialize( - self, - play_queue_settings, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method seek_to_position" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] + if _params.get("position_ms") is not None: # noqa: E501 + _query_params.append(("position_ms", _params["position_ms"])) + # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if play_queue_settings is not None: - _body_params = play_queue_settings - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/playback/queue/settings", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/seek", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_sound_settings_adjustments_bass( + @validate_arguments + async def set_active_source( self, - bass: Annotated[Bass, Field(description="the bass level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the sound settings adjustments for bass + source_id: Annotated[ + StrictStr, Field(..., description="the id of the source to activate") + ], + **kwargs + ) -> None: # noqa: E501 + """Set the active source # noqa: E501 - :param bass: the bass level (required) - :type bass: Bass + :param source_id: the id of the source to activate (required) + :type source_id: str + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_active_source_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_active_source_with_http_info( + source_id, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_active_source_with_http_info( + self, + source_id: Annotated[ + StrictStr, Field(..., description="the id of the source to activate") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the active source # noqa: E501 + + + :param source_id: the id of the source to activate (required) + :type source_id: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_sound_settings_adjustments_bass_serialize( - bass=bass, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["source_id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_sound_settings_adjustments_bass_with_http_info( - self, - bass: Annotated[Bass, Field(description="the bass level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update the sound settings adjustments for bass + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_active_source" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param bass: the bass level (required) - :type bass: Bass - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} + if _params["source_id"] is not None: + _path_params["sourceId"] = _params["source_id"] - _param = self._set_sound_settings_adjustments_bass_serialize( - bass=bass, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/sources/active/{sourceId}", + "POST", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_sound_settings_adjustments_bass_without_preload_content( + @validate_arguments + async def set_current_volume_level( self, - bass: Annotated[Bass, Field(description="the bass level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the sound settings adjustments for bass + volume_level: Annotated[ + VolumeLevel, Field(..., description="The volume level to apply") + ], + **kwargs + ) -> None: # noqa: E501 + """Set the current volume level # noqa: E501 - :param bass: the bass level (required) - :type bass: Bass + :param volume_level: The volume level to apply (required) + :type volume_level: VolumeLevel + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_current_volume_level_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_current_volume_level_with_http_info( + volume_level, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_current_volume_level_with_http_info( + self, + volume_level: Annotated[ + VolumeLevel, Field(..., description="The volume level to apply") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the current volume level # noqa: E501 + + + :param volume_level: The volume level to apply (required) + :type volume_level: VolumeLevel + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_sound_settings_adjustments_bass_serialize( - bass=bass, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["volume_level"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_sound_settings_adjustments_bass_serialize( - self, - bass, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_current_volume_level" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if bass is not None: - _body_params = bass + _body_params = None + if _params["volume_level"] is not None: + _body_params = _params["volume_level"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/settings/adjustments/bass", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/volume/level", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_sound_settings_adjustments_directivity( + @validate_arguments + async def set_product_friendly_name( self, - directivity: Annotated[Directivity, Field(description="the directivity")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the sound settings adjustments for directivity + product_friendly_name: Annotated[ + ProductFriendlyName, + Field(..., description="the friendly name for the product"), + ], + **kwargs + ) -> None: # noqa: E501 + """Set the friendly name # noqa: E501 - :param directivity: the directivity (required) - :type directivity: Directivity + :param product_friendly_name: the friendly name for the product (required) + :type product_friendly_name: ProductFriendlyName + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_product_friendly_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_product_friendly_name_with_http_info( + product_friendly_name, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_product_friendly_name_with_http_info( + self, + product_friendly_name: Annotated[ + ProductFriendlyName, + Field(..., description="the friendly name for the product"), + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the friendly name # noqa: E501 + + + :param product_friendly_name: the friendly name for the product (required) + :type product_friendly_name: ProductFriendlyName + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_sound_settings_adjustments_directivity_serialize( - directivity=directivity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["product_friendly_name"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_sound_settings_adjustments_directivity_with_http_info( - self, - directivity: Annotated[Directivity, Field(description="the directivity")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update the sound settings adjustments for directivity + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_product_friendly_name" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param directivity: the directivity (required) - :type directivity: Directivity - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._set_sound_settings_adjustments_directivity_serialize( - directivity=directivity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params["product_friendly_name"] is not None: + _body_params = _params["product_friendly_name"] - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/product/info/friendlyname", + "PUT", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_sound_settings_adjustments_directivity_without_preload_content( + @validate_arguments + async def set_remote_home_control_uri( self, - directivity: Annotated[Directivity, Field(description="the directivity")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the sound settings adjustments for directivity + home_control_uri: Annotated[ + HomeControlUri, + Field( + ..., + description="The new uri for HomeControl dashboard and IXP start page", + ), + ], + **kwargs + ) -> None: # noqa: E501 + """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page # noqa: E501 - :param directivity: the directivity (required) - :type directivity: Directivity + :param home_control_uri: The new uri for HomeControl dashboard and IXP start page (required) + :type home_control_uri: HomeControlUri + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_remote_home_control_uri_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_remote_home_control_uri_with_http_info( + home_control_uri, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_remote_home_control_uri_with_http_info( + self, + home_control_uri: Annotated[ + HomeControlUri, + Field( + ..., + description="The new uri for HomeControl dashboard and IXP start page", + ), + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page # noqa: E501 + + + :param home_control_uri: The new uri for HomeControl dashboard and IXP start page (required) + :type home_control_uri: HomeControlUri + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_sound_settings_adjustments_directivity_serialize( - directivity=directivity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["home_control_uri"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_sound_settings_adjustments_directivity_serialize( - self, - directivity, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_remote_home_control_uri" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if directivity is not None: - _body_params = directivity + _body_params = None + if _params["home_control_uri"] is not None: + _body_params = _params["home_control_uri"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/settings/adjustments/directivity", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/setup/remote/home-control-uri", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_sound_settings_adjustments_loudness( + @validate_arguments + async def set_settings_queue( self, - loudness: Annotated[Loudness, Field(description="the loudness mode")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the sound settings adjustments for loudness + play_queue_settings: Annotated[ + PlayQueueSettings, Field(..., description="the desired settings") + ], + **kwargs + ) -> None: # noqa: E501 + """Set queue settings # noqa: E501 - :param loudness: the loudness mode (required) - :type loudness: Loudness + :param play_queue_settings: the desired settings (required) + :type play_queue_settings: PlayQueueSettings + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_settings_queue_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_settings_queue_with_http_info( + play_queue_settings, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_settings_queue_with_http_info( + self, + play_queue_settings: Annotated[ + PlayQueueSettings, Field(..., description="the desired settings") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set queue settings # noqa: E501 + + + :param play_queue_settings: the desired settings (required) + :type play_queue_settings: PlayQueueSettings + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_sound_settings_adjustments_loudness_serialize( - loudness=loudness, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["play_queue_settings"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_sound_settings_adjustments_loudness_with_http_info( - self, - loudness: Annotated[Loudness, Field(description="the loudness mode")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update the sound settings adjustments for loudness + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_settings_queue" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param loudness: the loudness mode (required) - :type loudness: Loudness - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._set_sound_settings_adjustments_loudness_serialize( - loudness=loudness, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params["play_queue_settings"] is not None: + _body_params = _params["play_queue_settings"] - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/queue/settings", + "PUT", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_sound_settings_adjustments_loudness_without_preload_content( - self, - loudness: Annotated[Loudness, Field(description="the loudness mode")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the sound settings adjustments for loudness + @validate_arguments + async def set_sound_settings_adjustments_bass( + self, bass: Annotated[Bass, Field(..., description="the bass level")], **kwargs + ) -> None: # noqa: E501 + """Update the sound settings adjustments for bass # noqa: E501 - :param loudness: the loudness mode (required) - :type loudness: Loudness + :param bass: the bass level (required) + :type bass: Bass + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_sound_settings_adjustments_bass_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_sound_settings_adjustments_bass_with_http_info( + bass, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_sound_settings_adjustments_bass_with_http_info( + self, bass: Annotated[Bass, Field(..., description="the bass level")], **kwargs + ) -> ApiResponse: # noqa: E501 + """Update the sound settings adjustments for bass # noqa: E501 + + + :param bass: the bass level (required) + :type bass: Bass + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_sound_settings_adjustments_loudness_serialize( - loudness=loudness, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["bass"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_sound_settings_adjustments_loudness_serialize( - self, - loudness, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_sound_settings_adjustments_bass" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if loudness is not None: - _body_params = loudness + _body_params = None + if _params["bass"] is not None: + _body_params = _params["bass"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/settings/adjustments/loudness", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/settings/adjustments/bass", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_sound_settings_adjustments_treble( + @validate_arguments + async def set_sound_settings_adjustments_directivity( self, - treble: Annotated[Treble, Field(description="the treble level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the sound settings adjustments for treble + directivity: Annotated[Directivity, Field(..., description="the directivity")], + **kwargs + ) -> None: # noqa: E501 + """Update the sound settings adjustments for directivity # noqa: E501 - :param treble: the treble level (required) - :type treble: Treble + :param directivity: the directivity (required) + :type directivity: Directivity + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_sound_settings_adjustments_directivity_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_sound_settings_adjustments_directivity_with_http_info( + directivity, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_sound_settings_adjustments_directivity_with_http_info( + self, + directivity: Annotated[Directivity, Field(..., description="the directivity")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Update the sound settings adjustments for directivity # noqa: E501 + + + :param directivity: the directivity (required) + :type directivity: Directivity + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_sound_settings_adjustments_treble_serialize( - treble=treble, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["directivity"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def set_sound_settings_adjustments_treble_with_http_info( - self, - treble: Annotated[Treble, Field(description="the treble level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update the sound settings adjustments for treble + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_sound_settings_adjustments_directivity" % _key + ) + _params[_key] = _val + del _params["kwargs"] + _collection_formats = {} - :param treble: the treble level (required) - :type treble: Treble - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the path parameters + _path_params = {} - _param = self._set_sound_settings_adjustments_treble_serialize( - treble=treble, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params["directivity"] is not None: + _body_params = _params["directivity"] - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/settings/adjustments/directivity", + "PUT", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_sound_settings_adjustments_treble_without_preload_content( + @validate_arguments + async def set_sound_settings_adjustments_loudness( + self, + loudness: Annotated[Loudness, Field(..., description="the loudness mode")], + **kwargs + ) -> None: # noqa: E501 + """Update the sound settings adjustments for loudness # noqa: E501 + + + :param loudness: the loudness mode (required) + :type loudness: Loudness + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_sound_settings_adjustments_loudness_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_sound_settings_adjustments_loudness_with_http_info( + loudness, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_sound_settings_adjustments_loudness_with_http_info( self, - treble: Annotated[Treble, Field(description="the treble level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the sound settings adjustments for treble + loudness: Annotated[Loudness, Field(..., description="the loudness mode")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Update the sound settings adjustments for loudness # noqa: E501 - :param treble: the treble level (required) - :type treble: Treble + :param loudness: the loudness mode (required) + :type loudness: Loudness + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_sound_settings_adjustments_treble_serialize( - treble=treble, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["loudness"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_sound_settings_adjustments_treble_serialize( - self, - treble, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_sound_settings_adjustments_loudness" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if treble is not None: - _body_params = treble + _body_params = None + if _params["loudness"] is not None: + _body_params = _params["loudness"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/settings/adjustments/treble", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/settings/adjustments/loudness", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def set_stand_movement( + @validate_arguments + async def set_sound_settings_adjustments_treble( self, - stand_movement: Annotated[StandMovement, Field(description="Stand Movement")], - slow_speed: Annotated[ - Optional[StrictBool], - Field(description="Use slow speed on continuous movement"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set stand movement with either an angle or a movement type + treble: Annotated[Treble, Field(..., description="the treble level")], + **kwargs + ) -> None: # noqa: E501 + """Update the sound settings adjustments for treble # noqa: E501 - :param stand_movement: Stand Movement (required) - :type stand_movement: StandMovement - :param slow_speed: Use slow speed on continuous movement - :type slow_speed: bool + :param treble: the treble level (required) + :type treble: Treble + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_sound_settings_adjustments_treble_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_sound_settings_adjustments_treble_with_http_info( + treble, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_sound_settings_adjustments_treble_with_http_info( + self, + treble: Annotated[Treble, Field(..., description="the treble level")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Update the sound settings adjustments for treble # noqa: E501 + + + :param treble: the treble level (required) + :type treble: Treble + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() - _param = self._set_stand_movement_serialize( - stand_movement=stand_movement, - slow_speed=slow_speed, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + _all_params = ["treble"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_sound_settings_adjustments_treble" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + if _params["treble"] is not None: + _body_params = _params["treble"] + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + if _content_types_list: + _header_params["Content-Type"] = _content_types_list + + # authentication setting + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/settings/adjustments/treble", + "PUT", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, - ).data + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), + ) - @validate_call - async def set_stand_movement_with_http_info( + @validate_arguments + async def set_stand_movement( self, - stand_movement: Annotated[StandMovement, Field(description="Stand Movement")], + stand_movement: Annotated[ + StandMovement, Field(..., description="Stand Movement") + ], slow_speed: Annotated[ Optional[StrictBool], Field(description="Use slow speed on continuous movement"), ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set stand movement with either an angle or a movement type + **kwargs + ) -> None: # noqa: E501 + """Set stand movement with either an angle or a movement type # noqa: E501 :param stand_movement: Stand Movement (required) :type stand_movement: StandMovement :param slow_speed: Use slow speed on continuous movement :type slow_speed: bool - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_stand_movement_serialize( - stand_movement=stand_movement, - slow_speed=slow_speed, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_stand_movement_without_preload_content( + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_stand_movement_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_stand_movement_with_http_info( + stand_movement, slow_speed, **kwargs + ) # noqa: E501 + + @validate_arguments + async def set_stand_movement_with_http_info( self, - stand_movement: Annotated[StandMovement, Field(description="Stand Movement")], + stand_movement: Annotated[ + StandMovement, Field(..., description="Stand Movement") + ], slow_speed: Annotated[ Optional[StrictBool], Field(description="Use slow speed on continuous movement"), ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set stand movement with either an angle or a movement type + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set stand movement with either an angle or a movement type # noqa: E501 :param stand_movement: Stand Movement (required) :type stand_movement: StandMovement :param slow_speed: Use slow speed on continuous movement :type slow_speed: bool + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_stand_movement_serialize( - stand_movement=stand_movement, - slow_speed=slow_speed, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["stand_movement", "slow_speed"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_stand_movement_serialize( - self, - stand_movement, - slow_speed, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_stand_movement" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - # process the query parameters - if slow_speed is not None: + _path_params = {} - _query_params.append(("slow-speed", slow_speed)) + # process the query parameters + _query_params = [] + if _params.get("slow_speed") is not None: # noqa: E501 + _query_params.append(("slow-speed", _params["slow_speed"])) # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if stand_movement is not None: - _body_params = stand_movement + _body_params = None + if _params["stand_movement"] is not None: + _body_params = _params["stand_movement"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/stand/move", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/stand/move", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_volume_mute( self, volume_mute: Annotated[ - VolumeMute, Field(description="The mute state to apply") + VolumeMute, Field(..., description="The mute state to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the volume mute state + **kwargs + ) -> None: # noqa: E501 + """Set the volume mute state # noqa: E501 :param volume_mute: The mute state to apply (required) :type volume_mute: VolumeMute - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_volume_mute_serialize( - volume_mute=volume_mute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_volume_mute_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_volume_mute_with_http_info( + volume_mute, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_volume_mute_with_http_info( self, volume_mute: Annotated[ - VolumeMute, Field(description="The mute state to apply") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the volume mute state - - - :param volume_mute: The mute state to apply (required) - :type volume_mute: VolumeMute - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_volume_mute_serialize( - volume_mute=volume_mute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_volume_mute_without_preload_content( - self, - volume_mute: Annotated[ - VolumeMute, Field(description="The mute state to apply") + VolumeMute, Field(..., description="The mute state to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the volume mute state + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the volume mute state # noqa: E501 :param volume_mute: The mute state to apply (required) :type volume_mute: VolumeMute + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_volume_mute_serialize( - volume_mute=volume_mute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["volume_mute"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_volume_mute_serialize( - self, - volume_mute, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_volume_mute" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if volume_mute is not None: - _body_params = volume_mute + _body_params = None + if _params["volume_mute"] is not None: + _body_params = _params["volume_mute"] # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/volume/mute", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/volume/mute", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_volume_settings( self, volume_settings: Annotated[ - VolumeSettings, Field(description="The settings to apply") + VolumeSettings, Field(..., description="The settings to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the current volume settings for default and maximum volume level + **kwargs + ) -> None: # noqa: E501 + """Set the current volume settings for default and maximum volume level # noqa: E501 :param volume_settings: The settings to apply (required) :type volume_settings: VolumeSettings - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_volume_settings_serialize( - volume_settings=volume_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_volume_settings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_volume_settings_with_http_info( + volume_settings, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_volume_settings_with_http_info( self, volume_settings: Annotated[ - VolumeSettings, Field(description="The settings to apply") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the current volume settings for default and maximum volume level - - - :param volume_settings: The settings to apply (required) - :type volume_settings: VolumeSettings - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_volume_settings_serialize( - volume_settings=volume_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_volume_settings_without_preload_content( - self, - volume_settings: Annotated[ - VolumeSettings, Field(description="The settings to apply") + VolumeSettings, Field(..., description="The settings to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the current volume settings for default and maximum volume level + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the current volume settings for default and maximum volume level # noqa: E501 :param volume_settings: The settings to apply (required) :type volume_settings: VolumeSettings + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._set_volume_settings_serialize( - volume_settings=volume_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["volume_settings"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _set_volume_settings_serialize( - self, - volume_settings, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_volume_settings" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if volume_settings is not None: - _body_params = volume_settings + _body_params = None + if _params["volume_settings"] is not None: + _body_params = _params["volume_settings"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/volume/settings", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/volume/settings", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def start_deezer_flow( self, user_flow: Annotated[ Optional[UserFlow], Field(description="Select user") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Play users flow. If no provided user id it will play the flow connected to the active account + **kwargs + ) -> None: # noqa: E501 + """Play users flow. If no provided user id it will play the flow connected to the active account # noqa: E501 :param user_flow: Select user :type user_flow: UserFlow - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the start_deezer_flow_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.start_deezer_flow_with_http_info( + user_flow, **kwargs + ) # noqa: E501 + + @validate_arguments async def start_deezer_flow_with_http_info( self, user_flow: Annotated[ Optional[UserFlow], Field(description="Select user") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Play users flow. If no provided user id it will play the flow connected to the active account - - - :param user_flow: Select user - :type user_flow: UserFlow - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def start_deezer_flow_without_preload_content( - self, - user_flow: Annotated[ - Optional[UserFlow], Field(description="Select user") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Play users flow. If no provided user id it will play the flow connected to the active account + **kwargs + ) -> ApiResponse: # noqa: E501 + """Play users flow. If no provided user id it will play the flow connected to the active account # noqa: E501 :param user_flow: Select user :type user_flow: UserFlow + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + _params = locals() - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _all_params = ["user_flow"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _start_deezer_flow_serialize( - self, - user_flow, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - _collection_formats: Dict[str, str] = {} + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method start_deezer_flow" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if user_flow is not None: - _body_params = user_flow + _body_params = None + if _params["user_flow"] is not None: + _body_params = _params["user_flow"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/deezer/flow", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/deezer/flow", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/overlay_api.py b/python_client/mozart_api/api/overlay_api.py index 200a0c4..0115aca 100644 --- a/python_client/mozart_api/api/overlay_api.py +++ b/python_client/mozart_api/api/overlay_api.py @@ -12,18 +12,22 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field + from mozart_api.models.overlay_play_request import OverlayPlayRequest -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class OverlayApi: @@ -38,260 +42,149 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def post_overlay_play( self, overlay_play_request: Annotated[ - OverlayPlayRequest, Field(description="settings to use for the overlay") + OverlayPlayRequest, + Field(..., description="settings to use for the overlay"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Play overlay + **kwargs + ) -> None: # noqa: E501 + """Play overlay # noqa: E501 - Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. + Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. # noqa: E501 :param overlay_play_request: settings to use for the overlay (required) :type overlay_play_request: OverlayPlayRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_overlay_play_serialize( - overlay_play_request=overlay_play_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_overlay_play_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_overlay_play_with_http_info( + overlay_play_request, **kwargs + ) # noqa: E501 + + @validate_arguments async def post_overlay_play_with_http_info( self, overlay_play_request: Annotated[ - OverlayPlayRequest, Field(description="settings to use for the overlay") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Play overlay - - Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. - - :param overlay_play_request: settings to use for the overlay (required) - :type overlay_play_request: OverlayPlayRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_overlay_play_serialize( - overlay_play_request=overlay_play_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_overlay_play_without_preload_content( - self, - overlay_play_request: Annotated[ - OverlayPlayRequest, Field(description="settings to use for the overlay") + OverlayPlayRequest, + Field(..., description="settings to use for the overlay"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Play overlay + **kwargs + ) -> ApiResponse: # noqa: E501 + """Play overlay # noqa: E501 - Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. + Play some audio as an overlay. This will duck currently playing music while the audio is playing. Currently 100 unique TTS messages can be generated a day and generated messages are cached for 24 hours. # noqa: E501 :param overlay_play_request: settings to use for the overlay (required) :type overlay_play_request: OverlayPlayRequest + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_overlay_play_serialize( - overlay_play_request=overlay_play_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "202": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["overlay_play_request"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _post_overlay_play_serialize( - self, - overlay_play_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_overlay_play" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if overlay_play_request is not None: - _body_params = overlay_play_request + _body_params = None + if _params["overlay_play_request"] is not None: + _body_params = _params["overlay_play_request"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] + _auth_settings = [] # noqa: E501 + + _response_types_map = {} - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/overlay/play", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + return await self.api_client.call_api( + "/api/v1/overlay/play", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/playback_api.py b/python_client/mozart_api/api/playback_api.py index 4ab9a7d..8e768cb 100644 --- a/python_client/mozart_api/api/playback_api.py +++ b/python_client/mozart_api/api/playback_api.py @@ -12,14 +12,19 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Optional +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field, StrictBool, StrictInt, StrictStr + +from typing import Any, Dict, Optional + from mozart_api.models.play_queue_item import PlayQueueItem from mozart_api.models.play_queue_settings import PlayQueueSettings from mozart_api.models.playback_state import PlaybackState @@ -27,9 +32,9 @@ from mozart_api.models.uri import Uri from mozart_api.models.user_flow import UserFlow -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class PlaybackApi: @@ -44,2926 +49,1601 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def activate_preset( self, id: Annotated[ - StrictInt, Field(description="the id of the preset you want to trigger") + StrictInt, + Field(..., description="the id of the preset you want to trigger"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Trigger a preset + **kwargs + ) -> None: # noqa: E501 + """Trigger a preset # noqa: E501 :param id: the id of the preset you want to trigger (required) :type id: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._activate_preset_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "412": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the activate_preset_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.activate_preset_with_http_info(id, **kwargs) # noqa: E501 + + @validate_arguments async def activate_preset_with_http_info( self, id: Annotated[ - StrictInt, Field(description="the id of the preset you want to trigger") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Trigger a preset - - - :param id: the id of the preset you want to trigger (required) - :type id: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_preset_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "412": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def activate_preset_without_preload_content( - self, - id: Annotated[ - StrictInt, Field(description="the id of the preset you want to trigger") + StrictInt, + Field(..., description="the id of the preset you want to trigger"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger a preset + **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger a preset # noqa: E501 :param id: the id of the preset you want to trigger (required) :type id: int + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_preset_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "412": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _activate_preset_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method activate_preset" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/preset/{id}/trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/preset/{id}/trigger", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def add_to_queue( self, play_queue_item: Annotated[ - PlayQueueItem, Field(description="the queue element you want to add") + PlayQueueItem, Field(..., description="the queue element you want to add") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Add an element to the queue + **kwargs + ) -> None: # noqa: E501 + """Add an element to the queue # noqa: E501 :param play_queue_item: the queue element you want to add (required) :type play_queue_item: PlayQueueItem - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._add_to_queue_serialize( - play_queue_item=play_queue_item, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the add_to_queue_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.add_to_queue_with_http_info( + play_queue_item, **kwargs + ) # noqa: E501 + + @validate_arguments async def add_to_queue_with_http_info( self, play_queue_item: Annotated[ - PlayQueueItem, Field(description="the queue element you want to add") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Add an element to the queue - - - :param play_queue_item: the queue element you want to add (required) - :type play_queue_item: PlayQueueItem - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_to_queue_serialize( - play_queue_item=play_queue_item, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def add_to_queue_without_preload_content( - self, - play_queue_item: Annotated[ - PlayQueueItem, Field(description="the queue element you want to add") + PlayQueueItem, Field(..., description="the queue element you want to add") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Add an element to the queue + **kwargs + ) -> ApiResponse: # noqa: E501 + """Add an element to the queue # noqa: E501 :param play_queue_item: the queue element you want to add (required) :type play_queue_item: PlayQueueItem + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_to_queue_serialize( - play_queue_item=play_queue_item, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _add_to_queue_serialize( - self, - play_queue_item, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["play_queue_item"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method add_to_queue" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if play_queue_item is not None: - _body_params = play_queue_item + _body_params = None + if _params["play_queue_item"] is not None: + _body_params = _params["play_queue_item"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/queue", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/queue", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def get_available_sources( self, target_remote: Annotated[ Optional[StrictBool], Field(description="filter sources for remote control") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SourceArray: - """Get all the available sources + **kwargs + ) -> SourceArray: # noqa: E501 + """Get all the available sources # noqa: E501 :param target_remote: filter sources for remote control :type target_remote: bool - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_available_sources_serialize( - target_remote=target_remote, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SourceArray", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: SourceArray + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_available_sources_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_available_sources_with_http_info( + target_remote, **kwargs + ) # noqa: E501 + + @validate_arguments async def get_available_sources_with_http_info( self, target_remote: Annotated[ Optional[StrictBool], Field(description="filter sources for remote control") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SourceArray]: - """Get all the available sources + **kwargs + ) -> ApiResponse: # noqa: E501 + """Get all the available sources # noqa: E501 :param target_remote: filter sources for remote control :type target_remote: bool + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_available_sources_serialize( - target_remote=target_remote, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(SourceArray, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = ["target_remote"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_available_sources" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # process the query parameters + _query_params = [] + if _params.get("target_remote") is not None: # noqa: E501 + _query_params.append(("target-remote", _params["target_remote"])) + + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 + + # authentication setting + _auth_settings = [] # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { + _response_types_map = { "200": "SourceArray", "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/playback/sources", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_available_sources_without_preload_content( - self, - target_remote: Annotated[ - Optional[StrictBool], Field(description="filter sources for remote control") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get all the available sources + @validate_arguments + async def get_playback_state(self, **kwargs) -> PlaybackState: # noqa: E501 + """Get the current playback state # noqa: E501 - :param target_remote: filter sources for remote control - :type target_remote: bool + :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: PlaybackState + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_playback_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_playback_state_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_playback_state_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current playback state # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_available_sources_serialize( - target_remote=target_remote, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SourceArray", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_available_sources_serialize( - self, - target_remote, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PlaybackState, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_playback_state" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - # process the query parameters - if target_remote is not None: - - _query_params.append(("target-remote", target_remote)) + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/playback/sources", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "PlaybackState", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/playback/state", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_playback_state( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlaybackState: - """Get the current playback state + @validate_arguments + async def get_settings_queue(self, **kwargs) -> PlayQueueSettings: # noqa: E501 + """Get the current queue settings # noqa: E501 + :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: PlayQueueSettings + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_settings_queue_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_settings_queue_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_settings_queue_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current queue settings # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_playback_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlaybackState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_playback_state_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlaybackState]: - """Get the current playback state + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PlayQueueSettings, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_settings_queue" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} + # process the path parameters + _path_params = {} - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + # process the query parameters + _query_params = [] + # process the header parameters + _header_params = dict(_params.get("_headers", {})) + # process the form parameters + _form_params = [] + _files = {} + # process the body parameter + _body_params = None + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # noqa: E501 - _param = self._get_playback_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) + # authentication setting + _auth_settings = [] # noqa: E501 - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlaybackState", + _response_types_map = { + "200": "PlayQueueSettings", "400": "ErrorModel", } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, + + return await self.api_client.call_api( + "/api/v1/playback/queue/settings", + "GET", + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, response_types_map=_response_types_map, + auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), + collection_formats=_collection_formats, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_playback_state_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current playback state + @validate_arguments + async def post_clear_queue(self, **kwargs) -> None: # noqa: E501 + """Clear the queue # noqa: E501 + :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: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_clear_queue_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_clear_queue_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def post_clear_queue_with_http_info( + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Clear the queue # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_playback_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlaybackState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_playback_state_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_clear_queue" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/playback/state", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/queue/clear", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_settings_queue( + @validate_arguments + async def post_playback_command( self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlayQueueSettings: - """Get the current queue settings - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_settings_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlayQueueSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def get_settings_queue_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlayQueueSettings]: - """Get the current queue settings - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_settings_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlayQueueSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_settings_queue_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current queue settings - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_settings_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PlayQueueSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_settings_queue_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/playback/queue/settings", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_clear_queue( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Clear the queue - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_clear_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_clear_queue_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Clear the queue - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_clear_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_clear_queue_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Clear the queue - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_clear_queue_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_clear_queue_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/queue/clear", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def post_playback_command( - self, - command: Annotated[ - StrictStr, Field(description="the named command to execute") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Send a specific playback command to the product + command: Annotated[ + StrictStr, Field(..., description="the named command to execute") + ], + **kwargs + ) -> None: # noqa: E501 + """Send a specific playback command to the product # noqa: E501 :param command: the named command to execute (required) :type command: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_playback_command_serialize( - command=command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_playback_command_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_playback_command_with_http_info( + command, **kwargs + ) # noqa: E501 + + @validate_arguments async def post_playback_command_with_http_info( self, command: Annotated[ - StrictStr, Field(description="the named command to execute") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Send a specific playback command to the product - - - :param command: the named command to execute (required) - :type command: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_playback_command_serialize( - command=command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_playback_command_without_preload_content( - self, - command: Annotated[ - StrictStr, Field(description="the named command to execute") + StrictStr, Field(..., description="the named command to execute") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Send a specific playback command to the product + **kwargs + ) -> ApiResponse: # noqa: E501 + """Send a specific playback command to the product # noqa: E501 :param command: the named command to execute (required) :type command: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_playback_command_serialize( - command=command, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_playback_command_serialize( - self, - command, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["command"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_playback_command" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - if command is not None: - _path_params["command"] = command + _path_params = {} + if _params["command"] is not None: + _path_params["command"] = _params["command"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/command/{command}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/command/{command}", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def post_uri_source( self, uri: Annotated[ - Uri, Field(description="the desired uri from which to stream data") + Uri, Field(..., description="the desired uri from which to stream data") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the URI from which sound is streamed + **kwargs + ) -> None: # noqa: E501 + """Set the URI from which sound is streamed # noqa: E501 :param uri: the desired uri from which to stream data (required) :type uri: Uri - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_uri_source_serialize( - uri=uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_uri_source_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_uri_source_with_http_info(uri, **kwargs) # noqa: E501 + + @validate_arguments async def post_uri_source_with_http_info( self, uri: Annotated[ - Uri, Field(description="the desired uri from which to stream data") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the URI from which sound is streamed - - - :param uri: the desired uri from which to stream data (required) - :type uri: Uri - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_uri_source_serialize( - uri=uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_uri_source_without_preload_content( - self, - uri: Annotated[ - Uri, Field(description="the desired uri from which to stream data") + Uri, Field(..., description="the desired uri from which to stream data") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the URI from which sound is streamed + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the URI from which sound is streamed # noqa: E501 :param uri: the desired uri from which to stream data (required) :type uri: Uri + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_uri_source_serialize( - uri=uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_uri_source_serialize( - self, - uri, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["uri"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_uri_source" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if uri is not None: - _body_params = uri + _body_params = None + if _params["uri"] is not None: + _body_params = _params["uri"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/uri", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/uri", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def seek_to_position( self, position_ms: Annotated[ - StrictInt, Field(description="position in milliseconds") + StrictInt, Field(..., description="position in milliseconds") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Seek to position in stream + **kwargs + ) -> None: # noqa: E501 + """Seek to position in stream # noqa: E501 :param position_ms: position in milliseconds (required) :type position_ms: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._seek_to_position_serialize( - position_ms=position_ms, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the seek_to_position_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.seek_to_position_with_http_info( + position_ms, **kwargs + ) # noqa: E501 + + @validate_arguments async def seek_to_position_with_http_info( self, position_ms: Annotated[ - StrictInt, Field(description="position in milliseconds") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Seek to position in stream - - - :param position_ms: position in milliseconds (required) - :type position_ms: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._seek_to_position_serialize( - position_ms=position_ms, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def seek_to_position_without_preload_content( - self, - position_ms: Annotated[ - StrictInt, Field(description="position in milliseconds") + StrictInt, Field(..., description="position in milliseconds") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Seek to position in stream + **kwargs + ) -> ApiResponse: # noqa: E501 + """Seek to position in stream # noqa: E501 :param position_ms: position in milliseconds (required) :type position_ms: int + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._seek_to_position_serialize( - position_ms=position_ms, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _seek_to_position_serialize( - self, - position_ms, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["position_ms"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method seek_to_position" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - # process the query parameters - if position_ms is not None: + _path_params = {} - _query_params.append(("position_ms", position_ms)) + # process the query parameters + _query_params = [] + if _params.get("position_ms") is not None: # noqa: E501 + _query_params.append(("position_ms", _params["position_ms"])) # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/playback/seek", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/seek", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_active_source( self, source_id: Annotated[ - StrictStr, Field(description="the id of the source to activate") + StrictStr, Field(..., description="the id of the source to activate") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the active source + **kwargs + ) -> None: # noqa: E501 + """Set the active source # noqa: E501 :param source_id: the id of the source to activate (required) :type source_id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_active_source_serialize( - source_id=source_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_active_source_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_active_source_with_http_info( + source_id, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_active_source_with_http_info( self, source_id: Annotated[ - StrictStr, Field(description="the id of the source to activate") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the active source - - - :param source_id: the id of the source to activate (required) - :type source_id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_active_source_serialize( - source_id=source_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_active_source_without_preload_content( - self, - source_id: Annotated[ - StrictStr, Field(description="the id of the source to activate") + StrictStr, Field(..., description="the id of the source to activate") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the active source + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the active source # noqa: E501 :param source_id: the id of the source to activate (required) :type source_id: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_active_source_serialize( - source_id=source_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_active_source_serialize( - self, - source_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["source_id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_active_source" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - if source_id is not None: - _path_params["sourceId"] = source_id + _path_params = {} + if _params["source_id"] is not None: + _path_params["sourceId"] = _params["source_id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/sources/active/{sourceId}", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/sources/active/{sourceId}", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_settings_queue( self, play_queue_settings: Annotated[ - PlayQueueSettings, Field(description="the desired settings") + PlayQueueSettings, Field(..., description="the desired settings") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set queue settings + **kwargs + ) -> None: # noqa: E501 + """Set queue settings # noqa: E501 :param play_queue_settings: the desired settings (required) :type play_queue_settings: PlayQueueSettings - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_settings_queue_serialize( - play_queue_settings=play_queue_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_settings_queue_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_settings_queue_with_http_info( + play_queue_settings, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_settings_queue_with_http_info( self, play_queue_settings: Annotated[ - PlayQueueSettings, Field(description="the desired settings") + PlayQueueSettings, Field(..., description="the desired settings") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set queue settings + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set queue settings # noqa: E501 :param play_queue_settings: the desired settings (required) :type play_queue_settings: PlayQueueSettings + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_settings_queue_serialize( - play_queue_settings=play_queue_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_settings_queue_without_preload_content( - self, - play_queue_settings: Annotated[ - PlayQueueSettings, Field(description="the desired settings") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set queue settings - - - :param play_queue_settings: the desired settings (required) - :type play_queue_settings: PlayQueueSettings - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_settings_queue_serialize( - play_queue_settings=play_queue_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_settings_queue_serialize( - self, - play_queue_settings, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["play_queue_settings"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_settings_queue" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if play_queue_settings is not None: - _body_params = play_queue_settings + _body_params = None + if _params["play_queue_settings"] is not None: + _body_params = _params["play_queue_settings"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/playback/queue/settings", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/queue/settings", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def start_deezer_flow( self, user_flow: Annotated[ Optional[UserFlow], Field(description="Select user") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Play users flow. If no provided user id it will play the flow connected to the active account + **kwargs + ) -> None: # noqa: E501 + """Play users flow. If no provided user id it will play the flow connected to the active account # noqa: E501 :param user_flow: Select user :type user_flow: UserFlow - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the start_deezer_flow_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.start_deezer_flow_with_http_info( + user_flow, **kwargs + ) # noqa: E501 + + @validate_arguments async def start_deezer_flow_with_http_info( self, user_flow: Annotated[ Optional[UserFlow], Field(description="Select user") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Play users flow. If no provided user id it will play the flow connected to the active account + **kwargs + ) -> ApiResponse: # noqa: E501 + """Play users flow. If no provided user id it will play the flow connected to the active account # noqa: E501 :param user_flow: Select user :type user_flow: UserFlow + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def start_deezer_flow_without_preload_content( - self, - user_flow: Annotated[ - Optional[UserFlow], Field(description="Select user") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Play users flow. If no provided user id it will play the flow connected to the active account - - - :param user_flow: Select user - :type user_flow: UserFlow - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_deezer_flow_serialize( - user_flow=user_flow, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _start_deezer_flow_serialize( - self, - user_flow, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["user_flow"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method start_deezer_flow" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if user_flow is not None: - _body_params = user_flow + _body_params = None + if _params["user_flow"] is not None: + _body_params = _params["user_flow"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/playback/deezer/flow", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/playback/deezer/flow", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/power_api.py b/python_client/mozart_api/api/power_api.py index 9a5da05..ee71eb1 100644 --- a/python_client/mozart_api/api/power_api.py +++ b/python_client/mozart_api/api/power_api.py @@ -12,17 +12,20 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated + +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable from mozart_api.models.battery_state import BatteryState from mozart_api.models.power_state_enum import PowerStateEnum -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class PowerApi: @@ -37,668 +40,352 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call - async def get_battery_state( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> BatteryState: - """Get battery state of the product + @validate_arguments + async def get_battery_state(self, **kwargs) -> BatteryState: # noqa: E501 + """Get battery state of the product # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_battery_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BatteryState", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: BatteryState + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_battery_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_battery_state_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_battery_state_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[BatteryState]: - """Get battery state of the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_battery_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BatteryState", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_battery_state_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get battery state of the product - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get battery state of the product # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_battery_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "BatteryState", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(BatteryState, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - def _get_battery_state_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_battery_state" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/battery", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "BatteryState", + } + + return await self.api_client.call_api( + "/api/v1/battery", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_power_state( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PowerStateEnum: - """Get power state of the product + @validate_arguments + async def get_power_state(self, **kwargs) -> PowerStateEnum: # noqa: E501 + """Get power state of the product # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_power_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PowerStateEnum", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: PowerStateEnum + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_power_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_power_state_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_power_state_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PowerStateEnum]: - """Get power state of the product - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get power state of the product # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_power_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PowerStateEnum, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "PowerStateEnum", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_power_state_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get power state of the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_power_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PowerStateEnum", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_power_state_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_power_state" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/state/power", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "PowerStateEnum", + } + + return await self.api_client.call_api( + "/api/v1/state/power", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def post_standby( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Put the device in standby + @validate_arguments + async def post_standby(self, **kwargs) -> None: # noqa: E501 + """Put the device in standby # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_standby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call - async def post_standby_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Put the device in standby - - + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_standby_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_standby_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def post_standby_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 + """Put the device in standby # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_standby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - @validate_call - async def post_standby_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Put the device in standby + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_standby" % _key + ) + _params[_key] = _val + del _params["kwargs"] - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_standby_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_standby_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/state/standby", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/state/standby", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/product_api.py b/python_client/mozart_api/api/product_api.py index 1432c04..0356437 100644 --- a/python_client/mozart_api/api/product_api.py +++ b/python_client/mozart_api/api/product_api.py @@ -12,19 +12,23 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field + from mozart_api.models.product_friendly_name import ProductFriendlyName from mozart_api.models.product_state import ProductState -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class ProductApi: @@ -39,481 +43,266 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call - async def get_product_state( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProductState: - """Get the overall state from the product + @validate_arguments + async def get_product_state(self, **kwargs) -> ProductState: # noqa: E501 + """Get the overall state from the product # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_product_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ProductState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: ProductState + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_product_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_product_state_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_product_state_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ProductState]: - """Get the overall state from the product - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_product_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ProductState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_product_state_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the overall state from the product - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the overall state from the product # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_product_state_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ProductState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ProductState, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - return response_data.response - - def _get_product_state_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_product_state" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/state", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "ProductState", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/state", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_product_friendly_name( self, product_friendly_name: Annotated[ - ProductFriendlyName, Field(description="the friendly name for the product") + ProductFriendlyName, + Field(..., description="the friendly name for the product"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the friendly name + **kwargs + ) -> None: # noqa: E501 + """Set the friendly name # noqa: E501 :param product_friendly_name: the friendly name for the product (required) :type product_friendly_name: ProductFriendlyName - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_product_friendly_name_serialize( - product_friendly_name=product_friendly_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_product_friendly_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_product_friendly_name_with_http_info( + product_friendly_name, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_product_friendly_name_with_http_info( self, product_friendly_name: Annotated[ - ProductFriendlyName, Field(description="the friendly name for the product") + ProductFriendlyName, + Field(..., description="the friendly name for the product"), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the friendly name + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the friendly name # noqa: E501 :param product_friendly_name: the friendly name for the product (required) :type product_friendly_name: ProductFriendlyName + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_product_friendly_name_serialize( - product_friendly_name=product_friendly_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["product_friendly_name"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_product_friendly_name" % _key + ) + _params[_key] = _val + del _params["kwargs"] - @validate_call - async def set_product_friendly_name_without_preload_content( - self, - product_friendly_name: Annotated[ - ProductFriendlyName, Field(description="the friendly name for the product") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the friendly name - - - :param product_friendly_name: the friendly name for the product (required) - :type product_friendly_name: ProductFriendlyName - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_product_friendly_name_serialize( - product_friendly_name=product_friendly_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_product_friendly_name_serialize( - self, - product_friendly_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if product_friendly_name is not None: - _body_params = product_friendly_name + _body_params = None + if _params["product_friendly_name"] is not None: + _body_params = _params["product_friendly_name"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/product/info/friendlyname", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/product/info/friendlyname", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/remote_api.py b/python_client/mozart_api/api/remote_api.py index e16c3c9..3dcdc06 100644 --- a/python_client/mozart_api/api/remote_api.py +++ b/python_client/mozart_api/api/remote_api.py @@ -12,20 +12,25 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictStr -from typing import Optional +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field, StrictStr + +from typing import Dict, Optional + from mozart_api.models.remote_menu_item import RemoteMenuItem from mozart_api.models.remote_ui_key_state import RemoteUIKeyState -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class RemoteApi: @@ -40,752 +45,414 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def get_remote_menu( self, descendants_to: Annotated[ Optional[StrictStr], Field(description="Get all descendants to this item") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, RemoteMenuItem]: - """Get all remote menu items + **kwargs + ) -> Dict[str, RemoteMenuItem]: # noqa: E501 + """Get all remote menu items # noqa: E501 :param descendants_to: Get all descendants to this item :type descendants_to: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_remote_menu_serialize( - descendants_to=descendants_to, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, RemoteMenuItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: Dict[str, RemoteMenuItem] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_remote_menu_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_remote_menu_with_http_info( + descendants_to, **kwargs + ) # noqa: E501 + + @validate_arguments async def get_remote_menu_with_http_info( self, descendants_to: Annotated[ Optional[StrictStr], Field(description="Get all descendants to this item") ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, RemoteMenuItem]]: - """Get all remote menu items + **kwargs + ) -> ApiResponse: # noqa: E501 + """Get all remote menu items # noqa: E501 :param descendants_to: Get all descendants to this item :type descendants_to: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_menu_serialize( - descendants_to=descendants_to, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, RemoteMenuItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, RemoteMenuItem], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = ["descendants_to"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - @validate_call - async def get_remote_menu_without_preload_content( - self, - descendants_to: Annotated[ - Optional[StrictStr], Field(description="Get all descendants to this item") - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get all remote menu items + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_remote_menu" % _key + ) + _params[_key] = _val + del _params["kwargs"] - - :param descendants_to: Get all descendants to this item - :type descendants_to: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_menu_serialize( - descendants_to=descendants_to, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, RemoteMenuItem]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_remote_menu_serialize( - self, - descendants_to, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - # process the query parameters - if descendants_to is not None: + _path_params = {} - _query_params.append(("descendantsTo", descendants_to)) + # process the query parameters + _query_params = [] + if _params.get("descendants_to") is not None: # noqa: E501 + _query_params.append(("descendantsTo", _params["descendants_to"])) # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/remote", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, RemoteMenuItem]", + } + + return await self.api_client.call_api( + "/api/v1/remote", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def post_remote_key_trigger( self, - id: Annotated[StrictStr, Field(description="Key identifier")], + id: Annotated[StrictStr, Field(..., description="Key identifier")], remote_ui_key_state: RemoteUIKeyState, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Remote input key press + **kwargs + ) -> None: # noqa: E501 + """Remote input key press # noqa: E501 :param id: Key identifier (required) :type id: str :param remote_ui_key_state: (required) :type remote_ui_key_state: RemoteUIKeyState - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_remote_key_trigger_serialize( - id=id, - remote_ui_key_state=remote_ui_key_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_remote_key_trigger_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_remote_key_trigger_with_http_info( + id, remote_ui_key_state, **kwargs + ) # noqa: E501 + + @validate_arguments async def post_remote_key_trigger_with_http_info( self, - id: Annotated[StrictStr, Field(description="Key identifier")], + id: Annotated[StrictStr, Field(..., description="Key identifier")], remote_ui_key_state: RemoteUIKeyState, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Remote input key press + **kwargs + ) -> ApiResponse: # noqa: E501 + """Remote input key press # noqa: E501 :param id: Key identifier (required) :type id: str :param remote_ui_key_state: (required) :type remote_ui_key_state: RemoteUIKeyState + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_key_trigger_serialize( - id=id, - remote_ui_key_state=remote_ui_key_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["id", "remote_ui_key_state"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_remote_key_trigger_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="Key identifier")], - remote_ui_key_state: RemoteUIKeyState, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Remote input key press + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_remote_key_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] - - :param id: Key identifier (required) - :type id: str - :param remote_ui_key_state: (required) - :type remote_ui_key_state: RemoteUIKeyState - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_key_trigger_serialize( - id=id, - remote_ui_key_state=remote_ui_key_state, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_remote_key_trigger_serialize( - self, - id, - remote_ui_key_state, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if remote_ui_key_state is not None: - _body_params = remote_ui_key_state + _body_params = None + if _params["remote_ui_key_state"] is not None: + _body_params = _params["remote_ui_key_state"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/remote/key/{id}/trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/remote/key/{id}/trigger", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def post_remote_trigger( self, - id: Annotated[StrictStr, Field(description="Remote menu item ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Trigger a remote menu item + id: Annotated[StrictStr, Field(..., description="Remote menu item ID")], + **kwargs + ) -> None: # noqa: E501 + """Trigger a remote menu item # noqa: E501 :param id: Remote menu item ID (required) :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_remote_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_remote_trigger_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_remote_trigger_with_http_info(id, **kwargs) # noqa: E501 + + @validate_arguments async def post_remote_trigger_with_http_info( self, - id: Annotated[StrictStr, Field(description="Remote menu item ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Trigger a remote menu item + id: Annotated[StrictStr, Field(..., description="Remote menu item ID")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger a remote menu item # noqa: E501 :param id: Remote menu item ID (required) :type id: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - @validate_call - async def post_remote_trigger_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="Remote menu item ID")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger a remote menu item + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_remote_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] - - :param id: Remote menu item ID (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_remote_trigger_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/remote/{id}/trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/remote/{id}/trigger", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/scenes_api.py b/python_client/mozart_api/api/scenes_api.py index d573086..d4007fc 100644 --- a/python_client/mozart_api/api/scenes_api.py +++ b/python_client/mozart_api/api/scenes_api.py @@ -12,20 +12,26 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field, StrictStr +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field, StrictStr + +from typing import Dict + from mozart_api.models.scene import Scene from mozart_api.models.scene_match import SceneMatch from mozart_api.models.scene_properties import SceneProperties -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class ScenesApi: @@ -40,964 +46,521 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call - async def get_all_scenes( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, Scene]: - """Get a list of configured scenes + @validate_arguments + async def get_all_scenes(self, **kwargs) -> Dict[str, Scene]: # noqa: E501 + """Get a list of configured scenes # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_all_scenes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Scene]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: Dict[str, Scene] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_all_scenes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_all_scenes_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_all_scenes_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, Scene]]: - """Get a list of configured scenes - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get a list of configured scenes # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_all_scenes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Scene]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_all_scenes_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a list of configured scenes - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_all_scenes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Scene]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_all_scenes_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, Scene], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_all_scenes" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/scenes", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, Scene]", + } + + return await self.api_client.call_api( + "/api/v1/scenes", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def post_scene_match_trigger( - self, - scene_match: SceneMatch, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Trigger the first scene with same non null objects provided in the SceneMatch object + self, scene_match: SceneMatch, **kwargs + ) -> None: # noqa: E501 + """Trigger the first scene with same non null objects provided in the SceneMatch object # noqa: E501 :param scene_match: (required) :type scene_match: SceneMatch - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_scene_match_trigger_serialize( - scene_match=scene_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_scene_match_trigger_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_scene_match_trigger_with_http_info( + scene_match, **kwargs + ) # noqa: E501 + + @validate_arguments async def post_scene_match_trigger_with_http_info( - self, - scene_match: SceneMatch, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Trigger the first scene with same non null objects provided in the SceneMatch object + self, scene_match: SceneMatch, **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger the first scene with same non null objects provided in the SceneMatch object # noqa: E501 :param scene_match: (required) :type scene_match: SceneMatch + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_match_trigger_serialize( - scene_match=scene_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_scene_match_trigger_without_preload_content( - self, - scene_match: SceneMatch, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger the first scene with same non null objects provided in the SceneMatch object - - - :param scene_match: (required) - :type scene_match: SceneMatch - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_match_trigger_serialize( - scene_match=scene_match, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_scene_match_trigger_serialize( - self, - scene_match, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["scene_match"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_scene_match_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if scene_match is not None: - _body_params = scene_match + _body_params = None + if _params["scene_match"] is not None: + _body_params = _params["scene_match"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/scene/match-trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/scene/match-trigger", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def post_scene_trigger( self, - id: Annotated[StrictStr, Field(description="ID of the scene")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Trigger a specific scene + id: Annotated[StrictStr, Field(..., description="ID of the scene")], + **kwargs + ) -> None: # noqa: E501 + """Trigger a specific scene # noqa: E501 :param id: ID of the scene (required) :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_scene_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_scene_trigger_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_scene_trigger_with_http_info(id, **kwargs) # noqa: E501 + + @validate_arguments async def post_scene_trigger_with_http_info( self, - id: Annotated[StrictStr, Field(description="ID of the scene")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Trigger a specific scene + id: Annotated[StrictStr, Field(..., description="ID of the scene")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Trigger a specific scene # noqa: E501 :param id: ID of the scene (required) :type id: str + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_scene_trigger_without_preload_content( - self, - id: Annotated[StrictStr, Field(description="ID of the scene")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Trigger a specific scene - - - :param id: ID of the scene (required) - :type id: str - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_scene_trigger_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - "404": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_scene_trigger_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_scene_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/scene/{id}/trigger", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/scene/{id}/trigger", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def run_provided_scene( self, scene_properties: Annotated[ - SceneProperties, Field(description="The scene you want to run") + SceneProperties, Field(..., description="The scene you want to run") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Run provided scene + **kwargs + ) -> None: # noqa: E501 + """Run provided scene # noqa: E501 :param scene_properties: The scene you want to run (required) :type scene_properties: SceneProperties - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._run_provided_scene_serialize( - scene_properties=scene_properties, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the run_provided_scene_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.run_provided_scene_with_http_info( + scene_properties, **kwargs + ) # noqa: E501 + + @validate_arguments async def run_provided_scene_with_http_info( self, scene_properties: Annotated[ - SceneProperties, Field(description="The scene you want to run") + SceneProperties, Field(..., description="The scene you want to run") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Run provided scene + **kwargs + ) -> ApiResponse: # noqa: E501 + """Run provided scene # noqa: E501 :param scene_properties: The scene you want to run (required) :type scene_properties: SceneProperties + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._run_provided_scene_serialize( - scene_properties=scene_properties, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def run_provided_scene_without_preload_content( - self, - scene_properties: Annotated[ - SceneProperties, Field(description="The scene you want to run") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Run provided scene - - - :param scene_properties: The scene you want to run (required) - :type scene_properties: SceneProperties - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._run_provided_scene_serialize( - scene_properties=scene_properties, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _run_provided_scene_serialize( - self, - scene_properties, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["scene_properties"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method run_provided_scene" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if scene_properties is not None: - _body_params = scene_properties + _body_params = None + if _params["scene_properties"] is not None: + _body_params = _params["scene_properties"] # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/scene/run", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/scene/run", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/settings_api.py b/python_client/mozart_api/api/settings_api.py index 4cbfb86..0dba05f 100644 --- a/python_client/mozart_api/api/settings_api.py +++ b/python_client/mozart_api/api/settings_api.py @@ -12,21 +12,27 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field + +from typing import Dict + from mozart_api.models.home_control_ixp import HomeControlIxp from mozart_api.models.home_control_uri import HomeControlUri from mozart_api.models.paired_remote_response import PairedRemoteResponse from mozart_api.models.preset import Preset -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class SettingsApi: @@ -41,1184 +47,656 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def get_bluetooth_remotes( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PairedRemoteResponse: - """Get a list of paired bluetooth remotes + self, **kwargs + ) -> PairedRemoteResponse: # noqa: E501 + """Get a list of paired bluetooth remotes # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_bluetooth_remotes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PairedRemoteResponse", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: PairedRemoteResponse + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_bluetooth_remotes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_bluetooth_remotes_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_bluetooth_remotes_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PairedRemoteResponse]: - """Get a list of paired bluetooth remotes - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_bluetooth_remotes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PairedRemoteResponse", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_bluetooth_remotes_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get a list of paired bluetooth remotes - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get a list of paired bluetooth remotes # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_bluetooth_remotes_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "PairedRemoteResponse", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_bluetooth_remotes_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(PairedRemoteResponse, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_bluetooth_remotes" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/setup/remotes", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "PairedRemoteResponse", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/setup/remotes", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, - ) - - @validate_call - async def get_presets( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, Preset]: - """Get the preset configuration - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_presets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Preset]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout + _request_auth=_params.get("_request_auth"), ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - @validate_call - async def get_presets_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, Preset]]: - """Get the preset configuration + @validate_arguments + async def get_presets(self, **kwargs) -> Dict[str, Preset]: # noqa: E501 + """Get the preset configuration # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_presets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Preset]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_presets_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the preset configuration - - + If the method is called asynchronously, + returns the request thread. + :rtype: Dict[str, Preset] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_presets_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_presets_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments + async def get_presets_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 + """Get the preset configuration # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_presets_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, Preset]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_presets_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, Preset], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_presets" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/setup/presets", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, Preset]", + } + + return await self.api_client.call_api( + "/api/v1/setup/presets", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def get_remote_home_control_uri( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> HomeControlUri: - """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page + self, **kwargs + ) -> HomeControlUri: # noqa: E501 + """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_remote_home_control_uri_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "HomeControlUri", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: HomeControlUri + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_remote_home_control_uri_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_remote_home_control_uri_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments async def get_remote_home_control_uri_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[HomeControlUri]: - """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_home_control_uri_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "HomeControlUri", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_remote_home_control_uri_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get HomeControl dashboard uri and (optional) Immersive Experience (IXP) start page # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_remote_home_control_uri_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "HomeControlUri", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_remote_home_control_uri_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(HomeControlUri, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_remote_home_control_uri" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/setup/remote/home-control-uri", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "HomeControlUri", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/setup/remote/home-control-uri", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def post_remote_home_control_ixp( self, - home_control_ixp: Annotated[HomeControlIxp, Field(description="The new IXP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Change any active Immersive Experience (IXP) + home_control_ixp: Annotated[ + HomeControlIxp, Field(..., description="The new IXP") + ], + **kwargs + ) -> None: # noqa: E501 + """Change any active Immersive Experience (IXP) # noqa: E501 :param home_control_ixp: The new IXP (required) :type home_control_ixp: HomeControlIxp - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._post_remote_home_control_ixp_serialize( - home_control_ixp=home_control_ixp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the post_remote_home_control_ixp_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.post_remote_home_control_ixp_with_http_info( + home_control_ixp, **kwargs + ) # noqa: E501 + + @validate_arguments async def post_remote_home_control_ixp_with_http_info( self, - home_control_ixp: Annotated[HomeControlIxp, Field(description="The new IXP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Change any active Immersive Experience (IXP) - - - :param home_control_ixp: The new IXP (required) - :type home_control_ixp: HomeControlIxp - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_home_control_ixp_serialize( - home_control_ixp=home_control_ixp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def post_remote_home_control_ixp_without_preload_content( - self, - home_control_ixp: Annotated[HomeControlIxp, Field(description="The new IXP")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Change any active Immersive Experience (IXP) + home_control_ixp: Annotated[ + HomeControlIxp, Field(..., description="The new IXP") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Change any active Immersive Experience (IXP) # noqa: E501 :param home_control_ixp: The new IXP (required) :type home_control_ixp: HomeControlIxp + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._post_remote_home_control_ixp_serialize( - home_control_ixp=home_control_ixp, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _post_remote_home_control_ixp_serialize( - self, - home_control_ixp, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["home_control_ixp"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method post_remote_home_control_ixp" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if home_control_ixp is not None: - _body_params = home_control_ixp + _body_params = None + if _params["home_control_ixp"] is not None: + _body_params = _params["home_control_ixp"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/setup/remote/home-control-ixp", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/setup/remote/home-control-ixp", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_remote_home_control_uri( self, home_control_uri: Annotated[ HomeControlUri, Field( - description="The new uri for HomeControl dashboard and IXP start page" + ..., + description="The new uri for HomeControl dashboard and IXP start page", ), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page + **kwargs + ) -> None: # noqa: E501 + """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page # noqa: E501 :param home_control_uri: The new uri for HomeControl dashboard and IXP start page (required) :type home_control_uri: HomeControlUri - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_remote_home_control_uri_serialize( - home_control_uri=home_control_uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_remote_home_control_uri_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_remote_home_control_uri_with_http_info( + home_control_uri, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_remote_home_control_uri_with_http_info( self, home_control_uri: Annotated[ HomeControlUri, Field( - description="The new uri for HomeControl dashboard and IXP start page" - ), - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page - - - :param home_control_uri: The new uri for HomeControl dashboard and IXP start page (required) - :type home_control_uri: HomeControlUri - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_remote_home_control_uri_serialize( - home_control_uri=home_control_uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_remote_home_control_uri_without_preload_content( - self, - home_control_uri: Annotated[ - HomeControlUri, - Field( - description="The new uri for HomeControl dashboard and IXP start page" + ..., + description="The new uri for HomeControl dashboard and IXP start page", ), ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the uri for HomeControl dashboard and Immersive Experience (IXP) start page # noqa: E501 :param home_control_uri: The new uri for HomeControl dashboard and IXP start page (required) :type home_control_uri: HomeControlUri + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_remote_home_control_uri_serialize( - home_control_uri=home_control_uri, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_remote_home_control_uri_serialize( - self, - home_control_uri, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["home_control_uri"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_remote_home_control_uri" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if home_control_uri is not None: - _body_params = home_control_uri + _body_params = None + if _params["home_control_uri"] is not None: + _body_params = _params["home_control_uri"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/setup/remote/home-control-uri", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/setup/remote/home-control-uri", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/software_update_api.py b/python_client/mozart_api/api/software_update_api.py index 0db4b65..2d20a8f 100644 --- a/python_client/mozart_api/api/software_update_api.py +++ b/python_client/mozart_api/api/software_update_api.py @@ -12,16 +12,19 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated + +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable from mozart_api.models.software_update_status import SoftwareUpdateStatus -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class SoftwareUpdateApi: @@ -36,226 +39,125 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def get_softwareupdate_status( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SoftwareUpdateStatus: - """Get the current software update status + self, **kwargs + ) -> SoftwareUpdateStatus: # noqa: E501 + """Get the current software update status # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_softwareupdate_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SoftwareUpdateStatus", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: SoftwareUpdateStatus + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_softwareupdate_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_softwareupdate_status_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments async def get_softwareupdate_status_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SoftwareUpdateStatus]: - """Get the current software update status - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_softwareupdate_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SoftwareUpdateStatus", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_softwareupdate_status_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current software update status - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current software update status # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_softwareupdate_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(SoftwareUpdateStatus, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "SoftwareUpdateStatus", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_softwareupdate_status_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_softwareupdate_status" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "SoftwareUpdateStatus", + "400": "ErrorModel", + } - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/softwareupdate", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + return await self.api_client.call_api( + "/api/v1/softwareupdate", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/sound_api.py b/python_client/mozart_api/api/sound_api.py index 46f6654..8639220 100644 --- a/python_client/mozart_api/api/sound_api.py +++ b/python_client/mozart_api/api/sound_api.py @@ -12,13 +12,19 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from pydantic import Field +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + from typing_extensions import Annotated +from pydantic import Field, conint + +from typing import Dict, List + from mozart_api.models.bass import Bass from mozart_api.models.directivity import Directivity from mozart_api.models.listening_mode import ListeningMode @@ -31,9 +37,9 @@ from mozart_api.models.volume_settings import VolumeSettings from mozart_api.models.volume_state import VolumeState -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class SoundApi: @@ -48,3103 +54,1699 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def activate_listening_mode( - self, - id: Annotated[int, Field(strict=True, ge=0)], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Activate a listening mode + self, id: conint(strict=True, ge=0), **kwargs + ) -> None: # noqa: E501 + """Activate a listening mode # noqa: E501 :param id: (required) :type id: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._activate_listening_mode_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the activate_listening_mode_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.activate_listening_mode_with_http_info( + id, **kwargs + ) # noqa: E501 + + @validate_arguments async def activate_listening_mode_with_http_info( - self, - id: Annotated[int, Field(strict=True, ge=0)], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Activate a listening mode - - - :param id: (required) - :type id: int - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_listening_mode_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def activate_listening_mode_without_preload_content( - self, - id: Annotated[int, Field(strict=True, ge=0)], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Activate a listening mode + self, id: conint(strict=True, ge=0), **kwargs + ) -> ApiResponse: # noqa: E501 + """Activate a listening mode # noqa: E501 :param id: (required) :type id: int + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_listening_mode_serialize( - id=id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "404": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _activate_listening_mode_serialize( - self, - id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["id"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method activate_listening_mode" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters - if id is not None: - _path_params["id"] = id + _path_params = {} + if _params["id"] is not None: + _path_params["id"] = _params["id"] + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/sound/listening-modes/{id}/activate", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/listening-modes/{id}/activate", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def get_active_listening_mode( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListeningModeRef: - """Get the active listening mode + self, **kwargs + ) -> ListeningModeRef: # noqa: E501 + """Get the active listening mode # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_active_listening_mode_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListeningModeRef", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: ListeningModeRef + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_active_listening_mode_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_active_listening_mode_with_http_info( + **kwargs + ) # noqa: E501 + + @validate_arguments async def get_active_listening_mode_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListeningModeRef]: - """Get the active listening mode - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the active listening mode # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_active_listening_mode_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListeningModeRef", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_active_listening_mode_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the active listening mode - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_active_listening_mode_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListeningModeRef", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_active_listening_mode_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ListeningModeRef, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_active_listening_mode" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/listening-modes/active", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "ListeningModeRef", + } + + return await self.api_client.call_api( + "/api/v1/sound/listening-modes/active", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_current_volume( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeState: - """Get the current volume state + @validate_arguments + async def get_current_volume(self, **kwargs) -> VolumeState: # noqa: E501 + """Get the current volume state # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_current_volume_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: VolumeState + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_current_volume_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_current_volume_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_current_volume_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumeState]: - """Get the current volume state - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current volume state # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_current_volume_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_current_volume_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current volume state - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_current_volume_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeState", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_current_volume_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VolumeState, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_current_volume" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/volume", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "VolumeState", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/sound/volume", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def get_listening_mode_set( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[ListeningMode]: - """Get available listening modes that match the current role (standalone, multichannel or both(all)). + self, **kwargs + ) -> List[ListeningMode]: # noqa: E501 + """Get available listening modes that match the current role (standalone, multichannel or both(all)). # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_listening_mode_set_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListeningMode]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: List[ListeningMode] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_listening_mode_set_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_listening_mode_set_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_listening_mode_set_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[ListeningMode]]: - """Get available listening modes that match the current role (standalone, multichannel or both(all)). - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get available listening modes that match the current role (standalone, multichannel or both(all)). # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_listening_mode_set_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListeningMode]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_listening_mode_set_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get available listening modes that match the current role (standalone, multichannel or both(all)). - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_listening_mode_set_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "List[ListeningMode]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_listening_mode_set_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(List[ListeningMode], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_listening_mode_set" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/listening-modes", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "List[ListeningMode]", + } + + return await self.api_client.call_api( + "/api/v1/sound/listening-modes", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def get_sound_features( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Dict[str, SoundFeatureSet]: - """Get available sound features that match the current role (standalone or multichannel). + self, **kwargs + ) -> Dict[str, SoundFeatureSet]: # noqa: E501 + """Get available sound features that match the current role (standalone or multichannel). # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_sound_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, SoundFeatureSet]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: Dict[str, SoundFeatureSet] + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_sound_features_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_sound_features_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_sound_features_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Dict[str, SoundFeatureSet]]: - """Get available sound features that match the current role (standalone or multichannel). - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get available sound features that match the current role (standalone or multichannel). # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_sound_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, SoundFeatureSet]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_sound_features_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get available sound features that match the current role (standalone or multichannel). - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_sound_features_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "Dict[str, SoundFeatureSet]", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_sound_features_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(Dict[str, SoundFeatureSet], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_sound_features" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/features", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "Dict[str, SoundFeatureSet]", + } + + return await self.api_client.call_api( + "/api/v1/sound/features", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call - async def get_volume_settings( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VolumeSettings: - """Get the current volume settings for default and maximum volume level + @validate_arguments + async def get_volume_settings(self, **kwargs) -> VolumeSettings: # noqa: E501 + """Get the current volume settings for default and maximum volume level # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_volume_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: VolumeSettings + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_volume_settings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_volume_settings_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_volume_settings_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VolumeSettings]: - """Get the current volume settings for default and maximum volume level - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the current volume settings for default and maximum volume level # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_volume_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_volume_settings_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the current volume settings for default and maximum volume level - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_volume_settings_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "VolumeSettings", - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_volume_settings_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VolumeSettings, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_volume_settings" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/volume/settings", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "VolumeSettings", + "400": "ErrorModel", + } + + return await self.api_client.call_api( + "/api/v1/sound/volume/settings", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_current_volume_level( self, volume_level: Annotated[ - VolumeLevel, Field(description="The volume level to apply") + VolumeLevel, Field(..., description="The volume level to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the current volume level + **kwargs + ) -> None: # noqa: E501 + """Set the current volume level # noqa: E501 :param volume_level: The volume level to apply (required) :type volume_level: VolumeLevel - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_current_volume_level_serialize( - volume_level=volume_level, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_current_volume_level_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_current_volume_level_with_http_info( + volume_level, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_current_volume_level_with_http_info( self, volume_level: Annotated[ - VolumeLevel, Field(description="The volume level to apply") + VolumeLevel, Field(..., description="The volume level to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the current volume level + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the current volume level # noqa: E501 :param volume_level: The volume level to apply (required) :type volume_level: VolumeLevel + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_current_volume_level_serialize( - volume_level=volume_level, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_current_volume_level_without_preload_content( - self, - volume_level: Annotated[ - VolumeLevel, Field(description="The volume level to apply") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the current volume level - - - :param volume_level: The volume level to apply (required) - :type volume_level: VolumeLevel - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_current_volume_level_serialize( - volume_level=volume_level, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_current_volume_level_serialize( - self, - volume_level, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["volume_level"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_current_volume_level" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if volume_level is not None: - _body_params = volume_level + _body_params = None + if _params["volume_level"] is not None: + _body_params = _params["volume_level"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/volume/level", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/volume/level", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_sound_settings_adjustments_bass( - self, - bass: Annotated[Bass, Field(description="the bass level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the sound settings adjustments for bass + self, bass: Annotated[Bass, Field(..., description="the bass level")], **kwargs + ) -> None: # noqa: E501 + """Update the sound settings adjustments for bass # noqa: E501 :param bass: the bass level (required) :type bass: Bass - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_bass_serialize( - bass=bass, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_sound_settings_adjustments_bass_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_sound_settings_adjustments_bass_with_http_info( + bass, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_sound_settings_adjustments_bass_with_http_info( - self, - bass: Annotated[Bass, Field(description="the bass level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update the sound settings adjustments for bass + self, bass: Annotated[Bass, Field(..., description="the bass level")], **kwargs + ) -> ApiResponse: # noqa: E501 + """Update the sound settings adjustments for bass # noqa: E501 :param bass: the bass level (required) :type bass: Bass + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_bass_serialize( - bass=bass, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_sound_settings_adjustments_bass_without_preload_content( - self, - bass: Annotated[Bass, Field(description="the bass level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the sound settings adjustments for bass - - - :param bass: the bass level (required) - :type bass: Bass - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_bass_serialize( - bass=bass, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_sound_settings_adjustments_bass_serialize( - self, - bass, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + 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 + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["bass"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_sound_settings_adjustments_bass" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if bass is not None: - _body_params = bass + _body_params = None + if _params["bass"] is not None: + _body_params = _params["bass"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/settings/adjustments/bass", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/settings/adjustments/bass", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_sound_settings_adjustments_directivity( self, - directivity: Annotated[Directivity, Field(description="the directivity")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the sound settings adjustments for directivity + directivity: Annotated[Directivity, Field(..., description="the directivity")], + **kwargs + ) -> None: # noqa: E501 + """Update the sound settings adjustments for directivity # noqa: E501 :param directivity: the directivity (required) :type directivity: Directivity - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_directivity_serialize( - directivity=directivity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_sound_settings_adjustments_directivity_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_sound_settings_adjustments_directivity_with_http_info( + directivity, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_sound_settings_adjustments_directivity_with_http_info( self, - directivity: Annotated[Directivity, Field(description="the directivity")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update the sound settings adjustments for directivity - - - :param directivity: the directivity (required) - :type directivity: Directivity - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_directivity_serialize( - directivity=directivity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_sound_settings_adjustments_directivity_without_preload_content( - self, - directivity: Annotated[Directivity, Field(description="the directivity")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the sound settings adjustments for directivity + directivity: Annotated[Directivity, Field(..., description="the directivity")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Update the sound settings adjustments for directivity # noqa: E501 :param directivity: the directivity (required) :type directivity: Directivity + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_directivity_serialize( - directivity=directivity, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_sound_settings_adjustments_directivity_serialize( - self, - directivity, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["directivity"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_sound_settings_adjustments_directivity" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if directivity is not None: - _body_params = directivity + _body_params = None + if _params["directivity"] is not None: + _body_params = _params["directivity"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/settings/adjustments/directivity", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/settings/adjustments/directivity", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_sound_settings_adjustments_loudness( self, - loudness: Annotated[Loudness, Field(description="the loudness mode")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the sound settings adjustments for loudness + loudness: Annotated[Loudness, Field(..., description="the loudness mode")], + **kwargs + ) -> None: # noqa: E501 + """Update the sound settings adjustments for loudness # noqa: E501 :param loudness: the loudness mode (required) :type loudness: Loudness - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_loudness_serialize( - loudness=loudness, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_sound_settings_adjustments_loudness_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_sound_settings_adjustments_loudness_with_http_info( + loudness, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_sound_settings_adjustments_loudness_with_http_info( self, - loudness: Annotated[Loudness, Field(description="the loudness mode")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update the sound settings adjustments for loudness - - - :param loudness: the loudness mode (required) - :type loudness: Loudness - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_loudness_serialize( - loudness=loudness, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_sound_settings_adjustments_loudness_without_preload_content( - self, - loudness: Annotated[Loudness, Field(description="the loudness mode")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the sound settings adjustments for loudness + loudness: Annotated[Loudness, Field(..., description="the loudness mode")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Update the sound settings adjustments for loudness # noqa: E501 :param loudness: the loudness mode (required) :type loudness: Loudness + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_loudness_serialize( - loudness=loudness, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_sound_settings_adjustments_loudness_serialize( - self, - loudness, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["loudness"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_sound_settings_adjustments_loudness" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if loudness is not None: - _body_params = loudness + _body_params = None + if _params["loudness"] is not None: + _body_params = _params["loudness"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/settings/adjustments/loudness", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/settings/adjustments/loudness", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_sound_settings_adjustments_treble( self, - treble: Annotated[Treble, Field(description="the treble level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Update the sound settings adjustments for treble + treble: Annotated[Treble, Field(..., description="the treble level")], + **kwargs + ) -> None: # noqa: E501 + """Update the sound settings adjustments for treble # noqa: E501 :param treble: the treble level (required) :type treble: Treble - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_treble_serialize( - treble=treble, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_sound_settings_adjustments_treble_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_sound_settings_adjustments_treble_with_http_info( + treble, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_sound_settings_adjustments_treble_with_http_info( self, - treble: Annotated[Treble, Field(description="the treble level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Update the sound settings adjustments for treble - - - :param treble: the treble level (required) - :type treble: Treble - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_treble_serialize( - treble=treble, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_sound_settings_adjustments_treble_without_preload_content( - self, - treble: Annotated[Treble, Field(description="the treble level")], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Update the sound settings adjustments for treble + treble: Annotated[Treble, Field(..., description="the treble level")], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Update the sound settings adjustments for treble # noqa: E501 :param treble: the treble level (required) :type treble: Treble + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_sound_settings_adjustments_treble_serialize( - treble=treble, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_sound_settings_adjustments_treble_serialize( - self, - treble, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["treble"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_sound_settings_adjustments_treble" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if treble is not None: - _body_params = treble + _body_params = None + if _params["treble"] is not None: + _body_params = _params["treble"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/settings/adjustments/treble", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/settings/adjustments/treble", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_volume_mute( self, volume_mute: Annotated[ - VolumeMute, Field(description="The mute state to apply") + VolumeMute, Field(..., description="The mute state to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the volume mute state + **kwargs + ) -> None: # noqa: E501 + """Set the volume mute state # noqa: E501 :param volume_mute: The mute state to apply (required) :type volume_mute: VolumeMute - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_volume_mute_serialize( - volume_mute=volume_mute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_volume_mute_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_volume_mute_with_http_info( + volume_mute, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_volume_mute_with_http_info( self, volume_mute: Annotated[ - VolumeMute, Field(description="The mute state to apply") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the volume mute state - - - :param volume_mute: The mute state to apply (required) - :type volume_mute: VolumeMute - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_volume_mute_serialize( - volume_mute=volume_mute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_volume_mute_without_preload_content( - self, - volume_mute: Annotated[ - VolumeMute, Field(description="The mute state to apply") + VolumeMute, Field(..., description="The mute state to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the volume mute state + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the volume mute state # noqa: E501 :param volume_mute: The mute state to apply (required) :type volume_mute: VolumeMute + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_volume_mute_serialize( - volume_mute=volume_mute, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": None, - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_volume_mute_serialize( - self, - volume_mute, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["volume_mute"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_volume_mute" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if volume_mute is not None: - _body_params = volume_mute + _body_params = None + if _params["volume_mute"] is not None: + _body_params = _params["volume_mute"] # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/volume/mute", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/volume/mute", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) - @validate_call + @validate_arguments async def set_volume_settings( self, volume_settings: Annotated[ - VolumeSettings, Field(description="The settings to apply") + VolumeSettings, Field(..., description="The settings to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set the current volume settings for default and maximum volume level + **kwargs + ) -> None: # noqa: E501 + """Set the current volume settings for default and maximum volume level # noqa: E501 :param volume_settings: The settings to apply (required) :type volume_settings: VolumeSettings - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_volume_settings_serialize( - volume_settings=volume_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_volume_settings_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_volume_settings_with_http_info( + volume_settings, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_volume_settings_with_http_info( self, volume_settings: Annotated[ - VolumeSettings, Field(description="The settings to apply") - ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set the current volume settings for default and maximum volume level - - - :param volume_settings: The settings to apply (required) - :type volume_settings: VolumeSettings - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_volume_settings_serialize( - volume_settings=volume_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def set_volume_settings_without_preload_content( - self, - volume_settings: Annotated[ - VolumeSettings, Field(description="The settings to apply") + VolumeSettings, Field(..., description="The settings to apply") ], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set the current volume settings for default and maximum volume level + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the current volume settings for default and maximum volume level # noqa: E501 :param volume_settings: The settings to apply (required) :type volume_settings: VolumeSettings + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_volume_settings_serialize( - volume_settings=volume_settings, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "201": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_volume_settings_serialize( - self, - volume_settings, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["volume_settings"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] + ) + + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_volume_settings" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if volume_settings is not None: - _body_params = volume_settings + _body_params = None + if _params["volume_settings"] is not None: + _body_params = _params["volume_settings"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="PUT", - resource_path="/api/v1/sound/volume/settings", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/sound/volume/settings", + "PUT", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/speaker_group_api.py b/python_client/mozart_api/api/speaker_group_api.py index 48c0f24..3f82869 100644 --- a/python_client/mozart_api/api/speaker_group_api.py +++ b/python_client/mozart_api/api/speaker_group_api.py @@ -12,16 +12,19 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated + +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable from mozart_api.models.speaker_group_overview import SpeakerGroupOverview -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class SpeakerGroupApi: @@ -36,223 +39,122 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def get_speakergroup_active( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SpeakerGroupOverview: - """Get the active speaker group + self, **kwargs + ) -> SpeakerGroupOverview: # noqa: E501 + """Get the active speaker group # noqa: E501 - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._get_speakergroup_active_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SpeakerGroupOverview", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: SpeakerGroupOverview + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the get_speakergroup_active_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.get_speakergroup_active_with_http_info(**kwargs) # noqa: E501 + + @validate_arguments async def get_speakergroup_active_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SpeakerGroupOverview]: - """Get the active speaker group - - - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_speakergroup_active_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "SpeakerGroupOverview", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - @validate_call - async def get_speakergroup_active_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get the active speaker group - - + self, **kwargs + ) -> ApiResponse: # noqa: E501 + """Get the active speaker group # noqa: E501 + + + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_speakergroup_active_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(SpeakerGroupOverview, status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "200": "SpeakerGroupOverview", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _get_speakergroup_active_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_speakergroup_active" % _key + ) + _params[_key] = _val + del _params["kwargs"] - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters + _path_params = {} + # process the query parameters + _query_params = [] # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - + _body_params = None # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # authentication setting - _auth_settings: List[str] = [] + _auth_settings = [] # noqa: E501 + + _response_types_map = { + "200": "SpeakerGroupOverview", + } - return self.api_client.param_serialize( - method="GET", - resource_path="/api/v1/sound/speakergroup/active", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + return await self.api_client.call_api( + "/api/v1/sound/speakergroup/active", + "GET", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api/stand_api.py b/python_client/mozart_api/api/stand_api.py index 6c1eb4a..585ec52 100644 --- a/python_client/mozart_api/api/stand_api.py +++ b/python_client/mozart_api/api/stand_api.py @@ -12,19 +12,24 @@ Do not edit the class manually. """ # noqa: E501 + +import re # noqa: F401 +import io import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated +from pydantic import validate_arguments, ValidationError +from typing import overload, Optional, Union, Awaitable + +from typing_extensions import Annotated from pydantic import Field, StrictBool + from typing import Optional -from typing_extensions import Annotated + from mozart_api.models.stand_movement import StandMovement -from mozart_api.api_client import ApiClient, RequestSerialized +from mozart_api.api_client import ApiClient from mozart_api.api_response import ApiResponse -from mozart_api.rest import RESTResponseType +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 class StandApi: @@ -39,277 +44,160 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_call + @validate_arguments async def set_stand_movement( self, - stand_movement: Annotated[StandMovement, Field(description="Stand Movement")], + stand_movement: Annotated[ + StandMovement, Field(..., description="Stand Movement") + ], slow_speed: Annotated[ Optional[StrictBool], Field(description="Use slow speed on continuous movement"), ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Set stand movement with either an angle or a movement type + **kwargs + ) -> None: # noqa: E501 + """Set stand movement with either an angle or a movement type # noqa: E501 :param stand_movement: Stand Movement (required) :type stand_movement: StandMovement :param slow_speed: Use slow speed on continuous movement :type slow_speed: bool - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, 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. - """ # noqa: E501 - - _param = self._set_stand_movement_serialize( - stand_movement=stand_movement, - slow_speed=slow_speed, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - @validate_call + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs["_return_http_data_only"] = True + if "_preload_content" in kwargs: + message = "Error! Please call the set_stand_movement_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) + return await self.set_stand_movement_with_http_info( + stand_movement, slow_speed, **kwargs + ) # noqa: E501 + + @validate_arguments async def set_stand_movement_with_http_info( self, - stand_movement: Annotated[StandMovement, Field(description="Stand Movement")], + stand_movement: Annotated[ + StandMovement, Field(..., description="Stand Movement") + ], slow_speed: Annotated[ Optional[StrictBool], Field(description="Use slow speed on continuous movement"), ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Set stand movement with either an angle or a movement type + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set stand movement with either an angle or a movement type # noqa: E501 :param stand_movement: Stand Movement (required) :type stand_movement: StandMovement :param slow_speed: Use slow speed on continuous movement :type slow_speed: bool + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: 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. - :type _request_timeout: int, tuple(int, int), optional :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. + request; this effectively ignores the authentication + in the spec for a single request. :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional + :type _content_type: string, optional: force content-type for the request :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_stand_movement_serialize( - stand_movement=stand_movement, - slow_speed=slow_speed, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + _params = locals() + + _all_params = ["stand_movement", "slow_speed"] + _all_params.extend( + [ + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_request_auth", + "_content_type", + "_headers", + ] ) - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) + # validate the arguments + for _key, _val in _params["kwargs"].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method set_stand_movement" % _key + ) + _params[_key] = _val + del _params["kwargs"] - @validate_call - async def set_stand_movement_without_preload_content( - self, - stand_movement: Annotated[StandMovement, Field(description="Stand Movement")], - slow_speed: Annotated[ - Optional[StrictBool], - Field(description="Use slow speed on continuous movement"), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] - ], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Set stand movement with either an angle or a movement type - - - :param stand_movement: Stand Movement (required) - :type stand_movement: StandMovement - :param slow_speed: Use slow speed on continuous movement - :type slow_speed: bool - :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. - :type _request_timeout: int, tuple(int, int), optional - :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 - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_stand_movement_serialize( - stand_movement=stand_movement, - slow_speed=slow_speed, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "204": None, - "400": "ErrorModel", - } - response_data = await self.api_client.call_api( - *_param, _request_timeout=_request_timeout - ) - return response_data.response - - def _set_stand_movement_serialize( - self, - stand_movement, - slow_speed, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = {} - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None + _collection_formats = {} # process the path parameters - # process the query parameters - if slow_speed is not None: + _path_params = {} - _query_params.append(("slow-speed", slow_speed)) + # process the query parameters + _query_params = [] + if _params.get("slow_speed") is not None: # noqa: E501 + _query_params.append(("slow-speed", _params["slow_speed"])) # process the header parameters + _header_params = dict(_params.get("_headers", {})) # process the form parameters + _form_params = [] + _files = {} # process the body parameter - if stand_movement is not None: - _body_params = stand_movement + _body_params = None + if _params["stand_movement"] is not None: + _body_params = _params["stand_movement"] # set the HTTP header `Accept` _header_params["Accept"] = self.api_client.select_header_accept( ["application/json"] - ) + ) # noqa: E501 # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type( - ["application/json"] - ) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type + _content_types_list = _params.get( + "_content_type", + self.api_client.select_header_content_type(["application/json"]), + ) + if _content_types_list: + _header_params["Content-Type"] = _content_types_list # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="POST", - resource_path="/api/v1/stand/move", - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, + _auth_settings = [] # noqa: E501 + + _response_types_map = {} + + return await self.api_client.call_api( + "/api/v1/stand/move", + "POST", + _path_params, + _query_params, + _header_params, body=_body_params, post_params=_form_params, files=_files, + response_types_map=_response_types_map, auth_settings=_auth_settings, + _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 + _preload_content=_params.get("_preload_content", True), + _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth, + _request_auth=_params.get("_request_auth"), ) diff --git a/python_client/mozart_api/api_client.py b/python_client/mozart_api/api_client.py index feca01e..a99e3de 100644 --- a/python_client/mozart_api/api_client.py +++ b/python_client/mozart_api/api_client.py @@ -13,9 +13,9 @@ """ # noqa: E501 +import atexit import datetime from dateutil.parser import parse -from enum import Enum import json import mimetypes import os @@ -23,23 +23,12 @@ import tempfile from urllib.parse import quote -from typing import Tuple, Optional, List, Dict from mozart_api.configuration import Configuration -from mozart_api.api_response import ApiResponse, T as ApiResponseT +from mozart_api.api_response import ApiResponse import mozart_api.models from mozart_api import rest -from mozart_api.exceptions import ( - ApiValueError, - ApiException, - BadRequestException, - UnauthorizedException, - ForbiddenException, - NotFoundException, - ServiceException, -) - -RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] +from mozart_api.exceptions import ApiValueError, ApiException class ApiClient: @@ -85,7 +74,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/3.4.1.8.2/python" + self.user_agent = "OpenAPI-Generator/3.4.1.8.3/python" self.client_side_validation = configuration.client_side_validation async def __aenter__(self): @@ -135,42 +124,25 @@ def set_default(cls, default): """ cls._default = default - def param_serialize( + async def __call_api( self, - method, resource_path, + method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, + response_types_map=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, + _request_timeout=None, _host=None, _request_auth=None, - ) -> RequestSerialized: - """Builds the HTTP request params needed by the request. - :param method: Method to call. - :param resource_path: Path to method endpoint. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :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. - :return: tuple of form (path, http_method, query_params, header_params, - body, post_params, files) - """ + ): config = self.configuration @@ -230,100 +202,66 @@ def param_serialize( url_query = self.parameters_to_url_query(query_params, collection_formats) url += "?" + url_query - return method, url, header_params, body, post_params - - async def call_api( - self, - method, - url, - header_params=None, - body=None, - post_params=None, - _request_timeout=None, - ) -> rest.RESTResponse: - """Makes the HTTP request (synchronous) - :param method: Method to call. - :param url: Path to method endpoint. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param _request_timeout: timeout setting for this request. - :return: RESTResponse - """ - try: # perform request and return response - response_data = await self.rest_client.request( + response_data = await self.request( method, url, + query_params=query_params, headers=header_params, - body=body, post_params=post_params, + body=body, + _preload_content=_preload_content, _request_timeout=_request_timeout, ) - except ApiException as e: + if e.body: + e.body = e.body.decode("utf-8") raise e - return response_data - - def response_deserialize( - self, - response_data: rest.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]] = None, - ) -> ApiResponse[ApiResponseT]: - """Deserializes response into an object. - :param response_data: RESTResponse object to be deserialized. - :param response_types_map: dict of response types. - :return: ApiResponse - """ - - msg = "RESTResponse.read() must be called before passing it to response_deserialize()" - assert response_data.data is not None, msg - - response_type = response_types_map.get(str(response_data.status), None) - if ( - not response_type - and isinstance(response_data.status, int) - and 100 <= response_data.status <= 599 - ): - # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get( - str(response_data.status)[0] + "XX", None - ) + self.last_response = response_data + + return_data = None # assuming deserialization is not needed + # data needs deserialization or returns HTTP data (deserialized) only + if _preload_content or _return_http_data_only: + response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None + ) - # deserialize response data - response_text = None - return_data = None - try: if response_type == "bytearray": - return_data = response_data.data - elif response_type == "file": - return_data = self.__deserialize_file(response_data) - elif response_type is not None: + response_data.data = response_data.data + else: match = None content_type = response_data.getheader("content-type") if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" - response_text = response_data.data.decode(encoding) - return_data = self.deserialize(response_text, response_type) - finally: - if not 200 <= response_data.status <= 299: - raise ApiException.from_response( - http_resp=response_data, - body=response_text, - data=return_data, - ) + response_data.data = response_data.data.decode(encoding) - return ApiResponse( - status_code=response_data.status, - data=return_data, - headers=response_data.getheaders(), - raw_data=response_data.data, - ) + # deserialize response data + if response_type == "bytearray": + return_data = response_data.data + elif response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return return_data + else: + return ApiResponse( + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. @@ -350,7 +288,7 @@ def sanitize_for_serialization(self, obj): elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - elif isinstance(obj, dict): + if isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -364,7 +302,7 @@ def sanitize_for_serialization(self, obj): key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() } - def deserialize(self, response_text, response_type): + def deserialize(self, response, response_type): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. @@ -373,12 +311,16 @@ def deserialize(self, response_text, response_type): :return: deserialized object. """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) # fetch data from response object try: - data = json.loads(response_text) + data = json.loads(response.data) except ValueError: - data = response_text + data = response.data return self.__deserialize(data, response_type) @@ -395,15 +337,11 @@ def __deserialize(self, data, klass): if isinstance(klass, str): if klass.startswith("List["): - m = re.match(r"List\[(.*)]", klass) - assert m is not None, "Malformed List type definition" - sub_kls = m.group(1) + sub_kls = re.match(r"List\[(.*)]", klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith("Dict["): - m = re.match(r"Dict\[([^,]*), (.*)]", klass) - assert m is not None, "Malformed Dict type definition" - sub_kls = m.group(2) + sub_kls = re.match(r"Dict\[([^,]*), (.*)]", klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} # convert str to class @@ -420,11 +358,163 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) - elif issubclass(klass, Enum): - return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) + async def call_api( + self, + resource_path, + method, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + response_types_map=None, + auth_settings=None, + _return_http_data_only=None, + collection_formats=None, + _preload_content=True, + _request_timeout=None, + _host=None, + _request_auth=None, + ): + """Makes the HTTP request (synchronous) and returns deserialized data. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :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_token: dict, optional + :return: + The response. + """ + args = ( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_types_map, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + _request_auth, + ) + return await self.__call_api(*args) + + async def request( + self, + method, + url, + query_params=None, + headers=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return await self.rest_client.get_request( + url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers, + ) + elif method == "HEAD": + return await self.rest_client.head_request( + url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers, + ) + elif method == "OPTIONS": + return await self.rest_client.options_request( + url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + ) + elif method == "POST": + return await self.rest_client.post_request( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + elif method == "PUT": + return await self.rest_client.put_request( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + elif method == "PATCH": + return await self.rest_client.patch_request( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + elif method == "DELETE": + return await self.rest_client.delete_request( + url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -432,10 +522,12 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params: List[Tuple[str, str]] = [] + new_params = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: + for k, v in ( + params.items() if isinstance(params, dict) else params + ): # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": @@ -461,10 +553,12 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params: List[Tuple[str, str]] = [] + new_params = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: + for k, v in ( + params.items() if isinstance(params, dict) else params + ): # noqa: E501 if isinstance(v, bool): v = str(v).lower() if isinstance(v, (int, float)): @@ -518,14 +612,14 @@ def files_parameters(self, files=None): return params - def select_header_accept(self, accepts: List[str]) -> Optional[str]: + def select_header_accept(self, accepts): """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return None + return for accept in accepts: if re.search("json", accept, re.IGNORECASE): @@ -557,7 +651,7 @@ def update_params_for_auth( method, body, request_auth=None, - ) -> None: + ): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -577,17 +671,18 @@ def update_params_for_auth( self._apply_auth_params( headers, queries, resource_path, method, body, request_auth ) - else: - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting - ) + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, queries, resource_path, method, body, auth_setting + ) def _apply_auth_params( self, headers, queries, resource_path, method, body, auth_setting - ) -> None: + ): """Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. @@ -614,9 +709,6 @@ def __deserialize_file(self, response): Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. - handle file downloading - save response body into a tmp file and return the instance - :param response: RESTResponse. :return: file path. """ @@ -626,9 +718,9 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) - assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) + filename = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition + ).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -691,20 +783,6 @@ def __deserialize_datetime(self, string): reason=("Failed to parse `{0}` as datetime object".format(string)), ) - def __deserialize_enum(self, data, klass): - """Deserializes primitive type to enum. - - :param data: primitive type. - :param klass: class literal. - :return: enum value. - """ - try: - return klass(data) - except ValueError: - raise rest.ApiException( - status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)) - ) - def __deserialize_model(self, data, klass): """Deserializes list or dict to model. diff --git a/python_client/mozart_api/api_response.py b/python_client/mozart_api/api_response.py index 1ce1372..bb7e400 100644 --- a/python_client/mozart_api/api_response.py +++ b/python_client/mozart_api/api_response.py @@ -1,20 +1,28 @@ """API response object.""" from __future__ import annotations -from typing import Optional, Generic, Mapping, TypeVar -from pydantic import Field, StrictInt, StrictBytes, BaseModel +from typing import Any, Dict, Optional +from pydantic import Field, StrictInt, StrictStr -T = TypeVar("T") - -class ApiResponse(BaseModel, Generic[T]): +class ApiResponse: """ API response object """ - status_code: StrictInt = Field(description="HTTP status code") - headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") - data: T = Field(description="Deserialized data given the data type") - raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + status_code: Optional[StrictInt] = Field(None, description="HTTP status code") + headers: Optional[Dict[StrictStr, StrictStr]] = Field( + None, description="HTTP headers" + ) + data: Optional[Any] = Field( + None, description="Deserialized data given the data type" + ) + raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") - model_config = {"arbitrary_types_allowed": True} + def __init__( + self, status_code=None, headers=None, data=None, raw_data=None + ) -> None: + self.status_code = status_code + self.headers = headers + self.data = data + self.raw_data = raw_data diff --git a/python_client/mozart_api/configuration.py b/python_client/mozart_api/configuration.py index b5980e3..a6a20d5 100644 --- a/python_client/mozart_api/configuration.py +++ b/python_client/mozart_api/configuration.py @@ -15,9 +15,7 @@ import copy import logging -from logging import FileHandler import sys -from typing import Optional import urllib3 import http.client as httplib @@ -130,7 +128,7 @@ def __init__( self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler: Optional[FileHandler] = None + self.logger_file_handler = None """Log file handler """ self.logger_file = None @@ -167,7 +165,7 @@ def __init__( Default values is 100, None means no-limit. """ - self.proxy: Optional[str] = None + self.proxy = None """Proxy URL """ self.proxy_headers = None @@ -383,7 +381,7 @@ def to_debug_report(self): "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: 0.2.0\n" - "SDK Package Version: 3.4.1.8.2".format( + "SDK Package Version: 3.4.1.8.3".format( env=sys.platform, pyversion=sys.version ) ) diff --git a/python_client/mozart_api/exceptions.py b/python_client/mozart_api/exceptions.py index 641b207..430a9e2 100644 --- a/python_client/mozart_api/exceptions.py +++ b/python_client/mozart_api/exceptions.py @@ -12,9 +12,6 @@ Do not edit the class manually. """ # noqa: E501 -from typing import Any, Optional -from typing_extensions import Self - class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -106,56 +103,17 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): - def __init__( - self, - status=None, - reason=None, - http_resp=None, - *, - body: Optional[str] = None, - data: Optional[Any] = None, - ) -> None: - self.status = status - self.reason = reason - self.body = body - self.data = data - self.headers = None - + def __init__(self, status=None, reason=None, http_resp=None) -> None: if http_resp: - if self.status is None: - self.status = http_resp.status - if self.reason is None: - self.reason = http_resp.reason - if self.body is None: - try: - self.body = http_resp.data.decode("utf-8") - except Exception: - pass + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data self.headers = http_resp.getheaders() - - @classmethod - def from_response( - cls, - *, - http_resp, - body: Optional[str], - data: Optional[Any], - ) -> Self: - if http_resp.status == 400: - raise BadRequestException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 401: - raise UnauthorizedException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 403: - raise ForbiddenException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 404: - raise NotFoundException(http_resp=http_resp, body=body, data=data) - - if 500 <= http_resp.status <= 599: - raise ServiceException(http_resp=http_resp, body=body, data=data) - raise ApiException(http_resp=http_resp, body=body, data=data) + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None def __str__(self): """Custom error messages for exception""" @@ -163,30 +121,40 @@ def __str__(self): if self.headers: error_message += "HTTP response headers: {0}\n".format(self.headers) - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) return error_message class BadRequestException(ApiException): - pass + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - pass + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(NotFoundException, self).__init__(status, reason, http_resp) class UnauthorizedException(ApiException): - pass + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(UnauthorizedException, self).__init__(status, reason, http_resp) class ForbiddenException(ApiException): - pass + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(ForbiddenException, self).__init__(status, reason, http_resp) class ServiceException(ApiException): - pass + + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(ServiceException, self).__init__(status, reason, http_resp) def render_path(path_to_item): diff --git a/python_client/mozart_api/models/action.py b/python_client/mozart_api/models/action.py index 22c506d..7b9dbc0 100644 --- a/python_client/mozart_api/models/action.py +++ b/python_client/mozart_api/models/action.py @@ -18,80 +18,69 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing_extensions import Annotated + +from typing import Optional, Union +from pydantic import BaseModel, Field, StrictStr, confloat, conint, validator from mozart_api.models.play_queue_item import PlayQueueItem from mozart_api.models.play_queue_settings import PlayQueueSettings from mozart_api.models.source_type_enum import SourceTypeEnum from mozart_api.models.stand_position import StandPosition -from typing import Optional, Set -from typing_extensions import Self class Action(BaseModel): """ - An action object. Examples: RadioAction: ```json { \"type\": \"radio\", \"radioStationId\": \"8779112938791514\" } ``` ToneAction: ```json { \"type\": \"tone\", \"toneName\": \"alarm_2\" } ``` SourcePresetAction: ```json { \"type\": \"sourcePreset\", \"source\": { \"value\": \"spotify\" }, \"presetKey\": \"Preset3\" } ``` DeezerFlowAction: ```json { \"type\": \"deezerFlow\", \"deezerUserId\": \"1234\" } ``` ActivateSourceAction: ```json { \"type\": \"activateSource\", \"source\": { \"value\": \"spotify\" } } ``` PlayQueueAction: ``` { \"type\": \"playQueue\", \"queueItem\": { \"provider\": { \"value\": \"deezer\" }, \"startNowFromPosition\": 0, \"type\": \"playlist\", \"uri\": \"playlist:8074581462\" }, \"queueSettings\": { \"consume\": false, \"repeat\": \"none\", \"shuffle\": false } } ``` StandbyAction: ```json { \"type\": \"standby\" } ``` AllStandbyAction: ```json { \"type\": \"allStandby\" } ``` TouchToJoinAction: ```json { \"type\": \"touchToJoin\" } ``` ButtonShortPressAction: ```json { \"type\": \"buttonShortPress\", \"buttonName\": \"preset1\" } ``` FallbackAction: ```json { \"type\": \"fallback\" } ``` VolumeAction: ```json { \"type\": \"volume\", \"volumeLevel\": 25 } ``` StopAction: ```json { \"type\": \"stop\", \"stopDuration\": 1300 } ``` TriggerContentAction: ```json { \"contentId\": \"tv://netflix\", \"type\": \"triggerContent\" } ``` SpeakerGroupAction: ```json { \"type\": \"speakerGroup\", \"speakerGroupId\": \"00112233-4455-6677-8899-aabbccddeeff\" } ``` ListeningModeAction: ```json { \"type\": \"listeningMode\", \"listeningModeId\": 1234 } ``` StandAction: ```json { \"type\": \"stand\", \"standPosition\": { \"angle\": 7.5 } } ``` GainAction: ```json { \"type\": \"sourceGain\", \"source\": { \"value\": \"spotify\" }, \"gainDb\": 1.0 } ``` - """ # noqa: E501 + An action object. Examples: RadioAction: ```json { \"type\": \"radio\", \"radioStationId\": \"8779112938791514\" } ``` ToneAction: ```json { \"type\": \"tone\", \"toneName\": \"alarm_2\" } ``` SourcePresetAction: ```json { \"type\": \"sourcePreset\", \"source\": { \"value\": \"spotify\" }, \"presetKey\": \"Preset3\" } ``` DeezerFlowAction: ```json { \"type\": \"deezerFlow\", \"deezerUserId\": \"1234\" } ``` ActivateSourceAction: ```json { \"type\": \"activateSource\", \"source\": { \"value\": \"spotify\" } } ``` PlayQueueAction: ``` { \"type\": \"playQueue\", \"queueItem\": { \"provider\": { \"value\": \"deezer\" }, \"startNowFromPosition\": 0, \"type\": \"playlist\", \"uri\": \"playlist:8074581462\" }, \"queueSettings\": { \"consume\": false, \"repeat\": \"none\", \"shuffle\": false } } ``` StandbyAction: ```json { \"type\": \"standby\" } ``` AllStandbyAction: ```json { \"type\": \"allStandby\" } ``` TouchToJoinAction: ```json { \"type\": \"touchToJoin\" } ``` ButtonShortPressAction: ```json { \"type\": \"buttonShortPress\", \"buttonName\": \"preset1\" } ``` FallbackAction: ```json { \"type\": \"fallback\" } ``` VolumeAction: ```json { \"type\": \"volume\", \"volumeLevel\": 25 } ``` StopAction: ```json { \"type\": \"stop\", \"stopDuration\": 1300 } ``` TriggerContentAction: ```json { \"contentId\": \"tv://netflix\", \"type\": \"triggerContent\" } ``` SpeakerGroupAction: ```json { \"type\": \"speakerGroup\", \"speakerGroupId\": \"00112233-4455-6677-8899-aabbccddeeff\" } ``` ListeningModeAction: ```json { \"type\": \"listeningMode\", \"listeningModeId\": 1234 } ``` StandAction: ```json { \"type\": \"stand\", \"standPosition\": { \"angle\": 7.5 } } ``` GainAction: ```json { \"type\": \"sourceGain\", \"source\": { \"value\": \"spotify\" }, \"gainDb\": 1.0 } ``` # noqa: E501 + """ button_name: Optional[StrictStr] = Field( - default=None, - description="Name of the Button used for button-press types ('buttonShortPress')", + None, alias="buttonName", + description="Name of the Button used for button-press types ('buttonShortPress')", ) content_id: Optional[StrictStr] = Field( - default=None, - description="Id of content only used for 'type=triggerContent'", + None, alias="contentId", + description="Id of content only used for 'type=triggerContent'", ) deezer_user_id: Optional[StrictStr] = Field( - default=None, - description="Id of user only used for 'type=deezerFlow' and is optional", + None, alias="deezerUserId", + description="Id of user only used for 'type=deezerFlow' and is optional", ) gain_db: Optional[ - Union[ - Annotated[float, Field(le=12, strict=True, ge=-12)], - Annotated[int, Field(le=12, strict=True, ge=-12)], - ] - ] = Field( - default=None, description="Only usef for 'type=sourceGain'", alias="gainDb" - ) - listening_mode_id: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( - default=None, alias="listeningModeId" + Union[confloat(le=12, ge=-12, strict=True), conint(le=12, ge=-12, strict=True)] + ] = Field(None, alias="gainDb", description="Only usef for 'type=sourceGain'") + listening_mode_id: Optional[conint(strict=True, ge=0)] = Field( + None, alias="listeningModeId" ) preset_key: Optional[StrictStr] = Field( - default=None, description="Only used for 'type=sourcePreset'", alias="presetKey" - ) - queue_item: Optional[PlayQueueItem] = Field(default=None, alias="queueItem") - queue_settings: Optional[PlayQueueSettings] = Field( - default=None, alias="queueSettings" + None, alias="presetKey", description="Only used for 'type=sourcePreset'" ) + queue_item: Optional[PlayQueueItem] = Field(None, alias="queueItem") + queue_settings: Optional[PlayQueueSettings] = Field(None, alias="queueSettings") radio_station_id: Optional[StrictStr] = Field( - default=None, - description="Id of RadioStation only used for 'type=radio'", + None, alias="radioStationId", + description="Id of RadioStation only used for 'type=radio'", ) source: Optional[SourceTypeEnum] = None - speaker_group_id: Optional[StrictStr] = Field(default=None, alias="speakerGroupId") - stand_position: Optional[StandPosition] = Field(default=None, alias="standPosition") - stop_duration: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( - default=None, - description="The duration to wait (seconds) until stopping only used for 'type=stop'", + speaker_group_id: Optional[StrictStr] = Field(None, alias="speakerGroupId") + stand_position: Optional[StandPosition] = Field(None, alias="standPosition") + stop_duration: Optional[conint(strict=True, ge=0)] = Field( + None, alias="stopDuration", + description="The duration to wait (seconds) until stopping only used for 'type=stop'", ) tone_name: Optional[StrictStr] = Field( - default=None, - description="Name of the tone only used for 'type=tone'", - alias="toneName", + None, alias="toneName", description="Name of the tone only used for 'type=tone'" ) - type: StrictStr = Field(description="The type of Action") - volume_level: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field( - default=None, - description="The volume level to configure only used for 'type=volume'", + type: StrictStr = Field(..., description="The type of Action") + volume_level: Optional[conint(strict=True, le=100, ge=0)] = Field( + None, alias="volumeLevel", + description="The volume level to configure only used for 'type=volume'", ) - __properties: ClassVar[List[str]] = [ + __properties = [ "buttonName", "contentId", "deezerUserId", @@ -110,95 +99,78 @@ class Action(BaseModel): "volumeLevel", ] - @field_validator("button_name") + @validator("button_name") def button_name_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["preset1", "preset2", "preset3", "preset4"]): + if value not in ("preset1", "preset2", "preset3", "preset4"): raise ValueError( "must be one of enum values ('preset1', 'preset2', 'preset3', 'preset4')" ) return value - @field_validator("tone_name") + @validator("tone_name") def tone_name_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["alarm_1", "alarm_2"]): + if value not in ("alarm_1", "alarm_2"): raise ValueError("must be one of enum values ('alarm_1', 'alarm_2')") return value - @field_validator("type") + @validator("type") def type_validate_enum(cls, value): """Validates the enum""" - if value not in set( - [ - "standby", - "tone", - "radio", - "sourcePreset", - "deezerFlow", - "activateSource", - "playQueue", - "buttonShortPress", - "allStandby", - "touchToJoin", - "fallback", - "volume", - "stop", - "triggerContent", - "speakerGroup", - "listeningMode", - "stand", - "sourceGain", - ] + if value not in ( + "standby", + "tone", + "radio", + "sourcePreset", + "deezerFlow", + "activateSource", + "playQueue", + "buttonShortPress", + "allStandby", + "touchToJoin", + "fallback", + "volume", + "stop", + "triggerContent", + "speakerGroup", + "listeningMode", + "stand", + "sourceGain", ): raise ValueError( "must be one of enum values ('standby', 'tone', 'radio', 'sourcePreset', 'deezerFlow', 'activateSource', 'playQueue', 'buttonShortPress', 'allStandby', 'touchToJoin', 'fallback', 'volume', 'stop', 'triggerContent', 'speakerGroup', 'listeningMode', 'stand', 'sourceGain')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Action: """Create an instance of Action from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of queue_item if self.queue_item: _dict["queueItem"] = self.queue_item.to_dict() @@ -212,93 +184,90 @@ def to_dict(self) -> Dict[str, Any]: if self.stand_position: _dict["standPosition"] = self.stand_position.to_dict() # set to None if button_name (nullable) is None - # and model_fields_set contains the field - if self.button_name is None and "button_name" in self.model_fields_set: + # and __fields_set__ contains the field + if self.button_name is None and "button_name" in self.__fields_set__: _dict["buttonName"] = None # set to None if content_id (nullable) is None - # and model_fields_set contains the field - if self.content_id is None and "content_id" in self.model_fields_set: + # and __fields_set__ contains the field + if self.content_id is None and "content_id" in self.__fields_set__: _dict["contentId"] = None # set to None if deezer_user_id (nullable) is None - # and model_fields_set contains the field - if self.deezer_user_id is None and "deezer_user_id" in self.model_fields_set: + # and __fields_set__ contains the field + if self.deezer_user_id is None and "deezer_user_id" in self.__fields_set__: _dict["deezerUserId"] = None # set to None if preset_key (nullable) is None - # and model_fields_set contains the field - if self.preset_key is None and "preset_key" in self.model_fields_set: + # and __fields_set__ contains the field + if self.preset_key is None and "preset_key" in self.__fields_set__: _dict["presetKey"] = None # set to None if radio_station_id (nullable) is None - # and model_fields_set contains the field - if ( - self.radio_station_id is None - and "radio_station_id" in self.model_fields_set - ): + # and __fields_set__ contains the field + if self.radio_station_id is None and "radio_station_id" in self.__fields_set__: _dict["radioStationId"] = None # set to None if stop_duration (nullable) is None - # and model_fields_set contains the field - if self.stop_duration is None and "stop_duration" in self.model_fields_set: + # and __fields_set__ contains the field + if self.stop_duration is None and "stop_duration" in self.__fields_set__: _dict["stopDuration"] = None # set to None if tone_name (nullable) is None - # and model_fields_set contains the field - if self.tone_name is None and "tone_name" in self.model_fields_set: + # and __fields_set__ contains the field + if self.tone_name is None and "tone_name" in self.__fields_set__: _dict["toneName"] = None # set to None if volume_level (nullable) is None - # and model_fields_set contains the field - if self.volume_level is None and "volume_level" in self.model_fields_set: + # and __fields_set__ contains the field + if self.volume_level is None and "volume_level" in self.__fields_set__: _dict["volumeLevel"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Action: """Create an instance of Action from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Action.parse_obj(obj) - _obj = cls.model_validate( + _obj = Action.parse_obj( { - "buttonName": obj.get("buttonName"), - "contentId": obj.get("contentId"), - "deezerUserId": obj.get("deezerUserId"), - "gainDb": obj.get("gainDb"), - "listeningModeId": obj.get("listeningModeId"), - "presetKey": obj.get("presetKey"), - "queueItem": ( - PlayQueueItem.from_dict(obj["queueItem"]) + "button_name": obj.get("buttonName"), + "content_id": obj.get("contentId"), + "deezer_user_id": obj.get("deezerUserId"), + "gain_db": obj.get("gainDb"), + "listening_mode_id": obj.get("listeningModeId"), + "preset_key": obj.get("presetKey"), + "queue_item": ( + PlayQueueItem.from_dict(obj.get("queueItem")) if obj.get("queueItem") is not None else None ), - "queueSettings": ( - PlayQueueSettings.from_dict(obj["queueSettings"]) + "queue_settings": ( + PlayQueueSettings.from_dict(obj.get("queueSettings")) if obj.get("queueSettings") is not None else None ), - "radioStationId": obj.get("radioStationId"), + "radio_station_id": obj.get("radioStationId"), "source": ( - SourceTypeEnum.from_dict(obj["source"]) + SourceTypeEnum.from_dict(obj.get("source")) if obj.get("source") is not None else None ), - "speakerGroupId": obj.get("speakerGroupId"), - "standPosition": ( - StandPosition.from_dict(obj["standPosition"]) + "speaker_group_id": obj.get("speakerGroupId"), + "stand_position": ( + StandPosition.from_dict(obj.get("standPosition")) if obj.get("standPosition") is not None else None ), - "stopDuration": obj.get("stopDuration"), - "toneName": obj.get("toneName"), + "stop_duration": obj.get("stopDuration"), + "tone_name": obj.get("toneName"), "type": obj.get("type"), - "volumeLevel": obj.get("volumeLevel"), + "volume_level": obj.get("volumeLevel"), } ) return _obj diff --git a/python_client/mozart_api/models/alarm_timer_event_data.py b/python_client/mozart_api/models/alarm_timer_event_data.py index 939dd74..c69d569 100644 --- a/python_client/mozart_api/models/alarm_timer_event_data.py +++ b/python_client/mozart_api/models/alarm_timer_event_data.py @@ -18,91 +18,75 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class AlarmTimerEventData(BaseModel): """ AlarmTimerEventData - """ # noqa: E501 + """ event: Optional[StrictStr] = None id: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["event", "id", "type"] + __properties = ["event", "id", "type"] - @field_validator("event") + @validator("event") def event_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["add", "update", "delete"]): + if value not in ("add", "update", "delete"): raise ValueError("must be one of enum values ('add', 'update', 'delete')") return value - @field_validator("type") + @validator("type") def type_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["alarm", "timer"]): + if value not in ("alarm", "timer"): raise ValueError("must be one of enum values ('alarm', 'timer')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> AlarmTimerEventData: """Create an instance of AlarmTimerEventData from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> AlarmTimerEventData: """Create an instance of AlarmTimerEventData from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return AlarmTimerEventData.parse_obj(obj) - _obj = cls.model_validate( + _obj = AlarmTimerEventData.parse_obj( {"event": obj.get("event"), "id": obj.get("id"), "type": obj.get("type")} ) return _obj diff --git a/python_client/mozart_api/models/alarm_triggered_info.py b/python_client/mozart_api/models/alarm_triggered_info.py index bc26a6d..edb007e 100644 --- a/python_client/mozart_api/models/alarm_triggered_info.py +++ b/python_client/mozart_api/models/alarm_triggered_info.py @@ -18,71 +18,56 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, constr class AlarmTriggeredInfo(BaseModel): """ AlarmTriggeredInfo - """ # noqa: E501 + """ id: Optional[StrictStr] = None - label: Optional[Annotated[str, Field(strict=True, max_length=128)]] = Field( - default=None, description="Label for an alarm" + label: Optional[constr(strict=True, max_length=128)] = Field( + None, description="Label for an alarm" ) - __properties: ClassVar[List[str]] = ["id", "label"] + __properties = ["id", "label"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> AlarmTriggeredInfo: """Create an instance of AlarmTriggeredInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> AlarmTriggeredInfo: """Create an instance of AlarmTriggeredInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return AlarmTriggeredInfo.parse_obj(obj) - _obj = cls.model_validate({"id": obj.get("id"), "label": obj.get("label")}) + _obj = AlarmTriggeredInfo.parse_obj( + {"id": obj.get("id"), "label": obj.get("label")} + ) return _obj diff --git a/python_client/mozart_api/models/ambience.py b/python_client/mozart_api/models/ambience.py index dcf4037..70ccf97 100644 --- a/python_client/mozart_api/models/ambience.py +++ b/python_client/mozart_api/models/ambience.py @@ -18,67 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class Ambience(BaseModel): """ Ambience - """ # noqa: E501 - - value: Union[StrictFloat, StrictInt] = Field(description="Selected ambience value") - __properties: ClassVar[List[str]] = ["value"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected ambience value" ) + __properties = ["value"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Ambience: """Create an instance of Ambience from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Ambience: """Create an instance of Ambience from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Ambience.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = Ambience.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/ambience_feature.py b/python_client/mozart_api/models/ambience_feature.py index df9542b..2a45e40 100644 --- a/python_client/mozart_api/models/ambience_feature.py +++ b/python_client/mozart_api/models/ambience_feature.py @@ -18,62 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.ambience import Ambience -from typing import Optional, Set -from typing_extensions import Self class AmbienceFeature(BaseModel): """ AmbienceFeature - """ # noqa: E501 + """ - value: Union[StrictFloat, StrictInt] = Field(description="Selected ambience value") - default: Ambience - range: List[Ambience] = Field( - description="Product and role specific ambience range" + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected ambience value" ) - __properties: ClassVar[List[str]] = ["value", "default", "range"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: Ambience = Field(...) + range: conlist(Ambience, unique_items=True) = Field( + ..., description="Product and role specific ambience range" ) + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> AmbienceFeature: """Create an instance of AmbienceFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -87,24 +73,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> AmbienceFeature: """Create an instance of AmbienceFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return AmbienceFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = AmbienceFeature.parse_obj( { "value": obj.get("value"), "default": ( - Ambience.from_dict(obj["default"]) + Ambience.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Ambience.from_dict(_item) for _item in obj["range"]] + [Ambience.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/ambience_range.py b/python_client/mozart_api/models/ambience_range.py index fd64b43..b2c5f6b 100644 --- a/python_client/mozart_api/models/ambience_range.py +++ b/python_client/mozart_api/models/ambience_range.py @@ -18,61 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.ambience import Ambience -from typing import Optional, Set -from typing_extensions import Self class AmbienceRange(BaseModel): """ AmbienceRange - """ # noqa: E501 + """ - default: Ambience - range: List[Ambience] = Field( - description="Product and role specific ambience range" + default: Ambience = Field(...) + range: conlist(Ambience, unique_items=True) = Field( + ..., description="Product and role specific ambience range" ) - __properties: ClassVar[List[str]] = ["default", "range"] + __properties = ["default", "range"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> AmbienceRange: """Create an instance of AmbienceRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -86,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> AmbienceRange: """Create an instance of AmbienceRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return AmbienceRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = AmbienceRange.parse_obj( { "default": ( - Ambience.from_dict(obj["default"]) + Ambience.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Ambience.from_dict(_item) for _item in obj["range"]] + [Ambience.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/art.py b/python_client/mozart_api/models/art.py index 94495aa..d429fb5 100644 --- a/python_client/mozart_api/models/art.py +++ b/python_client/mozart_api/models/art.py @@ -18,75 +18,59 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr class Art(BaseModel): """ Art - """ # noqa: E501 + """ - has_local_image: Optional[StrictBool] = Field(default=None, alias="hasLocalImage") + has_local_image: Optional[StrictBool] = Field(None, alias="hasLocalImage") key: Optional[StrictStr] = None size: Optional[StrictStr] = None type: Optional[StrictStr] = None url: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["hasLocalImage", "key", "size", "type", "url"] + __properties = ["hasLocalImage", "key", "size", "type", "url"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Art: """Create an instance of Art from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Art: """Create an instance of Art from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Art.parse_obj(obj) - _obj = cls.model_validate( + _obj = Art.parse_obj( { - "hasLocalImage": obj.get("hasLocalImage"), + "has_local_image": obj.get("hasLocalImage"), "key": obj.get("key"), "size": obj.get("size"), "type": obj.get("type"), diff --git a/python_client/mozart_api/models/balance.py b/python_client/mozart_api/models/balance.py index 266e3ff..a22556b 100644 --- a/python_client/mozart_api/models/balance.py +++ b/python_client/mozart_api/models/balance.py @@ -18,67 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class Balance(BaseModel): """ Balance - """ # noqa: E501 - - value: Union[StrictFloat, StrictInt] = Field(description="Selected balance value") - __properties: ClassVar[List[str]] = ["value"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected balance value" ) + __properties = ["value"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Balance: """Create an instance of Balance from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Balance: """Create an instance of Balance from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Balance.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = Balance.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/balance_feature.py b/python_client/mozart_api/models/balance_feature.py index 5f10979..ccdad6e 100644 --- a/python_client/mozart_api/models/balance_feature.py +++ b/python_client/mozart_api/models/balance_feature.py @@ -18,60 +18,46 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.balance import Balance -from typing import Optional, Set -from typing_extensions import Self class BalanceFeature(BaseModel): """ BalanceFeature - """ # noqa: E501 - - value: Union[StrictFloat, StrictInt] = Field(description="Selected balance value") - default: Balance - range: List[Balance] = Field(description="balance range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected balance value" ) + default: Balance = Field(...) + range: conlist(Balance, unique_items=True) = Field(..., description="balance range") + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BalanceFeature: """Create an instance of BalanceFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -85,24 +71,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BalanceFeature: """Create an instance of BalanceFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BalanceFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = BalanceFeature.parse_obj( { "value": obj.get("value"), "default": ( - Balance.from_dict(obj["default"]) + Balance.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Balance.from_dict(_item) for _item in obj["range"]] + [Balance.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/balance_range.py b/python_client/mozart_api/models/balance_range.py index 0e9d5c1..031b1ce 100644 --- a/python_client/mozart_api/models/balance_range.py +++ b/python_client/mozart_api/models/balance_range.py @@ -18,59 +18,43 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.balance import Balance -from typing import Optional, Set -from typing_extensions import Self class BalanceRange(BaseModel): """ BalanceRange - """ # noqa: E501 + """ - default: Balance - range: List[Balance] = Field(description="balance range") - __properties: ClassVar[List[str]] = ["default", "range"] + default: Balance = Field(...) + range: conlist(Balance, unique_items=True) = Field(..., description="balance range") + __properties = ["default", "range"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BalanceRange: """Create an instance of BalanceRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +68,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BalanceRange: """Create an instance of BalanceRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BalanceRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = BalanceRange.parse_obj( { "default": ( - Balance.from_dict(obj["default"]) + Balance.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Balance.from_dict(_item) for _item in obj["range"]] + [Balance.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/bass.py b/python_client/mozart_api/models/bass.py index af68301..ca8f949 100644 --- a/python_client/mozart_api/models/bass.py +++ b/python_client/mozart_api/models/bass.py @@ -18,67 +18,50 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictInt class Bass(BaseModel): """ Bass - """ # noqa: E501 + """ + + value: StrictInt = Field(..., description="Selected bass value") + __properties = ["value"] - value: StrictInt = Field(description="Selected bass value") - __properties: ClassVar[List[str]] = ["value"] + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Bass: """Create an instance of Bass from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Bass: """Create an instance of Bass from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Bass.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = Bass.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/bass_feature.py b/python_client/mozart_api/models/bass_feature.py index 5a25baf..b97e0e1 100644 --- a/python_client/mozart_api/models/bass_feature.py +++ b/python_client/mozart_api/models/bass_feature.py @@ -18,60 +18,46 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, StrictInt, conlist from mozart_api.models.bass import Bass -from typing import Optional, Set -from typing_extensions import Self class BassFeature(BaseModel): """ BassFeature - """ # noqa: E501 - - value: StrictInt = Field(description="Selected bass value") - default: Bass - range: List[Bass] = Field(description="Product and role specific bass range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + value: StrictInt = Field(..., description="Selected bass value") + default: Bass = Field(...) + range: conlist(Bass, unique_items=True) = Field( + ..., description="Product and role specific bass range" ) + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BassFeature: """Create an instance of BassFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -85,24 +71,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BassFeature: """Create an instance of BassFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BassFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = BassFeature.parse_obj( { "value": obj.get("value"), "default": ( - Bass.from_dict(obj["default"]) + Bass.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Bass.from_dict(_item) for _item in obj["range"]] + [Bass.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/bass_management.py b/python_client/mozart_api/models/bass_management.py index cfc004f..c6db048 100644 --- a/python_client/mozart_api/models/bass_management.py +++ b/python_client/mozart_api/models/bass_management.py @@ -18,74 +18,57 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr, validator class BassManagement(BaseModel): """ BassManagement - """ # noqa: E501 + """ - value: StrictStr = Field(description="Selected bass-management value") - __properties: ClassVar[List[str]] = ["value"] + value: StrictStr = Field(..., description="Selected bass-management value") + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set(["on", "off"]): + if value not in ("on", "off"): raise ValueError("must be one of enum values ('on', 'off')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BassManagement: """Create an instance of BassManagement from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BassManagement: """Create an instance of BassManagement from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BassManagement.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = BassManagement.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/bass_management_feature.py b/python_client/mozart_api/models/bass_management_feature.py index 8a83e1f..5dbacb6 100644 --- a/python_client/mozart_api/models/bass_management_feature.py +++ b/python_client/mozart_api/models/bass_management_feature.py @@ -18,67 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator from mozart_api.models.bass_management import BassManagement -from typing import Optional, Set -from typing_extensions import Self class BassManagementFeature(BaseModel): """ BassManagementFeature - """ # noqa: E501 + """ - value: StrictStr = Field(description="Selected bass-management value") - default: BassManagement - range: List[BassManagement] = Field(description="bass-management range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] + value: StrictStr = Field(..., description="Selected bass-management value") + default: BassManagement = Field(...) + range: conlist(BassManagement, unique_items=True) = Field( + ..., description="bass-management range" + ) + __properties = ["value", "default", "range"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set(["on", "off"]): + if value not in ("on", "off"): raise ValueError("must be one of enum values ('on', 'off')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BassManagementFeature: """Create an instance of BassManagementFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -92,24 +78,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BassManagementFeature: """Create an instance of BassManagementFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BassManagementFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = BassManagementFeature.parse_obj( { "value": obj.get("value"), "default": ( - BassManagement.from_dict(obj["default"]) + BassManagement.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [BassManagement.from_dict(_item) for _item in obj["range"]] + [BassManagement.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/bass_management_range.py b/python_client/mozart_api/models/bass_management_range.py index d6506ae..ef7fff7 100644 --- a/python_client/mozart_api/models/bass_management_range.py +++ b/python_client/mozart_api/models/bass_management_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.bass_management import BassManagement -from typing import Optional, Set -from typing_extensions import Self class BassManagementRange(BaseModel): """ BassManagementRange - """ # noqa: E501 - - default: BassManagement - range: List[BassManagement] = Field(description="bass-management range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: BassManagement = Field(...) + range: conlist(BassManagement, unique_items=True) = Field( + ..., description="bass-management range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BassManagementRange: """Create an instance of BassManagementRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BassManagementRange: """Create an instance of BassManagementRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BassManagementRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = BassManagementRange.parse_obj( { "default": ( - BassManagement.from_dict(obj["default"]) + BassManagement.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [BassManagement.from_dict(_item) for _item in obj["range"]] + [BassManagement.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/bass_range.py b/python_client/mozart_api/models/bass_range.py index 667cb4a..781de0a 100644 --- a/python_client/mozart_api/models/bass_range.py +++ b/python_client/mozart_api/models/bass_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.bass import Bass -from typing import Optional, Set -from typing_extensions import Self class BassRange(BaseModel): """ BassRange - """ # noqa: E501 - - default: Bass - range: List[Bass] = Field(description="Product and role specific bass range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: Bass = Field(...) + range: conlist(Bass, unique_items=True) = Field( + ..., description="Product and role specific bass range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BassRange: """Create an instance of BassRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BassRange: """Create an instance of BassRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BassRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = BassRange.parse_obj( { "default": ( - Bass.from_dict(obj["default"]) + Bass.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Bass.from_dict(_item) for _item in obj["range"]] + [Bass.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/battery_state.py b/python_client/mozart_api/models/battery_state.py index 0ef8716..3217799 100644 --- a/python_client/mozart_api/models/battery_state.py +++ b/python_client/mozart_api/models/battery_state.py @@ -18,92 +18,80 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictInt class BatteryState(BaseModel): """ BatteryState - """ # noqa: E501 + """ battery_level: Optional[StrictInt] = Field( - default=None, description="Batterylevel in percent ", alias="batteryLevel" + None, alias="batteryLevel", description="Batterylevel in percent " ) - is_charging: Optional[StrictBool] = Field(default=None, alias="isCharging") + is_charging: Optional[StrictBool] = Field(None, alias="isCharging") remaining_charging_time_minutes: Optional[StrictInt] = Field( - default=None, - description="Remaining charging time in minutes", + None, alias="remainingChargingTimeMinutes", + description="Remaining charging time in minutes", ) remaining_playing_time_minutes: Optional[StrictInt] = Field( - default=None, - description="Remaining playing time in minutes", + None, alias="remainingPlayingTimeMinutes", + description="Remaining playing time in minutes", ) - __properties: ClassVar[List[str]] = [ + __properties = [ "batteryLevel", "isCharging", "remainingChargingTimeMinutes", "remainingPlayingTimeMinutes", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BatteryState: """Create an instance of BatteryState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BatteryState: """Create an instance of BatteryState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BatteryState.parse_obj(obj) - _obj = cls.model_validate( + _obj = BatteryState.parse_obj( { - "batteryLevel": obj.get("batteryLevel"), - "isCharging": obj.get("isCharging"), - "remainingChargingTimeMinutes": obj.get("remainingChargingTimeMinutes"), - "remainingPlayingTimeMinutes": obj.get("remainingPlayingTimeMinutes"), + "battery_level": obj.get("batteryLevel"), + "is_charging": obj.get("isCharging"), + "remaining_charging_time_minutes": obj.get( + "remainingChargingTimeMinutes" + ), + "remaining_playing_time_minutes": obj.get( + "remainingPlayingTimeMinutes" + ), } ) return _obj diff --git a/python_client/mozart_api/models/beo_remote_button.py b/python_client/mozart_api/models/beo_remote_button.py index 09e00b8..7cd87a9 100644 --- a/python_client/mozart_api/models/beo_remote_button.py +++ b/python_client/mozart_api/models/beo_remote_button.py @@ -18,78 +18,64 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator class BeoRemoteButton(BaseModel): """ BeoRemoteButton - """ # noqa: E501 + """ - key: Optional[StrictStr] = Field(default=None, alias="Key") - type: Optional[StrictStr] = Field(default=None, alias="Type") - __properties: ClassVar[List[str]] = ["Key", "Type"] + key: Optional[StrictStr] = Field(None, alias="Key") + type: Optional[StrictStr] = Field(None, alias="Type") + __properties = ["Key", "Type"] - @field_validator("type") + @validator("type") def type_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["KeyPress", "KeyRelease"]): + if value not in ("KeyPress", "KeyRelease"): raise ValueError("must be one of enum values ('KeyPress', 'KeyRelease')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeoRemoteButton: """Create an instance of BeoRemoteButton from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeoRemoteButton: """Create an instance of BeoRemoteButton from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeoRemoteButton.parse_obj(obj) - _obj = cls.model_validate({"Key": obj.get("Key"), "Type": obj.get("Type")}) + _obj = BeoRemoteButton.parse_obj( + {"key": obj.get("Key"), "type": obj.get("Type")} + ) return _obj diff --git a/python_client/mozart_api/models/beolink_available_listener.py b/python_client/mozart_api/models/beolink_available_listener.py index 1a481ab..39fb649 100644 --- a/python_client/mozart_api/models/beolink_available_listener.py +++ b/python_client/mozart_api/models/beolink_available_listener.py @@ -18,67 +18,50 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr class BeolinkAvailableListener(BaseModel): """ BeolinkAvailableListener - """ # noqa: E501 + """ + + jid: StrictStr = Field(..., description="Beolink peer ID") + __properties = ["jid"] - jid: StrictStr = Field(description="Beolink peer ID") - __properties: ClassVar[List[str]] = ["jid"] + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeolinkAvailableListener: """Create an instance of BeolinkAvailableListener from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeolinkAvailableListener: """Create an instance of BeolinkAvailableListener from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeolinkAvailableListener.parse_obj(obj) - _obj = cls.model_validate({"jid": obj.get("jid")}) + _obj = BeolinkAvailableListener.parse_obj({"jid": obj.get("jid")}) return _obj diff --git a/python_client/mozart_api/models/beolink_experience.py b/python_client/mozart_api/models/beolink_experience.py index 036c56d..ba0cb1a 100644 --- a/python_client/mozart_api/models/beolink_experience.py +++ b/python_client/mozart_api/models/beolink_experience.py @@ -18,50 +18,42 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, validator class BeolinkExperience(BaseModel): """ BeolinkExperience - """ # noqa: E501 + """ - category: StrictStr = Field(description="Source category") - id: StrictStr = Field(description='experience id, e.g. "RADIO" or "toslink"') + category: StrictStr = Field(..., description="Source category") + id: StrictStr = Field(..., description='experience id, e.g. "RADIO" or "toslink"') linkable: StrictBool = Field( - description='Linkable means "Does pressing play on this source make sense"' + ..., description='Linkable means "Does pressing play on this source make sense"' ) name: StrictStr = Field( - description='Experience name, e.g. "Bluetooth" or "B&O Radio"' + ..., description='Experience name, e.g. "Bluetooth" or "B&O Radio"' ) product_friendly_name: Optional[StrictStr] = Field( - default=None, - description="Optional product friendly name", - alias="productFriendlyName", + None, alias="productFriendlyName", description="Optional product friendly name" ) source_friendly_name: Optional[StrictStr] = Field( - default=None, - description="Optional friendly name for source", + None, alias="sourceFriendlyName", + description="Optional friendly name for source", ) type: StrictStr = Field( - description="Source type. This corresponds to the exhaustive list or sources provided by the control layer" + ..., + description="Source type. This corresponds to the exhaustive list or sources provided by the control layer", ) unique_source_id: StrictStr = Field( - description="The actual device jabber id that the experience comes from", + ..., alias="uniqueSourceId", + description="The actual device jabber id that the experience comes from", ) - __properties: ClassVar[List[str]] = [ + __properties = [ "category", "id", "linkable", @@ -72,73 +64,58 @@ class BeolinkExperience(BaseModel): "uniqueSourceId", ] - @field_validator("category") + @validator("category") def category_validate_enum(cls, value): """Validates the enum""" - if value not in set(["TV", "RADIO", "MUSIC", "MEDIA", "UNKNOWN"]): + if value not in ("TV", "RADIO", "MUSIC", "MEDIA", "UNKNOWN"): raise ValueError( "must be one of enum values ('TV', 'RADIO', 'MUSIC', 'MEDIA', 'UNKNOWN')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeolinkExperience: """Create an instance of BeolinkExperience from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeolinkExperience: """Create an instance of BeolinkExperience from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeolinkExperience.parse_obj(obj) - _obj = cls.model_validate( + _obj = BeolinkExperience.parse_obj( { "category": obj.get("category"), "id": obj.get("id"), "linkable": obj.get("linkable"), "name": obj.get("name"), - "productFriendlyName": obj.get("productFriendlyName"), - "sourceFriendlyName": obj.get("sourceFriendlyName"), + "product_friendly_name": obj.get("productFriendlyName"), + "source_friendly_name": obj.get("sourceFriendlyName"), "type": obj.get("type"), - "uniqueSourceId": obj.get("uniqueSourceId"), + "unique_source_id": obj.get("uniqueSourceId"), } ) return _obj diff --git a/python_client/mozart_api/models/beolink_experiences_result.py b/python_client/mozart_api/models/beolink_experiences_result.py index a2ceb99..00bdfe0 100644 --- a/python_client/mozart_api/models/beolink_experiences_result.py +++ b/python_client/mozart_api/models/beolink_experiences_result.py @@ -18,69 +18,56 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator from mozart_api.models.beolink_experience import BeolinkExperience -from typing import Optional, Set -from typing_extensions import Self class BeolinkExperiencesResult(BaseModel): """ BeolinkExperiencesResult - """ # noqa: E501 + """ - experiences: List[BeolinkExperience] - request_id: StrictStr = Field(description="Beolink request ID", alias="requestID") + experiences: conlist(BeolinkExperience) = Field(...) + request_id: StrictStr = Field( + ..., alias="requestID", description="Beolink request ID" + ) status: StrictStr = Field( - description="Current scan status. * busy: there is another scan in progress * timeout: the scan timed out. The results will be partial " + ..., + description="Current scan status. * busy: there is another scan in progress * timeout: the scan timed out. The results will be partial ", ) - __properties: ClassVar[List[str]] = ["experiences", "requestID", "status"] + __properties = ["experiences", "requestID", "status"] - @field_validator("status") + @validator("status") def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(["ok", "busy", "timeout"]): + if value not in ("ok", "busy", "timeout"): raise ValueError("must be one of enum values ('ok', 'busy', 'timeout')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeolinkExperiencesResult: """Create an instance of BeolinkExperiencesResult from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in experiences (list) _items = [] if self.experiences: @@ -91,22 +78,25 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeolinkExperiencesResult: """Create an instance of BeolinkExperiencesResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeolinkExperiencesResult.parse_obj(obj) - _obj = cls.model_validate( + _obj = BeolinkExperiencesResult.parse_obj( { "experiences": ( - [BeolinkExperience.from_dict(_item) for _item in obj["experiences"]] + [ + BeolinkExperience.from_dict(_item) + for _item in obj.get("experiences") + ] if obj.get("experiences") is not None else None ), - "requestID": obj.get("requestID"), + "request_id": obj.get("requestID"), "status": obj.get("status"), } ) diff --git a/python_client/mozart_api/models/beolink_join_request.py b/python_client/mozart_api/models/beolink_join_request.py index 5270f8c..91a38bf 100644 --- a/python_client/mozart_api/models/beolink_join_request.py +++ b/python_client/mozart_api/models/beolink_join_request.py @@ -18,74 +18,60 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class BeolinkJoinRequest(BaseModel): """ BeolinkJoinRequest - """ # noqa: E501 - - jid: Optional[StrictStr] = Field(default=None, description="Beolink peer ID") - request_id: StrictStr = Field(description="Beolink request ID", alias="requestID") - result: StrictStr = Field(description="Relative URL of the join result") - __properties: ClassVar[List[str]] = ["jid", "requestID", "result"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + jid: Optional[StrictStr] = Field(None, description="Beolink peer ID") + request_id: StrictStr = Field( + ..., alias="requestID", description="Beolink request ID" ) + result: StrictStr = Field(..., description="Relative URL of the join result") + __properties = ["jid", "requestID", "result"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeolinkJoinRequest: """Create an instance of BeolinkJoinRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeolinkJoinRequest: """Create an instance of BeolinkJoinRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeolinkJoinRequest.parse_obj(obj) - _obj = cls.model_validate( + _obj = BeolinkJoinRequest.parse_obj( { "jid": obj.get("jid"), - "requestID": obj.get("requestID"), + "request_id": obj.get("requestID"), "result": obj.get("result"), } ) diff --git a/python_client/mozart_api/models/beolink_join_result.py b/python_client/mozart_api/models/beolink_join_result.py index 1b822af..5d00e2c 100644 --- a/python_client/mozart_api/models/beolink_join_result.py +++ b/python_client/mozart_api/models/beolink_join_result.py @@ -18,116 +18,102 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator class BeolinkJoinResult(BaseModel): """ BeolinkJoinResult - """ # noqa: E501 + """ - error: Optional[StrictStr] = Field(default=None, description="Join error") - jid: StrictStr = Field(description="Beolink peer ID") - request_id: StrictStr = Field(description="Beolink request ID", alias="requestID") - status: StrictStr = Field(description="Overall join status") - type: StrictStr = Field(description="The type of join request this is a result of") - __properties: ClassVar[List[str]] = ["error", "jid", "requestID", "status", "type"] + error: Optional[StrictStr] = Field(None, description="Join error") + jid: StrictStr = Field(..., description="Beolink peer ID") + request_id: StrictStr = Field( + ..., alias="requestID", description="Beolink request ID" + ) + status: StrictStr = Field(..., description="Overall join status") + type: StrictStr = Field( + ..., description="The type of join request this is a result of" + ) + __properties = ["error", "jid", "requestID", "status", "type"] - @field_validator("error") + @validator("error") def error_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "ok", - "busy", - "leaderless", - "alone", - "silent", - "missing", - "rejected", - "timeout", - ] + if value not in ( + "ok", + "busy", + "leaderless", + "alone", + "silent", + "missing", + "rejected", + "timeout", ): raise ValueError( "must be one of enum values ('ok', 'busy', 'leaderless', 'alone', 'silent', 'missing', 'rejected', 'timeout')" ) return value - @field_validator("status") + @validator("status") def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(["idle", "joined", "failed"]): + if value not in ("idle", "joined", "failed"): raise ValueError("must be one of enum values ('idle', 'joined', 'failed')") return value - @field_validator("type") + @validator("type") def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(["join", "joinRequested", "expand", "expandRequested"]): + if value not in ("join", "joinRequested", "expand", "expandRequested"): raise ValueError( "must be one of enum values ('join', 'joinRequested', 'expand', 'expandRequested')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeolinkJoinResult: """Create an instance of BeolinkJoinResult from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeolinkJoinResult: """Create an instance of BeolinkJoinResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeolinkJoinResult.parse_obj(obj) - _obj = cls.model_validate( + _obj = BeolinkJoinResult.parse_obj( { "error": obj.get("error"), "jid": obj.get("jid"), - "requestID": obj.get("requestID"), + "request_id": obj.get("requestID"), "status": obj.get("status"), "type": obj.get("type"), } diff --git a/python_client/mozart_api/models/beolink_leader.py b/python_client/mozart_api/models/beolink_leader.py index 1eb3408..1ca4d49 100644 --- a/python_client/mozart_api/models/beolink_leader.py +++ b/python_client/mozart_api/models/beolink_leader.py @@ -18,70 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr class BeolinkLeader(BaseModel): """ BeolinkLeader - """ # noqa: E501 + """ - friendly_name: StrictStr = Field(alias="friendlyName") - jid: StrictStr = Field(description="Beolink peer ID") - __properties: ClassVar[List[str]] = ["friendlyName", "jid"] + friendly_name: StrictStr = Field(..., alias="friendlyName") + jid: StrictStr = Field(..., description="Beolink peer ID") + __properties = ["friendlyName", "jid"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeolinkLeader: """Create an instance of BeolinkLeader from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeolinkLeader: """Create an instance of BeolinkLeader from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeolinkLeader.parse_obj(obj) - _obj = cls.model_validate( - {"friendlyName": obj.get("friendlyName"), "jid": obj.get("jid")} + _obj = BeolinkLeader.parse_obj( + {"friendly_name": obj.get("friendlyName"), "jid": obj.get("jid")} ) return _obj diff --git a/python_client/mozart_api/models/beolink_listener.py b/python_client/mozart_api/models/beolink_listener.py index c0d2d0e..9266bfb 100644 --- a/python_client/mozart_api/models/beolink_listener.py +++ b/python_client/mozart_api/models/beolink_listener.py @@ -18,67 +18,50 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr class BeolinkListener(BaseModel): """ BeolinkListener - """ # noqa: E501 + """ + + jid: StrictStr = Field(..., description="Beolink peer ID") + __properties = ["jid"] - jid: StrictStr = Field(description="Beolink peer ID") - __properties: ClassVar[List[str]] = ["jid"] + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeolinkListener: """Create an instance of BeolinkListener from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeolinkListener: """Create an instance of BeolinkListener from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeolinkListener.parse_obj(obj) - _obj = cls.model_validate({"jid": obj.get("jid")}) + _obj = BeolinkListener.parse_obj({"jid": obj.get("jid")}) return _obj diff --git a/python_client/mozart_api/models/beolink_peer.py b/python_client/mozart_api/models/beolink_peer.py index 7b6093c..dcb8fd5 100644 --- a/python_client/mozart_api/models/beolink_peer.py +++ b/python_client/mozart_api/models/beolink_peer.py @@ -18,70 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr class BeolinkPeer(BaseModel): """ BeolinkPeer - """ # noqa: E501 + """ - friendly_name: StrictStr = Field(alias="friendlyName") - jid: StrictStr = Field(description="Beolink peer ID") - __properties: ClassVar[List[str]] = ["friendlyName", "jid"] + friendly_name: StrictStr = Field(..., alias="friendlyName") + jid: StrictStr = Field(..., description="Beolink peer ID") + __properties = ["friendlyName", "jid"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BeolinkPeer: """Create an instance of BeolinkPeer from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BeolinkPeer: """Create an instance of BeolinkPeer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BeolinkPeer.parse_obj(obj) - _obj = cls.model_validate( - {"friendlyName": obj.get("friendlyName"), "jid": obj.get("jid")} + _obj = BeolinkPeer.parse_obj( + {"friendly_name": obj.get("friendlyName"), "jid": obj.get("jid")} ) return _obj diff --git a/python_client/mozart_api/models/bluetooth_device.py b/python_client/mozart_api/models/bluetooth_device.py index fd256df..cd9c9f6 100644 --- a/python_client/mozart_api/models/bluetooth_device.py +++ b/python_client/mozart_api/models/bluetooth_device.py @@ -18,71 +18,55 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictBool, StrictStr class BluetoothDevice(BaseModel): """ BluetoothDevice - """ # noqa: E501 + """ address: Optional[StrictStr] = None connected: Optional[StrictBool] = None name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["address", "connected", "name"] + __properties = ["address", "connected", "name"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BluetoothDevice: """Create an instance of BluetoothDevice from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BluetoothDevice: """Create an instance of BluetoothDevice from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BluetoothDevice.parse_obj(obj) - _obj = cls.model_validate( + _obj = BluetoothDevice.parse_obj( { "address": obj.get("address"), "connected": obj.get("connected"), diff --git a/python_client/mozart_api/models/bluetooth_device_list.py b/python_client/mozart_api/models/bluetooth_device_list.py index 2d994f5..7088c36 100644 --- a/python_client/mozart_api/models/bluetooth_device_list.py +++ b/python_client/mozart_api/models/bluetooth_device_list.py @@ -18,58 +18,42 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, conlist from mozart_api.models.bluetooth_device import BluetoothDevice -from typing import Optional, Set -from typing_extensions import Self class BluetoothDeviceList(BaseModel): """ BluetoothDeviceList - """ # noqa: E501 + """ - items: Optional[List[BluetoothDevice]] = None - __properties: ClassVar[List[str]] = ["items"] + items: Optional[conlist(BluetoothDevice)] = None + __properties = ["items"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> BluetoothDeviceList: """Create an instance of BluetoothDeviceList from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in items (list) _items = [] if self.items: @@ -80,18 +64,18 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> BluetoothDeviceList: """Create an instance of BluetoothDeviceList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return BluetoothDeviceList.parse_obj(obj) - _obj = cls.model_validate( + _obj = BluetoothDeviceList.parse_obj( { "items": ( - [BluetoothDevice.from_dict(_item) for _item in obj["items"]] + [BluetoothDevice.from_dict(_item) for _item in obj.get("items")] if obj.get("items") is not None else None ) diff --git a/python_client/mozart_api/models/button_event.py b/python_client/mozart_api/models/button_event.py index f8f6ae8..796d500 100644 --- a/python_client/mozart_api/models/button_event.py +++ b/python_client/mozart_api/models/button_event.py @@ -18,74 +18,54 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class ButtonEvent(BaseModel): """ ButtonEvent - """ # noqa: E501 - - button: Optional[StrictStr] = Field( - default=None, description="identifies the button" - ) - state: Optional[StrictStr] = Field( - default=None, description="identifies the state change" - ) - __properties: ClassVar[List[str]] = ["button", "state"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + """ + + button: Optional[StrictStr] = Field(None, description="identifies the button") + state: Optional[StrictStr] = Field(None, description="identifies the state change") + __properties = ["button", "state"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ButtonEvent: """Create an instance of ButtonEvent from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ButtonEvent: """Create an instance of ButtonEvent from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ButtonEvent.parse_obj(obj) - _obj = cls.model_validate( + _obj = ButtonEvent.parse_obj( {"button": obj.get("button"), "state": obj.get("state")} ) return _obj diff --git a/python_client/mozart_api/models/compression.py b/python_client/mozart_api/models/compression.py index f0cc294..9d61858 100644 --- a/python_client/mozart_api/models/compression.py +++ b/python_client/mozart_api/models/compression.py @@ -18,74 +18,57 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr, validator class Compression(BaseModel): """ Compression - """ # noqa: E501 + """ - value: StrictStr = Field(description="Selected compression value") - __properties: ClassVar[List[str]] = ["value"] + value: StrictStr = Field(..., description="Selected compression value") + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set(["off", "medium", "maximum"]): + if value not in ("off", "medium", "maximum"): raise ValueError("must be one of enum values ('off', 'medium', 'maximum')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Compression: """Create an instance of Compression from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Compression: """Create an instance of Compression from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Compression.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = Compression.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/compression_feature.py b/python_client/mozart_api/models/compression_feature.py index 90268b1..c0184ee 100644 --- a/python_client/mozart_api/models/compression_feature.py +++ b/python_client/mozart_api/models/compression_feature.py @@ -18,67 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator from mozart_api.models.compression import Compression -from typing import Optional, Set -from typing_extensions import Self class CompressionFeature(BaseModel): """ CompressionFeature - """ # noqa: E501 + """ - value: StrictStr = Field(description="Selected compression value") - default: Compression - range: List[Compression] = Field(description="compression range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] + value: StrictStr = Field(..., description="Selected compression value") + default: Compression = Field(...) + range: conlist(Compression, unique_items=True) = Field( + ..., description="compression range" + ) + __properties = ["value", "default", "range"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set(["off", "medium", "maximum"]): + if value not in ("off", "medium", "maximum"): raise ValueError("must be one of enum values ('off', 'medium', 'maximum')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> CompressionFeature: """Create an instance of CompressionFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -92,24 +78,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> CompressionFeature: """Create an instance of CompressionFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return CompressionFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = CompressionFeature.parse_obj( { "value": obj.get("value"), "default": ( - Compression.from_dict(obj["default"]) + Compression.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Compression.from_dict(_item) for _item in obj["range"]] + [Compression.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/compression_range.py b/python_client/mozart_api/models/compression_range.py index 39eecbc..c41eb05 100644 --- a/python_client/mozart_api/models/compression_range.py +++ b/python_client/mozart_api/models/compression_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.compression import Compression -from typing import Optional, Set -from typing_extensions import Self class CompressionRange(BaseModel): """ CompressionRange - """ # noqa: E501 - - default: Compression - range: List[Compression] = Field(description="compression range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: Compression = Field(...) + range: conlist(Compression, unique_items=True) = Field( + ..., description="compression range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> CompressionRange: """Create an instance of CompressionRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> CompressionRange: """Create an instance of CompressionRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return CompressionRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = CompressionRange.parse_obj( { "default": ( - Compression.from_dict(obj["default"]) + Compression.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Compression.from_dict(_item) for _item in obj["range"]] + [Compression.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/content_item.py b/python_client/mozart_api/models/content_item.py index 73abc45..03b4733 100644 --- a/python_client/mozart_api/models/content_item.py +++ b/python_client/mozart_api/models/content_item.py @@ -18,100 +18,84 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist, validator from mozart_api.models.source_type_enum import SourceTypeEnum -from typing import Optional, Set -from typing_extensions import Self class ContentItem(BaseModel): """ ContentItem - """ # noqa: E501 + """ - categories: Optional[List[StrictStr]] = None - content_uri: StrictStr = Field(alias="contentUri") + categories: Optional[conlist(StrictStr)] = None + content_uri: StrictStr = Field(..., alias="contentUri") label: Optional[StrictStr] = None - source: SourceTypeEnum - __properties: ClassVar[List[str]] = ["categories", "contentUri", "label", "source"] + source: SourceTypeEnum = Field(...) + __properties = ["categories", "contentUri", "label", "source"] - @field_validator("categories") + @validator("categories") def categories_validate_enum(cls, value): """Validates the enum""" if value is None: return value for i in value: - if i not in set(["music", "movie", "tv", "hdmi", "app"]): + if i not in ("music", "movie", "tv", "hdmi", "app"): raise ValueError( "each list item must be one of ('music', 'movie', 'tv', 'hdmi', 'app')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ContentItem: """Create an instance of ContentItem from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of source if self.source: _dict["source"] = self.source.to_dict() # set to None if label (nullable) is None - # and model_fields_set contains the field - if self.label is None and "label" in self.model_fields_set: + # and __fields_set__ contains the field + if self.label is None and "label" in self.__fields_set__: _dict["label"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ContentItem: """Create an instance of ContentItem from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ContentItem.parse_obj(obj) - _obj = cls.model_validate( + _obj = ContentItem.parse_obj( { "categories": obj.get("categories"), - "contentUri": obj.get("contentUri"), + "content_uri": obj.get("contentUri"), "label": obj.get("label"), "source": ( - SourceTypeEnum.from_dict(obj["source"]) + SourceTypeEnum.from_dict(obj.get("source")) if obj.get("source") is not None else None ), diff --git a/python_client/mozart_api/models/directivity.py b/python_client/mozart_api/models/directivity.py index 314b948..544eb3d 100644 --- a/python_client/mozart_api/models/directivity.py +++ b/python_client/mozart_api/models/directivity.py @@ -18,78 +18,67 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr, validator class Directivity(BaseModel): """ Directivity - """ # noqa: E501 + """ - value: StrictStr - __properties: ClassVar[List[str]] = ["value"] + value: StrictStr = Field(...) + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set( - ["front", "left", "right", "omni", "narrow", "wide", "standalone"] + if value not in ( + "front", + "left", + "right", + "omni", + "narrow", + "wide", + "standalone", ): raise ValueError( "must be one of enum values ('front', 'left', 'right', 'omni', 'narrow', 'wide', 'standalone')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Directivity: """Create an instance of Directivity from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Directivity: """Create an instance of Directivity from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Directivity.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = Directivity.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/directivity_feature.py b/python_client/mozart_api/models/directivity_feature.py index df0590d..53f4f36 100644 --- a/python_client/mozart_api/models/directivity_feature.py +++ b/python_client/mozart_api/models/directivity_feature.py @@ -18,73 +18,63 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator from mozart_api.models.directivity import Directivity -from typing import Optional, Set -from typing_extensions import Self class DirectivityFeature(BaseModel): """ DirectivityFeature - """ # noqa: E501 + """ - value: StrictStr - default: Directivity - range: List[Directivity] = Field( - description="Product and role specific list of directivities" + value: StrictStr = Field(...) + default: Directivity = Field(...) + range: conlist(Directivity, unique_items=True) = Field( + ..., description="Product and role specific list of directivities" ) - __properties: ClassVar[List[str]] = ["value", "default", "range"] + __properties = ["value", "default", "range"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set( - ["front", "left", "right", "omni", "narrow", "wide", "standalone"] + if value not in ( + "front", + "left", + "right", + "omni", + "narrow", + "wide", + "standalone", ): raise ValueError( "must be one of enum values ('front', 'left', 'right', 'omni', 'narrow', 'wide', 'standalone')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> DirectivityFeature: """Create an instance of DirectivityFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -98,24 +88,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> DirectivityFeature: """Create an instance of DirectivityFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return DirectivityFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = DirectivityFeature.parse_obj( { "value": obj.get("value"), "default": ( - Directivity.from_dict(obj["default"]) + Directivity.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Directivity.from_dict(_item) for _item in obj["range"]] + [Directivity.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/directivity_range.py b/python_client/mozart_api/models/directivity_range.py index 833051f..01734f2 100644 --- a/python_client/mozart_api/models/directivity_range.py +++ b/python_client/mozart_api/models/directivity_range.py @@ -18,61 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.directivity import Directivity -from typing import Optional, Set -from typing_extensions import Self class DirectivityRange(BaseModel): """ DirectivityRange - """ # noqa: E501 + """ - default: Directivity - range: List[Directivity] = Field( - description="Product and role specific list of directivities" + default: Directivity = Field(...) + range: conlist(Directivity, unique_items=True) = Field( + ..., description="Product and role specific list of directivities" ) - __properties: ClassVar[List[str]] = ["default", "range"] + __properties = ["default", "range"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> DirectivityRange: """Create an instance of DirectivityRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -86,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> DirectivityRange: """Create an instance of DirectivityRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return DirectivityRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = DirectivityRange.parse_obj( { "default": ( - Directivity.from_dict(obj["default"]) + Directivity.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Directivity.from_dict(_item) for _item in obj["range"]] + [Directivity.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/error_model.py b/python_client/mozart_api/models/error_model.py index f88e076..0a896c1 100644 --- a/python_client/mozart_api/models/error_model.py +++ b/python_client/mozart_api/models/error_model.py @@ -18,87 +18,71 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class ErrorModel(BaseModel): """ - the general error model - """ # noqa: E501 + the general error model # noqa: E501 + """ error_code: Optional[StrictStr] = Field( - default=None, - description="A wellknown code that signal the error, can be used by callers ", + None, alias="errorCode", + description="A wellknown code that signal the error, can be used by callers ", ) error_id: Optional[StrictStr] = Field( - default=None, - description="A unique identifier used to e.g. quick find in logs ", + None, alias="errorId", + description="A unique identifier used to e.g. quick find in logs ", ) error_message: Optional[StrictStr] = Field( - default=None, - description="A textual representation, human readable and suitable for logs ", + None, alias="errorMessage", + description="A textual representation, human readable and suitable for logs ", ) - __properties: ClassVar[List[str]] = ["errorCode", "errorId", "errorMessage"] + __properties = ["errorCode", "errorId", "errorMessage"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ErrorModel: """Create an instance of ErrorModel from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ErrorModel: """Create an instance of ErrorModel from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ErrorModel.parse_obj(obj) - _obj = cls.model_validate( + _obj = ErrorModel.parse_obj( { - "errorCode": obj.get("errorCode"), - "errorId": obj.get("errorId"), - "errorMessage": obj.get("errorMessage"), + "error_code": obj.get("errorCode"), + "error_id": obj.get("errorId"), + "error_message": obj.get("errorMessage"), } ) return _obj diff --git a/python_client/mozart_api/models/fader.py b/python_client/mozart_api/models/fader.py index 2ee7b9a..19b3145 100644 --- a/python_client/mozart_api/models/fader.py +++ b/python_client/mozart_api/models/fader.py @@ -18,67 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class Fader(BaseModel): """ Fader - """ # noqa: E501 - - value: Union[StrictFloat, StrictInt] = Field(description="Selected fader value") - __properties: ClassVar[List[str]] = ["value"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected fader value" ) + __properties = ["value"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Fader: """Create an instance of Fader from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Fader: """Create an instance of Fader from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Fader.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = Fader.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/fader_feature.py b/python_client/mozart_api/models/fader_feature.py index ffa9edd..f93f068 100644 --- a/python_client/mozart_api/models/fader_feature.py +++ b/python_client/mozart_api/models/fader_feature.py @@ -18,60 +18,46 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.fader import Fader -from typing import Optional, Set -from typing_extensions import Self class FaderFeature(BaseModel): """ FaderFeature - """ # noqa: E501 - - value: Union[StrictFloat, StrictInt] = Field(description="Selected fader value") - default: Fader - range: List[Fader] = Field(description="fader range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected fader value" ) + default: Fader = Field(...) + range: conlist(Fader, unique_items=True) = Field(..., description="fader range") + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> FaderFeature: """Create an instance of FaderFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -85,24 +71,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> FaderFeature: """Create an instance of FaderFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return FaderFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = FaderFeature.parse_obj( { "value": obj.get("value"), "default": ( - Fader.from_dict(obj["default"]) + Fader.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Fader.from_dict(_item) for _item in obj["range"]] + [Fader.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/fader_range.py b/python_client/mozart_api/models/fader_range.py index 1279448..f8c545b 100644 --- a/python_client/mozart_api/models/fader_range.py +++ b/python_client/mozart_api/models/fader_range.py @@ -18,59 +18,43 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.fader import Fader -from typing import Optional, Set -from typing_extensions import Self class FaderRange(BaseModel): """ FaderRange - """ # noqa: E501 + """ - default: Fader - range: List[Fader] = Field(description="fader range") - __properties: ClassVar[List[str]] = ["default", "range"] + default: Fader = Field(...) + range: conlist(Fader, unique_items=True) = Field(..., description="fader range") + __properties = ["default", "range"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> FaderRange: """Create an instance of FaderRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +68,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> FaderRange: """Create an instance of FaderRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return FaderRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = FaderRange.parse_obj( { "default": ( - Fader.from_dict(obj["default"]) + Fader.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Fader.from_dict(_item) for _item in obj["range"]] + [Fader.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/hdmi_input.py b/python_client/mozart_api/models/hdmi_input.py index 9546d37..9b76c6b 100644 --- a/python_client/mozart_api/models/hdmi_input.py +++ b/python_client/mozart_api/models/hdmi_input.py @@ -18,74 +18,58 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class HdmiInput(BaseModel): """ HdmiInput - """ # noqa: E501 + """ content_uri: Optional[StrictStr] = Field( - default=None, - description="This points to the editable content trigger for this specific hdmi input", + None, alias="contentUri", + description="This points to the editable content trigger for this specific hdmi input", ) input: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["contentUri", "input"] + __properties = ["contentUri", "input"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> HdmiInput: """Create an instance of HdmiInput from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> HdmiInput: """Create an instance of HdmiInput from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return HdmiInput.parse_obj(obj) - _obj = cls.model_validate( - {"contentUri": obj.get("contentUri"), "input": obj.get("input")} + _obj = HdmiInput.parse_obj( + {"content_uri": obj.get("contentUri"), "input": obj.get("input")} ) return _obj diff --git a/python_client/mozart_api/models/hdmi_video_format.py b/python_client/mozart_api/models/hdmi_video_format.py index 2a2637e..502216e 100644 --- a/python_client/mozart_api/models/hdmi_video_format.py +++ b/python_client/mozart_api/models/hdmi_video_format.py @@ -18,64 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated + +from typing import Optional +from pydantic import BaseModel, Field, conint from mozart_api.models.video_pixel_format import VideoPixelFormat from mozart_api.models.video_timings import VideoTimings -from typing import Optional, Set -from typing_extensions import Self class HdmiVideoFormat(BaseModel): """ HdmiVideoFormat - """ # noqa: E501 + """ - pixel_format: Optional[VideoPixelFormat] = Field(default=None, alias="pixelFormat") - v_ic: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( - default=None, alias="vIC" - ) - video_timings: Optional[VideoTimings] = Field(default=None, alias="videoTimings") - __properties: ClassVar[List[str]] = ["pixelFormat", "vIC", "videoTimings"] + pixel_format: Optional[VideoPixelFormat] = Field(None, alias="pixelFormat") + v_ic: Optional[conint(strict=True, ge=0)] = Field(None, alias="vIC") + video_timings: Optional[VideoTimings] = Field(None, alias="videoTimings") + __properties = ["pixelFormat", "vIC", "videoTimings"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> HdmiVideoFormat: """Create an instance of HdmiVideoFormat from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of pixel_format if self.pixel_format: _dict["pixelFormat"] = self.pixel_format.to_dict() @@ -85,24 +66,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> HdmiVideoFormat: """Create an instance of HdmiVideoFormat from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return HdmiVideoFormat.parse_obj(obj) - _obj = cls.model_validate( + _obj = HdmiVideoFormat.parse_obj( { - "pixelFormat": ( - VideoPixelFormat.from_dict(obj["pixelFormat"]) + "pixel_format": ( + VideoPixelFormat.from_dict(obj.get("pixelFormat")) if obj.get("pixelFormat") is not None else None ), - "vIC": obj.get("vIC"), - "videoTimings": ( - VideoTimings.from_dict(obj["videoTimings"]) + "v_ic": obj.get("vIC"), + "video_timings": ( + VideoTimings.from_dict(obj.get("videoTimings")) if obj.get("videoTimings") is not None else None ), diff --git a/python_client/mozart_api/models/home_control_ixp.py b/python_client/mozart_api/models/home_control_ixp.py index 18e8141..d16b107 100644 --- a/python_client/mozart_api/models/home_control_ixp.py +++ b/python_client/mozart_api/models/home_control_ixp.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr class HomeControlIxp(BaseModel): """ HomeControlIxp - """ # noqa: E501 + """ uri: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["uri"] + __properties = ["uri"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> HomeControlIxp: """Create an instance of HomeControlIxp from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> HomeControlIxp: """Create an instance of HomeControlIxp from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return HomeControlIxp.parse_obj(obj) - _obj = cls.model_validate({"uri": obj.get("uri")}) + _obj = HomeControlIxp.parse_obj({"uri": obj.get("uri")}) return _obj diff --git a/python_client/mozart_api/models/home_control_uri.py b/python_client/mozart_api/models/home_control_uri.py index ee191a9..1cf5d2d 100644 --- a/python_client/mozart_api/models/home_control_uri.py +++ b/python_client/mozart_api/models/home_control_uri.py @@ -18,73 +18,57 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr class HomeControlUri(BaseModel): """ HomeControlUri - """ # noqa: E501 + """ ixp: Optional[StrictStr] = None uri: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["ixp", "uri"] + __properties = ["ixp", "uri"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> HomeControlUri: """Create an instance of HomeControlUri from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if ixp (nullable) is None - # and model_fields_set contains the field - if self.ixp is None and "ixp" in self.model_fields_set: + # and __fields_set__ contains the field + if self.ixp is None and "ixp" in self.__fields_set__: _dict["ixp"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> HomeControlUri: """Create an instance of HomeControlUri from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return HomeControlUri.parse_obj(obj) - _obj = cls.model_validate({"ixp": obj.get("ixp"), "uri": obj.get("uri")}) + _obj = HomeControlUri.parse_obj({"ixp": obj.get("ixp"), "uri": obj.get("uri")}) return _obj diff --git a/python_client/mozart_api/models/install_record_id_state.py b/python_client/mozart_api/models/install_record_id_state.py index a4e5832..896745a 100644 --- a/python_client/mozart_api/models/install_record_id_state.py +++ b/python_client/mozart_api/models/install_record_id_state.py @@ -18,88 +18,70 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class InstallRecordIdState(BaseModel): """ InstallRecordIdState - """ # noqa: E501 + """ value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "idle", - "gettingUrl", - "urlInvalid", - "downloading", - "downloadFinished", - "downloadFailed", - ] + if value not in ( + "idle", + "gettingUrl", + "urlInvalid", + "downloading", + "downloadFinished", + "downloadFailed", ): raise ValueError( "must be one of enum values ('idle', 'gettingUrl', 'urlInvalid', 'downloading', 'downloadFinished', 'downloadFailed')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> InstallRecordIdState: """Create an instance of InstallRecordIdState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> InstallRecordIdState: """Create an instance of InstallRecordIdState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return InstallRecordIdState.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = InstallRecordIdState.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/latency_profile.py b/python_client/mozart_api/models/latency_profile.py index c6e6b58..5c60254 100644 --- a/python_client/mozart_api/models/latency_profile.py +++ b/python_client/mozart_api/models/latency_profile.py @@ -18,77 +18,61 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class LatencyProfile(BaseModel): """ - The latency profile of this speaker group. Needed to handle Beolab's with latency dependant audio quality. Default is set to performance. - """ # noqa: E501 + The latency profile of this speaker group. Needed to handle Beolab's with latency dependant audio quality. Default is set to performance. # noqa: E501 + """ value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["performance", "quality"]): + if value not in ("performance", "quality"): raise ValueError("must be one of enum values ('performance', 'quality')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> LatencyProfile: """Create an instance of LatencyProfile from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> LatencyProfile: """Create an instance of LatencyProfile from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return LatencyProfile.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = LatencyProfile.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/lge_tv_sound_settings.py b/python_client/mozart_api/models/lge_tv_sound_settings.py index e97d761..18d3ce8 100644 --- a/python_client/mozart_api/models/lge_tv_sound_settings.py +++ b/python_client/mozart_api/models/lge_tv_sound_settings.py @@ -18,120 +18,95 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, validator class LgeTvSoundSettings(BaseModel): """ LgeTvSoundSettings - """ # noqa: E501 + """ - digital_output: Optional[StrictStr] = Field(default=None, alias="digitalOutput") - e_arc: Optional[StrictBool] = Field(default=None, alias="eArc") + digital_output: Optional[StrictStr] = Field(None, alias="digitalOutput") + e_arc: Optional[StrictBool] = Field(None, alias="eArc") output: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["digitalOutput", "eArc", "output"] + __properties = ["digitalOutput", "eArc", "output"] - @field_validator("digital_output") + @validator("digital_output") def digital_output_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["auto", "passThrough", "pcm", "unknown"]): + if value not in ("auto", "passThrough", "pcm", "unknown"): raise ValueError( "must be one of enum values ('auto', 'passThrough', 'pcm', 'unknown')" ) return value - @field_validator("output") + @validator("output") def output_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "tvSpeaker", - "externalOptical", - "externalArc", - "bluetooth", - "wisaSpeakers", - "lineout", - "headphone", - "tvSpeakerAndExternalOptical", - "tvSpeakerAndHeadphone", - "tvSpeakerAndBluetooth", - "externalArcBno", - "unknown", - ] + if value not in ( + "tvSpeaker", + "externalOptical", + "externalArc", + "bluetooth", + "wisaSpeakers", + "lineout", + "headphone", + "tvSpeakerAndExternalOptical", + "tvSpeakerAndHeadphone", + "tvSpeakerAndBluetooth", + "externalArcBno", + "unknown", ): raise ValueError( "must be one of enum values ('tvSpeaker', 'externalOptical', 'externalArc', 'bluetooth', 'wisaSpeakers', 'lineout', 'headphone', 'tvSpeakerAndExternalOptical', 'tvSpeakerAndHeadphone', 'tvSpeakerAndBluetooth', 'externalArcBno', 'unknown')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> LgeTvSoundSettings: """Create an instance of LgeTvSoundSettings from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> LgeTvSoundSettings: """Create an instance of LgeTvSoundSettings from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return LgeTvSoundSettings.parse_obj(obj) - _obj = cls.model_validate( + _obj = LgeTvSoundSettings.parse_obj( { - "digitalOutput": obj.get("digitalOutput"), - "eArc": obj.get("eArc"), + "digital_output": obj.get("digitalOutput"), + "e_arc": obj.get("eArc"), "output": obj.get("output"), } ) diff --git a/python_client/mozart_api/models/listening_mode.py b/python_client/mozart_api/models/listening_mode.py index 2edce14..8f5a24e 100644 --- a/python_client/mozart_api/models/listening_mode.py +++ b/python_client/mozart_api/models/listening_mode.py @@ -18,105 +18,79 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conint, conlist, constr, validator from mozart_api.models.listening_mode_features import ListeningModeFeatures from mozart_api.models.listening_mode_trigger import ListeningModeTrigger -from typing import Optional, Set -from typing_extensions import Self class ListeningMode(BaseModel): """ ListeningMode - """ # noqa: E501 + """ - client_ctx: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = Field( - default=None, - description="An optional generic string property supplied from the client. If provided, it will be stored without changes. If not supplied, any current clientCtx will remain unchanged. ", + client_ctx: Optional[constr(strict=True, max_length=4096)] = Field( + None, alias="clientCtx", + description="An optional generic string property supplied from the client. If provided, it will be stored without changes. If not supplied, any current clientCtx will remain unchanged. ", ) - features: ListeningModeFeatures - id: Annotated[int, Field(strict=True, ge=0)] - name: StrictStr = Field(description="Friendly name") + features: ListeningModeFeatures = Field(...) + id: conint(strict=True, ge=0) = Field(...) + name: StrictStr = Field(..., description="Friendly name") origin: Optional[StrictStr] = Field( - default=None, - description="User created, default or an edited default listening mode", + None, description="User created, default or an edited default listening mode" ) role: Optional[StrictStr] = Field( - default=None, description="Role a listening mode applies to" + None, description="Role a listening mode applies to" ) - triggers: List[ListeningModeTrigger] - __properties: ClassVar[List[str]] = [ - "clientCtx", - "features", - "id", - "name", - "origin", - "role", - "triggers", - ] - - @field_validator("origin") + triggers: conlist(ListeningModeTrigger) = Field(...) + __properties = ["clientCtx", "features", "id", "name", "origin", "role", "triggers"] + + @validator("origin") def origin_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["user", "default", "edited"]): + if value not in ("user", "default", "edited"): raise ValueError("must be one of enum values ('user', 'default', 'edited')") return value - @field_validator("role") + @validator("role") def role_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["standalone", "multichannel", "all"]): + if value not in ("standalone", "multichannel", "all"): raise ValueError( "must be one of enum values ('standalone', 'multichannel', 'all')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ListeningMode: """Create an instance of ListeningMode from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of features if self.features: _dict["features"] = self.features.to_dict() @@ -128,31 +102,31 @@ def to_dict(self) -> Dict[str, Any]: _items.append(_item.to_dict()) _dict["triggers"] = _items # set to None if client_ctx (nullable) is None - # and model_fields_set contains the field - if self.client_ctx is None and "client_ctx" in self.model_fields_set: + # and __fields_set__ contains the field + if self.client_ctx is None and "client_ctx" in self.__fields_set__: _dict["clientCtx"] = None # set to None if role (nullable) is None - # and model_fields_set contains the field - if self.role is None and "role" in self.model_fields_set: + # and __fields_set__ contains the field + if self.role is None and "role" in self.__fields_set__: _dict["role"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ListeningMode: """Create an instance of ListeningMode from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ListeningMode.parse_obj(obj) - _obj = cls.model_validate( + _obj = ListeningMode.parse_obj( { - "clientCtx": obj.get("clientCtx"), + "client_ctx": obj.get("clientCtx"), "features": ( - ListeningModeFeatures.from_dict(obj["features"]) + ListeningModeFeatures.from_dict(obj.get("features")) if obj.get("features") is not None else None ), @@ -161,7 +135,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "origin": obj.get("origin"), "role": obj.get("role"), "triggers": ( - [ListeningModeTrigger.from_dict(_item) for _item in obj["triggers"]] + [ + ListeningModeTrigger.from_dict(_item) + for _item in obj.get("triggers") + ] if obj.get("triggers") is not None else None ), diff --git a/python_client/mozart_api/models/listening_mode_features.py b/python_client/mozart_api/models/listening_mode_features.py index 0d9a13a..a4b6091 100644 --- a/python_client/mozart_api/models/listening_mode_features.py +++ b/python_client/mozart_api/models/listening_mode_features.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.ambience import Ambience from mozart_api.models.balance import Balance from mozart_api.models.bass_management import BassManagement @@ -34,40 +35,34 @@ from mozart_api.models.spatial_width import SpatialWidth from mozart_api.models.speech_enhance import SpeechEnhance from mozart_api.models.tone_touch import ToneTouch -from typing import Optional, Set -from typing_extensions import Self class ListeningModeFeatures(BaseModel): """ - Sound features to apply - """ # noqa: E501 + Sound features to apply # noqa: E501 + """ ambience: Optional[Ambience] = None balance: Optional[Balance] = None - bass_management: Optional[BassManagement] = Field( - default=None, alias="bassManagement" - ) + bass_management: Optional[BassManagement] = Field(None, alias="bassManagement") compression: Optional[Compression] = None directivity: Optional[Directivity] = None fader: Optional[Fader] = None room_compensation: Optional[RoomCompensation] = Field( - default=None, alias="roomCompensation" + None, alias="roomCompensation" ) spatial_envelopment: Optional[SpatialEnvelopment] = Field( - default=None, alias="spatialEnvelopment" + None, alias="spatialEnvelopment" ) - spatial_height: Optional[SpatialHeight] = Field(default=None, alias="spatialHeight") + spatial_height: Optional[SpatialHeight] = Field(None, alias="spatialHeight") spatial_processing: Optional[SpatialProcessing] = Field( - default=None, alias="spatialProcessing" + None, alias="spatialProcessing" ) - spatial_surround: Optional[SpatialSurround] = Field( - default=None, alias="spatialSurround" - ) - spatial_width: Optional[SpatialWidth] = Field(default=None, alias="spatialWidth") - speech_enhance: Optional[SpeechEnhance] = Field(default=None, alias="speechEnhance") - tone_touch: Optional[ToneTouch] = Field(default=None, alias="toneTouch") - __properties: ClassVar[List[str]] = [ + spatial_surround: Optional[SpatialSurround] = Field(None, alias="spatialSurround") + spatial_width: Optional[SpatialWidth] = Field(None, alias="spatialWidth") + speech_enhance: Optional[SpeechEnhance] = Field(None, alias="speechEnhance") + tone_touch: Optional[ToneTouch] = Field(None, alias="toneTouch") + __properties = [ "ambience", "balance", "bassManagement", @@ -84,43 +79,28 @@ class ListeningModeFeatures(BaseModel): "toneTouch", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ListeningModeFeatures: """Create an instance of ListeningModeFeatures from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of ambience if self.ambience: _dict["ambience"] = self.ambience.to_dict() @@ -166,83 +146,83 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ListeningModeFeatures: """Create an instance of ListeningModeFeatures from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ListeningModeFeatures.parse_obj(obj) - _obj = cls.model_validate( + _obj = ListeningModeFeatures.parse_obj( { "ambience": ( - Ambience.from_dict(obj["ambience"]) + Ambience.from_dict(obj.get("ambience")) if obj.get("ambience") is not None else None ), "balance": ( - Balance.from_dict(obj["balance"]) + Balance.from_dict(obj.get("balance")) if obj.get("balance") is not None else None ), - "bassManagement": ( - BassManagement.from_dict(obj["bassManagement"]) + "bass_management": ( + BassManagement.from_dict(obj.get("bassManagement")) if obj.get("bassManagement") is not None else None ), "compression": ( - Compression.from_dict(obj["compression"]) + Compression.from_dict(obj.get("compression")) if obj.get("compression") is not None else None ), "directivity": ( - Directivity.from_dict(obj["directivity"]) + Directivity.from_dict(obj.get("directivity")) if obj.get("directivity") is not None else None ), "fader": ( - Fader.from_dict(obj["fader"]) + Fader.from_dict(obj.get("fader")) if obj.get("fader") is not None else None ), - "roomCompensation": ( - RoomCompensation.from_dict(obj["roomCompensation"]) + "room_compensation": ( + RoomCompensation.from_dict(obj.get("roomCompensation")) if obj.get("roomCompensation") is not None else None ), - "spatialEnvelopment": ( - SpatialEnvelopment.from_dict(obj["spatialEnvelopment"]) + "spatial_envelopment": ( + SpatialEnvelopment.from_dict(obj.get("spatialEnvelopment")) if obj.get("spatialEnvelopment") is not None else None ), - "spatialHeight": ( - SpatialHeight.from_dict(obj["spatialHeight"]) + "spatial_height": ( + SpatialHeight.from_dict(obj.get("spatialHeight")) if obj.get("spatialHeight") is not None else None ), - "spatialProcessing": ( - SpatialProcessing.from_dict(obj["spatialProcessing"]) + "spatial_processing": ( + SpatialProcessing.from_dict(obj.get("spatialProcessing")) if obj.get("spatialProcessing") is not None else None ), - "spatialSurround": ( - SpatialSurround.from_dict(obj["spatialSurround"]) + "spatial_surround": ( + SpatialSurround.from_dict(obj.get("spatialSurround")) if obj.get("spatialSurround") is not None else None ), - "spatialWidth": ( - SpatialWidth.from_dict(obj["spatialWidth"]) + "spatial_width": ( + SpatialWidth.from_dict(obj.get("spatialWidth")) if obj.get("spatialWidth") is not None else None ), - "speechEnhance": ( - SpeechEnhance.from_dict(obj["speechEnhance"]) + "speech_enhance": ( + SpeechEnhance.from_dict(obj.get("speechEnhance")) if obj.get("speechEnhance") is not None else None ), - "toneTouch": ( - ToneTouch.from_dict(obj["toneTouch"]) + "tone_touch": ( + ToneTouch.from_dict(obj.get("toneTouch")) if obj.get("toneTouch") is not None else None ), diff --git a/python_client/mozart_api/models/listening_mode_props.py b/python_client/mozart_api/models/listening_mode_props.py index ceadbce..2717ad3 100644 --- a/python_client/mozart_api/models/listening_mode_props.py +++ b/python_client/mozart_api/models/listening_mode_props.py @@ -18,105 +18,79 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conint, conlist, constr, validator from mozart_api.models.listening_mode_features import ListeningModeFeatures from mozart_api.models.listening_mode_trigger import ListeningModeTrigger -from typing import Optional, Set -from typing_extensions import Self class ListeningModeProps(BaseModel): """ ListeningModeProps - """ # noqa: E501 + """ - client_ctx: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = Field( - default=None, - description="An optional generic string property supplied from the client. If provided, it will be stored without changes. If not supplied, any current clientCtx will remain unchanged. ", + client_ctx: Optional[constr(strict=True, max_length=4096)] = Field( + None, alias="clientCtx", + description="An optional generic string property supplied from the client. If provided, it will be stored without changes. If not supplied, any current clientCtx will remain unchanged. ", ) features: Optional[ListeningModeFeatures] = None - id: Optional[Annotated[int, Field(strict=True, ge=0)]] = None - name: Optional[StrictStr] = Field(default=None, description="Friendly name") + id: Optional[conint(strict=True, ge=0)] = None + name: Optional[StrictStr] = Field(None, description="Friendly name") origin: Optional[StrictStr] = Field( - default=None, - description="User created, default or an edited default listening mode", + None, description="User created, default or an edited default listening mode" ) role: Optional[StrictStr] = Field( - default=None, description="Role a listening mode applies to" + None, description="Role a listening mode applies to" ) - triggers: Optional[List[ListeningModeTrigger]] = None - __properties: ClassVar[List[str]] = [ - "clientCtx", - "features", - "id", - "name", - "origin", - "role", - "triggers", - ] - - @field_validator("origin") + triggers: Optional[conlist(ListeningModeTrigger)] = None + __properties = ["clientCtx", "features", "id", "name", "origin", "role", "triggers"] + + @validator("origin") def origin_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["user", "default", "edited"]): + if value not in ("user", "default", "edited"): raise ValueError("must be one of enum values ('user', 'default', 'edited')") return value - @field_validator("role") + @validator("role") def role_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["standalone", "multichannel", "all"]): + if value not in ("standalone", "multichannel", "all"): raise ValueError( "must be one of enum values ('standalone', 'multichannel', 'all')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ListeningModeProps: """Create an instance of ListeningModeProps from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of features if self.features: _dict["features"] = self.features.to_dict() @@ -128,31 +102,31 @@ def to_dict(self) -> Dict[str, Any]: _items.append(_item.to_dict()) _dict["triggers"] = _items # set to None if client_ctx (nullable) is None - # and model_fields_set contains the field - if self.client_ctx is None and "client_ctx" in self.model_fields_set: + # and __fields_set__ contains the field + if self.client_ctx is None and "client_ctx" in self.__fields_set__: _dict["clientCtx"] = None # set to None if role (nullable) is None - # and model_fields_set contains the field - if self.role is None and "role" in self.model_fields_set: + # and __fields_set__ contains the field + if self.role is None and "role" in self.__fields_set__: _dict["role"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ListeningModeProps: """Create an instance of ListeningModeProps from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ListeningModeProps.parse_obj(obj) - _obj = cls.model_validate( + _obj = ListeningModeProps.parse_obj( { - "clientCtx": obj.get("clientCtx"), + "client_ctx": obj.get("clientCtx"), "features": ( - ListeningModeFeatures.from_dict(obj["features"]) + ListeningModeFeatures.from_dict(obj.get("features")) if obj.get("features") is not None else None ), @@ -161,7 +135,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "origin": obj.get("origin"), "role": obj.get("role"), "triggers": ( - [ListeningModeTrigger.from_dict(_item) for _item in obj["triggers"]] + [ + ListeningModeTrigger.from_dict(_item) + for _item in obj.get("triggers") + ] if obj.get("triggers") is not None else None ), diff --git a/python_client/mozart_api/models/listening_mode_ref.py b/python_client/mozart_api/models/listening_mode_ref.py index 241734e..5b3f170 100644 --- a/python_client/mozart_api/models/listening_mode_ref.py +++ b/python_client/mozart_api/models/listening_mode_ref.py @@ -18,83 +18,70 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, conint class ListeningModeRef(BaseModel): """ - Reference to a listening mode - """ # noqa: E501 + Reference to a listening mode # noqa: E501 + """ href: Optional[StrictStr] = Field( - description="Host relative URI of the listening mode or `null` if there is no active listening mode. " + ..., + description="Host relative URI of the listening mode or `null` if there is no active listening mode. ", ) - id: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field( - description="ID of the active listening mode or `null` if there is no active listening mode. " + id: Optional[conint(strict=True, ge=0)] = Field( + ..., + description="ID of the active listening mode or `null` if there is no active listening mode. ", ) - __properties: ClassVar[List[str]] = ["href", "id"] + __properties = ["href", "id"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ListeningModeRef: """Create an instance of ListeningModeRef from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if href (nullable) is None - # and model_fields_set contains the field - if self.href is None and "href" in self.model_fields_set: + # and __fields_set__ contains the field + if self.href is None and "href" in self.__fields_set__: _dict["href"] = None # set to None if id (nullable) is None - # and model_fields_set contains the field - if self.id is None and "id" in self.model_fields_set: + # and __fields_set__ contains the field + if self.id is None and "id" in self.__fields_set__: _dict["id"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ListeningModeRef: """Create an instance of ListeningModeRef from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ListeningModeRef.parse_obj(obj) - _obj = cls.model_validate({"href": obj.get("href"), "id": obj.get("id")}) + _obj = ListeningModeRef.parse_obj( + {"href": obj.get("href"), "id": obj.get("id")} + ) return _obj diff --git a/python_client/mozart_api/models/listening_mode_trigger.py b/python_client/mozart_api/models/listening_mode_trigger.py index 68d9f53..5271b5d 100644 --- a/python_client/mozart_api/models/listening_mode_trigger.py +++ b/python_client/mozart_api/models/listening_mode_trigger.py @@ -14,21 +14,16 @@ from __future__ import annotations +from inspect import getfullargspec import json import pprint -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictStr, - ValidationError, - field_validator, -) +import re # noqa: F401 + from typing import Any, List, Optional +from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from mozart_api.models.power_link_trigger import PowerLinkTrigger +from typing import Union, Any, List, TYPE_CHECKING from pydantic import StrictStr, Field -from typing import Union, List, Optional, Dict -from typing_extensions import Literal, Self LISTENINGMODETRIGGER_ONE_OF_SCHEMAS = ["PowerLinkTrigger"] @@ -40,13 +35,14 @@ class ListeningModeTrigger(BaseModel): # data type: PowerLinkTrigger oneof_schema_1_validator: Optional[PowerLinkTrigger] = None - actual_instance: Optional[Union[PowerLinkTrigger]] = None - one_of_schemas: List[str] = Field(default=Literal["PowerLinkTrigger"]) + if TYPE_CHECKING: + actual_instance: Union[PowerLinkTrigger] + else: + actual_instance: Any + one_of_schemas: List[str] = Field(LISTENINGMODETRIGGER_ONE_OF_SCHEMAS, const=True) - model_config = ConfigDict( - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + validate_assignment = True def __init__(self, *args, **kwargs) -> None: if args: @@ -62,9 +58,9 @@ def __init__(self, *args, **kwargs) -> None: else: super().__init__(**kwargs) - @field_validator("actual_instance") + @validator("actual_instance") def actual_instance_must_validate_oneof(cls, v): - instance = ListeningModeTrigger.model_construct() + instance = ListeningModeTrigger.construct() error_messages = [] match = 0 # validate data type: PowerLinkTrigger @@ -90,13 +86,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + def from_dict(cls, obj: dict) -> ListeningModeTrigger: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> Self: + def from_json(cls, json_str: str) -> ListeningModeTrigger: """Returns the object represented by the json string""" - instance = cls.model_construct() + instance = ListeningModeTrigger.construct() error_messages = [] match = 0 @@ -127,21 +123,19 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - if hasattr(self.actual_instance, "to_json") and callable( - self.actual_instance.to_json - ): + to_json = getattr(self.actual_instance, "to_json", None) + if callable(to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], PowerLinkTrigger]]: + def to_dict(self) -> dict: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - if hasattr(self.actual_instance, "to_dict") and callable( - self.actual_instance.to_dict - ): + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -149,4 +143,4 @@ def to_dict(self) -> Optional[Union[Dict[str, Any], PowerLinkTrigger]]: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) + return pprint.pformat(self.dict()) diff --git a/python_client/mozart_api/models/loudness.py b/python_client/mozart_api/models/loudness.py index 270a094..6c68a3d 100644 --- a/python_client/mozart_api/models/loudness.py +++ b/python_client/mozart_api/models/loudness.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictBool class Loudness(BaseModel): """ Loudness - """ # noqa: E501 + """ value: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Loudness: """Create an instance of Loudness from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Loudness: """Create an instance of Loudness from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Loudness.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = Loudness.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/microphone_state.py b/python_client/mozart_api/models/microphone_state.py index cbe2caf..4c35b37 100644 --- a/python_client/mozart_api/models/microphone_state.py +++ b/python_client/mozart_api/models/microphone_state.py @@ -18,77 +18,61 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class MicrophoneState(BaseModel): """ MicrophoneState - """ # noqa: E501 + """ value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["on", "off"]): + if value not in ("on", "off"): raise ValueError("must be one of enum values ('on', 'off')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> MicrophoneState: """Create an instance of MicrophoneState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> MicrophoneState: """Create an instance of MicrophoneState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return MicrophoneState.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = MicrophoneState.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/microphones_state.py b/python_client/mozart_api/models/microphones_state.py index a456503..1bf18a8 100644 --- a/python_client/mozart_api/models/microphones_state.py +++ b/python_client/mozart_api/models/microphones_state.py @@ -18,63 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.microphone_state import MicrophoneState -from typing import Optional, Set -from typing_extensions import Self class MicrophonesState(BaseModel): """ - state of microphones, both physical switches and software state - """ # noqa: E501 + state of microphones, both physical switches and software state # noqa: E501 + """ - microphone_state: Optional[MicrophoneState] = Field( - default=None, alias="microphoneState" - ) + microphone_state: Optional[MicrophoneState] = Field(None, alias="microphoneState") microphone_switch_state: Optional[MicrophoneState] = Field( - default=None, alias="microphoneSwitchState" + None, alias="microphoneSwitchState" ) - __properties: ClassVar[List[str]] = ["microphoneState", "microphoneSwitchState"] + __properties = ["microphoneState", "microphoneSwitchState"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> MicrophonesState: """Create an instance of MicrophonesState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of microphone_state if self.microphone_state: _dict["microphoneState"] = self.microphone_state.to_dict() @@ -84,23 +66,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> MicrophonesState: """Create an instance of MicrophonesState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return MicrophonesState.parse_obj(obj) - _obj = cls.model_validate( + _obj = MicrophonesState.parse_obj( { - "microphoneState": ( - MicrophoneState.from_dict(obj["microphoneState"]) + "microphone_state": ( + MicrophoneState.from_dict(obj.get("microphoneState")) if obj.get("microphoneState") is not None else None ), - "microphoneSwitchState": ( - MicrophoneState.from_dict(obj["microphoneSwitchState"]) + "microphone_switch_state": ( + MicrophoneState.from_dict(obj.get("microphoneSwitchState")) if obj.get("microphoneSwitchState") is not None else None ), diff --git a/python_client/mozart_api/models/overlay_play_request.py b/python_client/mozart_api/models/overlay_play_request.py index 5583232..4c81280 100644 --- a/python_client/mozart_api/models/overlay_play_request.py +++ b/python_client/mozart_api/models/overlay_play_request.py @@ -18,9 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated + +from typing import Optional +from pydantic import BaseModel, Field, conint from mozart_api.models.overlay_play_request_from_usb_from_usb import ( OverlayPlayRequestFromUsbFromUsb, ) @@ -28,71 +28,47 @@ OverlayPlayRequestTextToSpeechTextToSpeech, ) from mozart_api.models.uri import Uri -from typing import Optional, Set -from typing_extensions import Self class OverlayPlayRequest(BaseModel): """ OverlayPlayRequest - """ # noqa: E501 + """ - volume_absolute: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field( - default=None, - description="An optional absolute volume level at which to play the URI. If not provided, the URI will play at the currently configured volume level on the product. The level should be provided in volume steps [0, 100] ", + volume_absolute: Optional[conint(strict=True, le=100, ge=0)] = Field( + None, alias="volumeAbsolute", + description="An optional absolute volume level at which to play the URI. If not provided, the URI will play at the currently configured volume level on the product. The level should be provided in volume steps [0, 100] ", ) uri: Optional[Uri] = None text_to_speech: Optional[OverlayPlayRequestTextToSpeechTextToSpeech] = Field( - default=None, alias="textToSpeech" - ) - from_usb: Optional[OverlayPlayRequestFromUsbFromUsb] = Field( - default=None, alias="fromUsb" - ) - __properties: ClassVar[List[str]] = [ - "volumeAbsolute", - "uri", - "textToSpeech", - "fromUsb", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + None, alias="textToSpeech" ) + from_usb: Optional[OverlayPlayRequestFromUsbFromUsb] = Field(None, alias="fromUsb") + __properties = ["volumeAbsolute", "uri", "textToSpeech", "fromUsb"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> OverlayPlayRequest: """Create an instance of OverlayPlayRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of uri if self.uri: _dict["uri"] = self.uri.to_dict() @@ -103,36 +79,38 @@ def to_dict(self) -> Dict[str, Any]: if self.from_usb: _dict["fromUsb"] = self.from_usb.to_dict() # set to None if volume_absolute (nullable) is None - # and model_fields_set contains the field - if self.volume_absolute is None and "volume_absolute" in self.model_fields_set: + # and __fields_set__ contains the field + if self.volume_absolute is None and "volume_absolute" in self.__fields_set__: _dict["volumeAbsolute"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> OverlayPlayRequest: """Create an instance of OverlayPlayRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return OverlayPlayRequest.parse_obj(obj) - _obj = cls.model_validate( + _obj = OverlayPlayRequest.parse_obj( { - "volumeAbsolute": obj.get("volumeAbsolute"), + "volume_absolute": obj.get("volumeAbsolute"), "uri": ( - Uri.from_dict(obj["uri"]) if obj.get("uri") is not None else None + Uri.from_dict(obj.get("uri")) + if obj.get("uri") is not None + else None ), - "textToSpeech": ( + "text_to_speech": ( OverlayPlayRequestTextToSpeechTextToSpeech.from_dict( - obj["textToSpeech"] + obj.get("textToSpeech") ) if obj.get("textToSpeech") is not None else None ), - "fromUsb": ( - OverlayPlayRequestFromUsbFromUsb.from_dict(obj["fromUsb"]) + "from_usb": ( + OverlayPlayRequestFromUsbFromUsb.from_dict(obj.get("fromUsb")) if obj.get("fromUsb") is not None else None ), diff --git a/python_client/mozart_api/models/overlay_play_request_common.py b/python_client/mozart_api/models/overlay_play_request_common.py index 878e1a6..181de15 100644 --- a/python_client/mozart_api/models/overlay_play_request_common.py +++ b/python_client/mozart_api/models/overlay_play_request_common.py @@ -18,77 +18,62 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, conint class OverlayPlayRequestCommon(BaseModel): """ OverlayPlayRequestCommon - """ # noqa: E501 + """ - volume_absolute: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field( - default=None, - description="An optional absolute volume level at which to play the URI. If not provided, the URI will play at the currently configured volume level on the product. The level should be provided in volume steps [0, 100] ", + volume_absolute: Optional[conint(strict=True, le=100, ge=0)] = Field( + None, alias="volumeAbsolute", + description="An optional absolute volume level at which to play the URI. If not provided, the URI will play at the currently configured volume level on the product. The level should be provided in volume steps [0, 100] ", ) - __properties: ClassVar[List[str]] = ["volumeAbsolute"] + __properties = ["volumeAbsolute"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> OverlayPlayRequestCommon: """Create an instance of OverlayPlayRequestCommon from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if volume_absolute (nullable) is None - # and model_fields_set contains the field - if self.volume_absolute is None and "volume_absolute" in self.model_fields_set: + # and __fields_set__ contains the field + if self.volume_absolute is None and "volume_absolute" in self.__fields_set__: _dict["volumeAbsolute"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> OverlayPlayRequestCommon: """Create an instance of OverlayPlayRequestCommon from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return OverlayPlayRequestCommon.parse_obj(obj) - _obj = cls.model_validate({"volumeAbsolute": obj.get("volumeAbsolute")}) + _obj = OverlayPlayRequestCommon.parse_obj( + {"volume_absolute": obj.get("volumeAbsolute")} + ) return _obj diff --git a/python_client/mozart_api/models/overlay_play_request_from_usb.py b/python_client/mozart_api/models/overlay_play_request_from_usb.py index 18e51d6..51b97f5 100644 --- a/python_client/mozart_api/models/overlay_play_request_from_usb.py +++ b/python_client/mozart_api/models/overlay_play_request_from_usb.py @@ -18,80 +18,62 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.overlay_play_request_from_usb_from_usb import ( OverlayPlayRequestFromUsbFromUsb, ) -from typing import Optional, Set -from typing_extensions import Self class OverlayPlayRequestFromUsb(BaseModel): """ OverlayPlayRequestFromUsb - """ # noqa: E501 + """ - from_usb: Optional[OverlayPlayRequestFromUsbFromUsb] = Field( - default=None, alias="fromUsb" - ) - __properties: ClassVar[List[str]] = ["fromUsb"] + from_usb: Optional[OverlayPlayRequestFromUsbFromUsb] = Field(None, alias="fromUsb") + __properties = ["fromUsb"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> OverlayPlayRequestFromUsb: """Create an instance of OverlayPlayRequestFromUsb from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of from_usb if self.from_usb: _dict["fromUsb"] = self.from_usb.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> OverlayPlayRequestFromUsb: """Create an instance of OverlayPlayRequestFromUsb from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return OverlayPlayRequestFromUsb.parse_obj(obj) - _obj = cls.model_validate( + _obj = OverlayPlayRequestFromUsb.parse_obj( { - "fromUsb": ( - OverlayPlayRequestFromUsbFromUsb.from_dict(obj["fromUsb"]) + "from_usb": ( + OverlayPlayRequestFromUsbFromUsb.from_dict(obj.get("fromUsb")) if obj.get("fromUsb") is not None else None ) diff --git a/python_client/mozart_api/models/overlay_play_request_from_usb_from_usb.py b/python_client/mozart_api/models/overlay_play_request_from_usb_from_usb.py index 41c2e56..dde987b 100644 --- a/python_client/mozart_api/models/overlay_play_request_from_usb_from_usb.py +++ b/python_client/mozart_api/models/overlay_play_request_from_usb_from_usb.py @@ -18,71 +18,56 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, constr class OverlayPlayRequestFromUsbFromUsb(BaseModel): """ OverlayPlayRequestFromUsbFromUsb - """ # noqa: E501 + """ - file_location: Annotated[str, Field(strict=True, max_length=1024)] = Field( - description="Required field containing the relative path (i.e. from the USB drive root) and file name with extension (if one exists) that will be played. A maximum length of 1024 characters is allowed. ", + file_location: constr(strict=True, max_length=1024) = Field( + ..., alias="fileLocation", + description="Required field containing the relative path (i.e. from the USB drive root) and file name with extension (if one exists) that will be played. A maximum length of 1024 characters is allowed. ", ) - __properties: ClassVar[List[str]] = ["fileLocation"] + __properties = ["fileLocation"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> OverlayPlayRequestFromUsbFromUsb: """Create an instance of OverlayPlayRequestFromUsbFromUsb from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> OverlayPlayRequestFromUsbFromUsb: """Create an instance of OverlayPlayRequestFromUsbFromUsb from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return OverlayPlayRequestFromUsbFromUsb.parse_obj(obj) - _obj = cls.model_validate({"fileLocation": obj.get("fileLocation")}) + _obj = OverlayPlayRequestFromUsbFromUsb.parse_obj( + {"file_location": obj.get("fileLocation")} + ) return _obj diff --git a/python_client/mozart_api/models/overlay_play_request_text_to_speech.py b/python_client/mozart_api/models/overlay_play_request_text_to_speech.py index 2fc22fd..2dc0742 100644 --- a/python_client/mozart_api/models/overlay_play_request_text_to_speech.py +++ b/python_client/mozart_api/models/overlay_play_request_text_to_speech.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.overlay_play_request_text_to_speech_text_to_speech import ( OverlayPlayRequestTextToSpeechTextToSpeech, ) -from typing import Optional, Set -from typing_extensions import Self class OverlayPlayRequestTextToSpeech(BaseModel): """ OverlayPlayRequestTextToSpeech - """ # noqa: E501 + """ text_to_speech: Optional[OverlayPlayRequestTextToSpeechTextToSpeech] = Field( - default=None, alias="textToSpeech" + None, alias="textToSpeech" ) - __properties: ClassVar[List[str]] = ["textToSpeech"] + __properties = ["textToSpeech"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> OverlayPlayRequestTextToSpeech: """Create an instance of OverlayPlayRequestTextToSpeech from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of text_to_speech if self.text_to_speech: _dict["textToSpeech"] = self.text_to_speech.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> OverlayPlayRequestTextToSpeech: """Create an instance of OverlayPlayRequestTextToSpeech from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return OverlayPlayRequestTextToSpeech.parse_obj(obj) - _obj = cls.model_validate( + _obj = OverlayPlayRequestTextToSpeech.parse_obj( { - "textToSpeech": ( + "text_to_speech": ( OverlayPlayRequestTextToSpeechTextToSpeech.from_dict( - obj["textToSpeech"] + obj.get("textToSpeech") ) if obj.get("textToSpeech") is not None else None diff --git a/python_client/mozart_api/models/overlay_play_request_text_to_speech_text_to_speech.py b/python_client/mozart_api/models/overlay_play_request_text_to_speech_text_to_speech.py index 20bddd2..a5ab8d9 100644 --- a/python_client/mozart_api/models/overlay_play_request_text_to_speech_text_to_speech.py +++ b/python_client/mozart_api/models/overlay_play_request_text_to_speech_text_to_speech.py @@ -18,79 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, constr class OverlayPlayRequestTextToSpeechTextToSpeech(BaseModel): """ - Object used for performing a text-to-speech operation on the product. - """ # noqa: E501 + Object used for performing a text-to-speech operation on the product. # noqa: E501 + """ lang: Optional[StrictStr] = Field( - default=None, + None, description="An optional specification of the language to use. The default value is ultimately decided by the BeoCloud API, but currently it defaults to `en-us`. ", ) - text: Annotated[str, Field(strict=True, max_length=2048)] = Field( - description="Required field containing the actual text that will be converted to speech (audio). A maximum length of 2048 characters is allowed. " + text: constr(strict=True, max_length=2048) = Field( + ..., + description="Required field containing the actual text that will be converted to speech (audio). A maximum length of 2048 characters is allowed. ", ) - __properties: ClassVar[List[str]] = ["lang", "text"] + __properties = ["lang", "text"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> OverlayPlayRequestTextToSpeechTextToSpeech: """Create an instance of OverlayPlayRequestTextToSpeechTextToSpeech from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if lang (nullable) is None - # and model_fields_set contains the field - if self.lang is None and "lang" in self.model_fields_set: + # and __fields_set__ contains the field + if self.lang is None and "lang" in self.__fields_set__: _dict["lang"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> OverlayPlayRequestTextToSpeechTextToSpeech: """Create an instance of OverlayPlayRequestTextToSpeechTextToSpeech from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return OverlayPlayRequestTextToSpeechTextToSpeech.parse_obj(obj) - _obj = cls.model_validate({"lang": obj.get("lang"), "text": obj.get("text")}) + _obj = OverlayPlayRequestTextToSpeechTextToSpeech.parse_obj( + {"lang": obj.get("lang"), "text": obj.get("text")} + ) return _obj diff --git a/python_client/mozart_api/models/overlay_play_request_uri.py b/python_client/mozart_api/models/overlay_play_request_uri.py index d3bbb78..2d72208 100644 --- a/python_client/mozart_api/models/overlay_play_request_uri.py +++ b/python_client/mozart_api/models/overlay_play_request_uri.py @@ -18,73 +18,63 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel from mozart_api.models.uri import Uri -from typing import Optional, Set -from typing_extensions import Self class OverlayPlayRequestUri(BaseModel): """ OverlayPlayRequestUri - """ # noqa: E501 + """ uri: Optional[Uri] = None - __properties: ClassVar[List[str]] = ["uri"] + __properties = ["uri"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> OverlayPlayRequestUri: """Create an instance of OverlayPlayRequestUri from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of uri if self.uri: _dict["uri"] = self.uri.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> OverlayPlayRequestUri: """Create an instance of OverlayPlayRequestUri from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"uri": Uri.from_dict(obj["uri"]) if obj.get("uri") is not None else None} + return OverlayPlayRequestUri.parse_obj(obj) + + _obj = OverlayPlayRequestUri.parse_obj( + { + "uri": ( + Uri.from_dict(obj.get("uri")) + if obj.get("uri") is not None + else None + ) + } ) return _obj diff --git a/python_client/mozart_api/models/paired_remote.py b/python_client/mozart_api/models/paired_remote.py index d9896ef..71e69c8 100644 --- a/python_client/mozart_api/models/paired_remote.py +++ b/python_client/mozart_api/models/paired_remote.py @@ -18,28 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conint, conlist, validator class PairedRemote(BaseModel): """ PairedRemote - """ # noqa: E501 + """ - address: StrictStr - app_version: Optional[StrictStr] = Field(default=None, alias="appVersion") - battery_level: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field( - default=None, alias="batteryLevel" + address: StrictStr = Field(...) + app_version: Optional[StrictStr] = Field(None, alias="appVersion") + battery_level: Optional[conint(strict=True, le=100, ge=0)] = Field( + None, alias="batteryLevel" ) - db_version: Optional[StrictStr] = Field(default=None, alias="dbVersion") - name: StrictStr - serial_number: Optional[StrictStr] = Field(default=None, alias="serialNumber") - updated: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = [ + db_version: Optional[StrictStr] = Field(None, alias="dbVersion") + name: StrictStr = Field(...) + serial_number: Optional[StrictStr] = Field(None, alias="serialNumber") + updated: Optional[conlist(StrictStr)] = None + __properties = [ "address", "appVersion", "batteryLevel", @@ -49,73 +47,58 @@ class PairedRemote(BaseModel): "updated", ] - @field_validator("updated") + @validator("updated") def updated_validate_enum(cls, value): """Validates the enum""" if value is None: return value for i in value: - if i not in set(["app", "db"]): + if i not in ("app", "db"): raise ValueError("each list item must be one of ('app', 'db')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PairedRemote: """Create an instance of PairedRemote from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PairedRemote: """Create an instance of PairedRemote from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PairedRemote.parse_obj(obj) - _obj = cls.model_validate( + _obj = PairedRemote.parse_obj( { "address": obj.get("address"), - "appVersion": obj.get("appVersion"), - "batteryLevel": obj.get("batteryLevel"), - "dbVersion": obj.get("dbVersion"), + "app_version": obj.get("appVersion"), + "battery_level": obj.get("batteryLevel"), + "db_version": obj.get("dbVersion"), "name": obj.get("name"), - "serialNumber": obj.get("serialNumber"), + "serial_number": obj.get("serialNumber"), "updated": obj.get("updated"), } ) diff --git a/python_client/mozart_api/models/paired_remote_response.py b/python_client/mozart_api/models/paired_remote_response.py index 7f67499..bfc01d6 100644 --- a/python_client/mozart_api/models/paired_remote_response.py +++ b/python_client/mozart_api/models/paired_remote_response.py @@ -18,58 +18,42 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, conlist from mozart_api.models.paired_remote import PairedRemote -from typing import Optional, Set -from typing_extensions import Self class PairedRemoteResponse(BaseModel): """ PairedRemoteResponse - """ # noqa: E501 + """ - items: Optional[List[PairedRemote]] = None - __properties: ClassVar[List[str]] = ["items"] + items: Optional[conlist(PairedRemote)] = None + __properties = ["items"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PairedRemoteResponse: """Create an instance of PairedRemoteResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in items (list) _items = [] if self.items: @@ -80,18 +64,18 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PairedRemoteResponse: """Create an instance of PairedRemoteResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PairedRemoteResponse.parse_obj(obj) - _obj = cls.model_validate( + _obj = PairedRemoteResponse.parse_obj( { "items": ( - [PairedRemote.from_dict(_item) for _item in obj["items"]] + [PairedRemote.from_dict(_item) for _item in obj.get("items")] if obj.get("items") is not None else None ) diff --git a/python_client/mozart_api/models/play_queue_item.py b/python_client/mozart_api/models/play_queue_item.py index d6a88a9..c06fe35 100644 --- a/python_client/mozart_api/models/play_queue_item.py +++ b/python_client/mozart_api/models/play_queue_item.py @@ -18,32 +18,31 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from mozart_api.models.play_queue_item_type import PlayQueueItemType from mozart_api.models.playback_content_metadata import PlaybackContentMetadata -from typing import Optional, Set -from typing_extensions import Self class PlayQueueItem(BaseModel): """ PlayQueueItem - """ # noqa: E501 + """ index: Optional[StrictInt] = None metadata: Optional[PlaybackContentMetadata] = None - provider: PlayQueueItemType + provider: PlayQueueItemType = Field(...) start_now_from_position: Optional[StrictInt] = Field( - default=None, - description="Start playing specified track as soon as possible. This works for any type, for `track` set to 0 and for `playlist` specify the wanted track from position 0", + None, alias="startNowFromPosition", + description="Start playing specified track as soon as possible. This works for any type, for `track` set to 0 and for `playlist` specify the wanted track from position 0", ) - type: StrictStr + type: StrictStr = Field(...) uri: StrictStr = Field( - description="This can be url, track id, playlist id, radio id and suchlike" + ..., description="This can be url, track id, playlist id, radio id and suchlike" ) - __properties: ClassVar[List[str]] = [ + __properties = [ "index", "metadata", "provider", @@ -52,50 +51,35 @@ class PlayQueueItem(BaseModel): "uri", ] - @field_validator("type") + @validator("type") def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(["track", "playlist"]): + if value not in ("track", "playlist"): raise ValueError("must be one of enum values ('track', 'playlist')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PlayQueueItem: """Create an instance of PlayQueueItem from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict["metadata"] = self.metadata.to_dict() @@ -103,38 +87,38 @@ def to_dict(self) -> Dict[str, Any]: if self.provider: _dict["provider"] = self.provider.to_dict() # set to None if start_now_from_position (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.start_now_from_position is None - and "start_now_from_position" in self.model_fields_set + and "start_now_from_position" in self.__fields_set__ ): _dict["startNowFromPosition"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PlayQueueItem: """Create an instance of PlayQueueItem from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PlayQueueItem.parse_obj(obj) - _obj = cls.model_validate( + _obj = PlayQueueItem.parse_obj( { "index": obj.get("index"), "metadata": ( - PlaybackContentMetadata.from_dict(obj["metadata"]) + PlaybackContentMetadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None ), "provider": ( - PlayQueueItemType.from_dict(obj["provider"]) + PlayQueueItemType.from_dict(obj.get("provider")) if obj.get("provider") is not None else None ), - "startNowFromPosition": obj.get("startNowFromPosition"), + "start_now_from_position": obj.get("startNowFromPosition"), "type": obj.get("type"), "uri": obj.get("uri"), } diff --git a/python_client/mozart_api/models/play_queue_item_type.py b/python_client/mozart_api/models/play_queue_item_type.py index 55f8ef1..8d362e2 100644 --- a/python_client/mozart_api/models/play_queue_item_type.py +++ b/python_client/mozart_api/models/play_queue_item_type.py @@ -18,76 +18,59 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr, validator class PlayQueueItemType(BaseModel): """ PlayQueueItemType - """ # noqa: E501 + """ - value: StrictStr - __properties: ClassVar[List[str]] = ["value"] + value: StrictStr = Field(...) + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set(["uri", "dlna", "radio", "deezer", "beoCloud", "tidal"]): + if value not in ("uri", "dlna", "radio", "deezer", "beoCloud", "tidal"): raise ValueError( "must be one of enum values ('uri', 'dlna', 'radio', 'deezer', 'beoCloud', 'tidal')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PlayQueueItemType: """Create an instance of PlayQueueItemType from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PlayQueueItemType: """Create an instance of PlayQueueItemType from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PlayQueueItemType.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = PlayQueueItemType.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/play_queue_settings.py b/python_client/mozart_api/models/play_queue_settings.py index 24dbd18..215c155 100644 --- a/python_client/mozart_api/models/play_queue_settings.py +++ b/python_client/mozart_api/models/play_queue_settings.py @@ -18,82 +18,66 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictBool, StrictStr, validator class PlayQueueSettings(BaseModel): """ PlayQueueSettings - """ # noqa: E501 + """ consume: Optional[StrictBool] = None gapless: Optional[StrictBool] = None repeat: Optional[StrictStr] = None shuffle: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["consume", "gapless", "repeat", "shuffle"] + __properties = ["consume", "gapless", "repeat", "shuffle"] - @field_validator("repeat") + @validator("repeat") def repeat_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["all", "track", "none"]): + if value not in ("all", "track", "none"): raise ValueError("must be one of enum values ('all', 'track', 'none')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PlayQueueSettings: """Create an instance of PlayQueueSettings from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PlayQueueSettings: """Create an instance of PlayQueueSettings from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PlayQueueSettings.parse_obj(obj) - _obj = cls.model_validate( + _obj = PlayQueueSettings.parse_obj( { "consume": obj.get("consume"), "gapless": obj.get("gapless"), diff --git a/python_client/mozart_api/models/playback_content_metadata.py b/python_client/mozart_api/models/playback_content_metadata.py index bf04b0a..70787df 100644 --- a/python_client/mozart_api/models/playback_content_metadata.py +++ b/python_client/mozart_api/models/playback_content_metadata.py @@ -18,67 +18,64 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator from mozart_api.models.art import Art from mozart_api.models.beolink_leader import BeolinkLeader -from typing import Optional, Set -from typing_extensions import Self class PlaybackContentMetadata(BaseModel): """ PlaybackContentMetadata - """ # noqa: E501 + """ - album_name: Optional[StrictStr] = Field(default=None, alias="albumName") - art: Optional[List[Art]] = None - artist_name: Optional[StrictStr] = Field(default=None, alias="artistName") + album_name: Optional[StrictStr] = Field(None, alias="albumName") + art: Optional[conlist(Art)] = None + artist_name: Optional[StrictStr] = Field(None, alias="artistName") bitdepth: Optional[StrictInt] = None bitrate: Optional[StrictInt] = None - container_name: Optional[StrictStr] = Field(default=None, alias="containerName") + container_name: Optional[StrictStr] = Field(None, alias="containerName") encoding: Optional[StrictStr] = None genre: Optional[StrictStr] = None id: Optional[StrictInt] = None input_channel_processing: Optional[StrictStr] = Field( - default=None, - description="Input processing/decoding on top of the base codec indicated in encoding. E.g. Dolby Atmos on top of Dolby TrueHD or Dolby Surround on top of PCM. For Dolby, this value has priority over encoding, meaning that if inputChannelProcessing has a value, it must be indicated in the app, and optionally the encoding value can be indicated as well. If inputChannelProcessing does not have value the encoding value must be indicated. ", + None, alias="inputChannelProcessing", + description="Input processing/decoding on top of the base codec indicated in encoding. E.g. Dolby Atmos on top of Dolby TrueHD or Dolby Surround on top of PCM. For Dolby, this value has priority over encoding, meaning that if inputChannelProcessing has a value, it must be indicated in the app, and optionally the encoding value can be indicated as well. If inputChannelProcessing does not have value the encoding value must be indicated. ", ) input_channels: Optional[StrictStr] = Field( - default=None, description="e.g. 5.1", alias="inputChannels" + None, alias="inputChannels", description="e.g. 5.1" ) organization: Optional[StrictStr] = Field( - default=None, + None, description='This can be filled by gstreamer\'s GST_TAG_ORGANIZATION. Mozart can also fill this with netradio station name like "P3" and TV content like "Netflix". This is needed so it\'s possible to show who the provider is for the playing audio track/content. ', ) output_channel_processing: Optional[StrictStr] = Field( - default=None, description="e.g. downmix", alias="outputChannelProcessing" + None, alias="outputChannelProcessing", description="e.g. downmix" ) output_channels: Optional[StrictStr] = Field( - default=None, description="e.g. 7.1", alias="outputChannels" + None, alias="outputChannels", description="e.g. 7.1" ) - queue_id: Optional[StrictStr] = Field(default=None, alias="queueId") - remote_leader: Optional[BeolinkLeader] = Field(default=None, alias="remoteLeader") - remote_source: Optional[StrictStr] = Field(default=None, alias="remoteSource") + queue_id: Optional[StrictStr] = Field(None, alias="queueId") + remote_leader: Optional[BeolinkLeader] = Field(None, alias="remoteLeader") + remote_source: Optional[StrictStr] = Field(None, alias="remoteSource") samplerate: Optional[StrictInt] = None source: Optional[StrictStr] = None - source_internal_id: Optional[StrictStr] = Field( - default=None, alias="sourceInternalId" - ) + source_internal_id: Optional[StrictStr] = Field(None, alias="sourceInternalId") title: Optional[StrictStr] = None total_duration: Optional[StrictInt] = Field( - default=None, - description="to be removed once all devices and apps are updated", + None, alias="totalDuration", + description="to be removed once all devices and apps are updated", ) total_duration_seconds: Optional[StrictInt] = Field( - default=None, alias="totalDurationSeconds" + None, alias="totalDurationSeconds" ) track: Optional[StrictInt] = None - track_count: Optional[StrictInt] = Field(default=None, alias="trackCount") + track_count: Optional[StrictInt] = Field(None, alias="trackCount") uri: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ + __properties = [ "albumName", "art", "artistName", @@ -107,95 +104,78 @@ class PlaybackContentMetadata(BaseModel): "uri", ] - @field_validator("encoding") + @validator("encoding") def encoding_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "pcm", - "wav", - "mp3", - "oggvorbis", - "aac", - "flac", - "sbc", - "alac", - "opus", - "DolbyDigital", - "DolbyDigitalPlus", - "DolbyTrueHD", - "unknown", - ] + if value not in ( + "pcm", + "wav", + "mp3", + "oggvorbis", + "aac", + "flac", + "sbc", + "alac", + "opus", + "DolbyDigital", + "DolbyDigitalPlus", + "DolbyTrueHD", + "unknown", ): raise ValueError( "must be one of enum values ('pcm', 'wav', 'mp3', 'oggvorbis', 'aac', 'flac', 'sbc', 'alac', 'opus', 'DolbyDigital', 'DolbyDigitalPlus', 'DolbyTrueHD', 'unknown')" ) return value - @field_validator("input_channel_processing") + @validator("input_channel_processing") def input_channel_processing_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["dolbySurround", "dolbyAtmos"]): + if value not in ("dolbySurround", "dolbyAtmos"): raise ValueError( "must be one of enum values ('dolbySurround', 'dolbyAtmos')" ) return value - @field_validator("output_channel_processing") + @validator("output_channel_processing") def output_channel_processing_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["Direct", "Downmix", "TrueImage"]): + if value not in ("Direct", "Downmix", "TrueImage"): raise ValueError( "must be one of enum values ('Direct', 'Downmix', 'TrueImage')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PlaybackContentMetadata: """Create an instance of PlaybackContentMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in art (list) _items = [] if self.art: @@ -207,95 +187,95 @@ def to_dict(self) -> Dict[str, Any]: if self.remote_leader: _dict["remoteLeader"] = self.remote_leader.to_dict() # set to None if input_channel_processing (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.input_channel_processing is None - and "input_channel_processing" in self.model_fields_set + and "input_channel_processing" in self.__fields_set__ ): _dict["inputChannelProcessing"] = None # set to None if input_channels (nullable) is None - # and model_fields_set contains the field - if self.input_channels is None and "input_channels" in self.model_fields_set: + # and __fields_set__ contains the field + if self.input_channels is None and "input_channels" in self.__fields_set__: _dict["inputChannels"] = None # set to None if output_channel_processing (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.output_channel_processing is None - and "output_channel_processing" in self.model_fields_set + and "output_channel_processing" in self.__fields_set__ ): _dict["outputChannelProcessing"] = None # set to None if output_channels (nullable) is None - # and model_fields_set contains the field - if self.output_channels is None and "output_channels" in self.model_fields_set: + # and __fields_set__ contains the field + if self.output_channels is None and "output_channels" in self.__fields_set__: _dict["outputChannels"] = None # set to None if remote_source (nullable) is None - # and model_fields_set contains the field - if self.remote_source is None and "remote_source" in self.model_fields_set: + # and __fields_set__ contains the field + if self.remote_source is None and "remote_source" in self.__fields_set__: _dict["remoteSource"] = None # set to None if total_duration (nullable) is None - # and model_fields_set contains the field - if self.total_duration is None and "total_duration" in self.model_fields_set: + # and __fields_set__ contains the field + if self.total_duration is None and "total_duration" in self.__fields_set__: _dict["totalDuration"] = None # set to None if total_duration_seconds (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.total_duration_seconds is None - and "total_duration_seconds" in self.model_fields_set + and "total_duration_seconds" in self.__fields_set__ ): _dict["totalDurationSeconds"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PlaybackContentMetadata: """Create an instance of PlaybackContentMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PlaybackContentMetadata.parse_obj(obj) - _obj = cls.model_validate( + _obj = PlaybackContentMetadata.parse_obj( { - "albumName": obj.get("albumName"), + "album_name": obj.get("albumName"), "art": ( - [Art.from_dict(_item) for _item in obj["art"]] + [Art.from_dict(_item) for _item in obj.get("art")] if obj.get("art") is not None else None ), - "artistName": obj.get("artistName"), + "artist_name": obj.get("artistName"), "bitdepth": obj.get("bitdepth"), "bitrate": obj.get("bitrate"), - "containerName": obj.get("containerName"), + "container_name": obj.get("containerName"), "encoding": obj.get("encoding"), "genre": obj.get("genre"), "id": obj.get("id"), - "inputChannelProcessing": obj.get("inputChannelProcessing"), - "inputChannels": obj.get("inputChannels"), + "input_channel_processing": obj.get("inputChannelProcessing"), + "input_channels": obj.get("inputChannels"), "organization": obj.get("organization"), - "outputChannelProcessing": obj.get("outputChannelProcessing"), - "outputChannels": obj.get("outputChannels"), - "queueId": obj.get("queueId"), - "remoteLeader": ( - BeolinkLeader.from_dict(obj["remoteLeader"]) + "output_channel_processing": obj.get("outputChannelProcessing"), + "output_channels": obj.get("outputChannels"), + "queue_id": obj.get("queueId"), + "remote_leader": ( + BeolinkLeader.from_dict(obj.get("remoteLeader")) if obj.get("remoteLeader") is not None else None ), - "remoteSource": obj.get("remoteSource"), + "remote_source": obj.get("remoteSource"), "samplerate": obj.get("samplerate"), "source": obj.get("source"), - "sourceInternalId": obj.get("sourceInternalId"), + "source_internal_id": obj.get("sourceInternalId"), "title": obj.get("title"), - "totalDuration": obj.get("totalDuration"), - "totalDurationSeconds": obj.get("totalDurationSeconds"), + "total_duration": obj.get("totalDuration"), + "total_duration_seconds": obj.get("totalDurationSeconds"), "track": obj.get("track"), - "trackCount": obj.get("trackCount"), + "track_count": obj.get("trackCount"), "uri": obj.get("uri"), } ) diff --git a/python_client/mozart_api/models/playback_error.py b/python_client/mozart_api/models/playback_error.py index c1a2529..1865048 100644 --- a/python_client/mozart_api/models/playback_error.py +++ b/python_client/mozart_api/models/playback_error.py @@ -18,78 +18,62 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, StrictStr from mozart_api.models.playback_content_metadata import PlaybackContentMetadata -from typing import Optional, Set -from typing_extensions import Self class PlaybackError(BaseModel): """ PlaybackError - """ # noqa: E501 + """ error: Optional[StrictStr] = None item: Optional[PlaybackContentMetadata] = None - __properties: ClassVar[List[str]] = ["error", "item"] + __properties = ["error", "item"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PlaybackError: """Create an instance of PlaybackError from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of item if self.item: _dict["item"] = self.item.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PlaybackError: """Create an instance of PlaybackError from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PlaybackError.parse_obj(obj) - _obj = cls.model_validate( + _obj = PlaybackError.parse_obj( { "error": obj.get("error"), "item": ( - PlaybackContentMetadata.from_dict(obj["item"]) + PlaybackContentMetadata.from_dict(obj.get("item")) if obj.get("item") is not None else None ), diff --git a/python_client/mozart_api/models/playback_progress.py b/python_client/mozart_api/models/playback_progress.py index 1c1353c..a252634 100644 --- a/python_client/mozart_api/models/playback_progress.py +++ b/python_client/mozart_api/models/playback_progress.py @@ -18,80 +18,64 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr class PlaybackProgress(BaseModel): """ PlaybackProgress - """ # noqa: E501 + """ id: Optional[StrictStr] = None progress: Optional[StrictInt] = None - total_duration: Optional[StrictInt] = Field(default=None, alias="totalDuration") - __properties: ClassVar[List[str]] = ["id", "progress", "totalDuration"] + total_duration: Optional[StrictInt] = Field(None, alias="totalDuration") + __properties = ["id", "progress", "totalDuration"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PlaybackProgress: """Create an instance of PlaybackProgress from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if total_duration (nullable) is None - # and model_fields_set contains the field - if self.total_duration is None and "total_duration" in self.model_fields_set: + # and __fields_set__ contains the field + if self.total_duration is None and "total_duration" in self.__fields_set__: _dict["totalDuration"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PlaybackProgress: """Create an instance of PlaybackProgress from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PlaybackProgress.parse_obj(obj) - _obj = cls.model_validate( + _obj = PlaybackProgress.parse_obj( { "id": obj.get("id"), "progress": obj.get("progress"), - "totalDuration": obj.get("totalDuration"), + "total_duration": obj.get("totalDuration"), } ) return _obj diff --git a/python_client/mozart_api/models/playback_state.py b/python_client/mozart_api/models/playback_state.py index c229485..5a6efb1 100644 --- a/python_client/mozart_api/models/playback_state.py +++ b/python_client/mozart_api/models/playback_state.py @@ -18,64 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel from mozart_api.models.playback_content_metadata import PlaybackContentMetadata from mozart_api.models.playback_progress import PlaybackProgress from mozart_api.models.rendering_state import RenderingState from mozart_api.models.source import Source -from typing import Optional, Set -from typing_extensions import Self class PlaybackState(BaseModel): """ PlaybackState - """ # noqa: E501 + """ metadata: Optional[PlaybackContentMetadata] = None progress: Optional[PlaybackProgress] = None source: Optional[Source] = None state: Optional[RenderingState] = None - __properties: ClassVar[List[str]] = ["metadata", "progress", "source", "state"] + __properties = ["metadata", "progress", "source", "state"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PlaybackState: """Create an instance of PlaybackState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict["metadata"] = self.metadata.to_dict() @@ -91,33 +75,33 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PlaybackState: """Create an instance of PlaybackState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PlaybackState.parse_obj(obj) - _obj = cls.model_validate( + _obj = PlaybackState.parse_obj( { "metadata": ( - PlaybackContentMetadata.from_dict(obj["metadata"]) + PlaybackContentMetadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None ), "progress": ( - PlaybackProgress.from_dict(obj["progress"]) + PlaybackProgress.from_dict(obj.get("progress")) if obj.get("progress") is not None else None ), "source": ( - Source.from_dict(obj["source"]) + Source.from_dict(obj.get("source")) if obj.get("source") is not None else None ), "state": ( - RenderingState.from_dict(obj["state"]) + RenderingState.from_dict(obj.get("state")) if obj.get("state") is not None else None ), diff --git a/python_client/mozart_api/models/power_link_trigger.py b/python_client/mozart_api/models/power_link_trigger.py index d35ce30..8ff5ab9 100644 --- a/python_client/mozart_api/models/power_link_trigger.py +++ b/python_client/mozart_api/models/power_link_trigger.py @@ -18,71 +18,57 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt class PowerLinkTrigger(BaseModel): """ PowerLinkTrigger - """ # noqa: E501 + """ power_link_preset: Optional[StrictInt] = Field( - default=None, - description="Despite the name, this preset is used anytime a speaker is used as a secondary as a way for the primary to indicate which directivity (and possibly other caracteristics in the future) should be used on a speaker by speaker basis. It is used when a speaker is a powerlink speaker (hence the name), WISA speaker or a speakerlink secondary in multichannel. ", + None, alias="powerLinkPreset", + description="Despite the name, this preset is used anytime a speaker is used as a secondary as a way for the primary to indicate which directivity (and possibly other caracteristics in the future) should be used on a speaker by speaker basis. It is used when a speaker is a powerlink speaker (hence the name), WISA speaker or a speakerlink secondary in multichannel. ", ) - __properties: ClassVar[List[str]] = ["powerLinkPreset"] + __properties = ["powerLinkPreset"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PowerLinkTrigger: """Create an instance of PowerLinkTrigger from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PowerLinkTrigger: """Create an instance of PowerLinkTrigger from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PowerLinkTrigger.parse_obj(obj) - _obj = cls.model_validate({"powerLinkPreset": obj.get("powerLinkPreset")}) + _obj = PowerLinkTrigger.parse_obj( + {"power_link_preset": obj.get("powerLinkPreset")} + ) return _obj diff --git a/python_client/mozart_api/models/power_state_enum.py b/python_client/mozart_api/models/power_state_enum.py index 14a39be..e524d10 100644 --- a/python_client/mozart_api/models/power_state_enum.py +++ b/python_client/mozart_api/models/power_state_enum.py @@ -18,79 +18,63 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class PowerStateEnum(BaseModel): """ PowerStateEnum - """ # noqa: E501 + """ value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["networkStandby", "on", "standby", "shutdown", "storage"]): + if value not in ("networkStandby", "on", "standby", "shutdown", "storage"): raise ValueError( "must be one of enum values ('networkStandby', 'on', 'standby', 'shutdown', 'storage')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> PowerStateEnum: """Create an instance of PowerStateEnum from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> PowerStateEnum: """Create an instance of PowerStateEnum from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return PowerStateEnum.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = PowerStateEnum.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/preset.py b/python_client/mozart_api/models/preset.py index 5bbfa99..4034f32 100644 --- a/python_client/mozart_api/models/preset.py +++ b/python_client/mozart_api/models/preset.py @@ -18,34 +18,33 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist from mozart_api.models.action import Action from mozart_api.models.content_item import ContentItem from mozart_api.models.source_type_enum import SourceTypeEnum -from typing import Optional, Set -from typing_extensions import Self class Preset(BaseModel): """ Preset - """ # noqa: E501 + """ - action_list: Optional[List[Action]] = Field( - default=None, - description="An ordered list of Actions to run on the product", + action_list: Optional[conlist(Action)] = Field( + None, alias="actionList", + description="An ordered list of Actions to run on the product", ) - scene_list: Optional[List[StrictStr]] = Field( - default=None, description="A list of scenes", alias="sceneList" + scene_list: Optional[conlist(StrictStr)] = Field( + None, alias="sceneList", description="A list of scenes" ) content: Optional[ContentItem] = None id: Optional[StrictStr] = None name: Optional[StrictStr] = None source: Optional[SourceTypeEnum] = None title: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ + __properties = [ "actionList", "sceneList", "content", @@ -55,43 +54,28 @@ class Preset(BaseModel): "title", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Preset: """Create an instance of Preset from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in action_list (list) _items = [] if self.action_list: @@ -106,38 +90,38 @@ def to_dict(self) -> Dict[str, Any]: if self.source: _dict["source"] = self.source.to_dict() # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: + # and __fields_set__ contains the field + if self.name is None and "name" in self.__fields_set__: _dict["name"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Preset: """Create an instance of Preset from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Preset.parse_obj(obj) - _obj = cls.model_validate( + _obj = Preset.parse_obj( { - "actionList": ( - [Action.from_dict(_item) for _item in obj["actionList"]] + "action_list": ( + [Action.from_dict(_item) for _item in obj.get("actionList")] if obj.get("actionList") is not None else None ), - "sceneList": obj.get("sceneList"), + "scene_list": obj.get("sceneList"), "content": ( - ContentItem.from_dict(obj["content"]) + ContentItem.from_dict(obj.get("content")) if obj.get("content") is not None else None ), "id": obj.get("id"), "name": obj.get("name"), "source": ( - SourceTypeEnum.from_dict(obj["source"]) + SourceTypeEnum.from_dict(obj.get("source")) if obj.get("source") is not None else None ), diff --git a/python_client/mozart_api/models/product_curtain_status.py b/python_client/mozart_api/models/product_curtain_status.py index 10b9272..7082a35 100644 --- a/python_client/mozart_api/models/product_curtain_status.py +++ b/python_client/mozart_api/models/product_curtain_status.py @@ -18,82 +18,66 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictBool, StrictStr, validator class ProductCurtainStatus(BaseModel): """ ProductCurtainStatus - """ # noqa: E501 + """ moving: Optional[StrictBool] = None position: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["moving", "position"] + __properties = ["moving", "position"] - @field_validator("position") + @validator("position") def position_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["unknown", "closed", "narrow", "wide"]): + if value not in ("unknown", "closed", "narrow", "wide"): raise ValueError( "must be one of enum values ('unknown', 'closed', 'narrow', 'wide')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ProductCurtainStatus: """Create an instance of ProductCurtainStatus from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ProductCurtainStatus: """Create an instance of ProductCurtainStatus from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ProductCurtainStatus.parse_obj(obj) - _obj = cls.model_validate( + _obj = ProductCurtainStatus.parse_obj( {"moving": obj.get("moving"), "position": obj.get("position")} ) return _obj diff --git a/python_client/mozart_api/models/product_friendly_name.py b/python_client/mozart_api/models/product_friendly_name.py index 06aa5fc..aca474b 100644 --- a/python_client/mozart_api/models/product_friendly_name.py +++ b/python_client/mozart_api/models/product_friendly_name.py @@ -18,71 +18,55 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class ProductFriendlyName(BaseModel): """ ProductFriendlyName - """ # noqa: E501 + """ friendly_name: Optional[StrictStr] = Field( - default=None, - description="The friendly name of the product, assignable by the end user, e.g. 'Kitchen speaker ", + None, alias="friendlyName", + description="The friendly name of the product, assignable by the end user, e.g. 'Kitchen speaker ", ) - __properties: ClassVar[List[str]] = ["friendlyName"] + __properties = ["friendlyName"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ProductFriendlyName: """Create an instance of ProductFriendlyName from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ProductFriendlyName: """Create an instance of ProductFriendlyName from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ProductFriendlyName.parse_obj(obj) - _obj = cls.model_validate({"friendlyName": obj.get("friendlyName")}) + _obj = ProductFriendlyName.parse_obj({"friendly_name": obj.get("friendlyName")}) return _obj diff --git a/python_client/mozart_api/models/product_state.py b/python_client/mozart_api/models/product_state.py index 9decfee..be9f44b 100644 --- a/python_client/mozart_api/models/product_state.py +++ b/python_client/mozart_api/models/product_state.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.microphones_state import MicrophonesState from mozart_api.models.playback_state import PlaybackState from mozart_api.models.power_state_enum import PowerStateEnum @@ -28,26 +29,24 @@ from mozart_api.models.source import Source from mozart_api.models.tv_state import TvState from mozart_api.models.volume_state import VolumeState -from typing import Optional, Set -from typing_extensions import Self class ProductState(BaseModel): """ ProductState - """ # noqa: E501 + """ microphones: Optional[MicrophonesState] = None playback: Optional[PlaybackState] = None - power_state: Optional[PowerStateEnum] = Field(default=None, alias="powerState") + power_state: Optional[PowerStateEnum] = Field(None, alias="powerState") software_update_state: Optional[SoftwareUpdateState] = Field( - default=None, alias="softwareUpdateState" + None, alias="softwareUpdateState" ) - sound_settings: Optional[SoundSettings] = Field(default=None, alias="soundSettings") + sound_settings: Optional[SoundSettings] = Field(None, alias="soundSettings") source: Optional[Source] = None tv: Optional[TvState] = None volume: Optional[VolumeState] = None - __properties: ClassVar[List[str]] = [ + __properties = [ "microphones", "playback", "powerState", @@ -58,43 +57,28 @@ class ProductState(BaseModel): "volume", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ProductState: """Create an instance of ProductState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of microphones if self.microphones: _dict["microphones"] = self.microphones.to_dict() @@ -122,51 +106,53 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ProductState: """Create an instance of ProductState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ProductState.parse_obj(obj) - _obj = cls.model_validate( + _obj = ProductState.parse_obj( { "microphones": ( - MicrophonesState.from_dict(obj["microphones"]) + MicrophonesState.from_dict(obj.get("microphones")) if obj.get("microphones") is not None else None ), "playback": ( - PlaybackState.from_dict(obj["playback"]) + PlaybackState.from_dict(obj.get("playback")) if obj.get("playback") is not None else None ), - "powerState": ( - PowerStateEnum.from_dict(obj["powerState"]) + "power_state": ( + PowerStateEnum.from_dict(obj.get("powerState")) if obj.get("powerState") is not None else None ), - "softwareUpdateState": ( - SoftwareUpdateState.from_dict(obj["softwareUpdateState"]) + "software_update_state": ( + SoftwareUpdateState.from_dict(obj.get("softwareUpdateState")) if obj.get("softwareUpdateState") is not None else None ), - "soundSettings": ( - SoundSettings.from_dict(obj["soundSettings"]) + "sound_settings": ( + SoundSettings.from_dict(obj.get("soundSettings")) if obj.get("soundSettings") is not None else None ), "source": ( - Source.from_dict(obj["source"]) + Source.from_dict(obj.get("source")) if obj.get("source") is not None else None ), "tv": ( - TvState.from_dict(obj["tv"]) if obj.get("tv") is not None else None + TvState.from_dict(obj.get("tv")) + if obj.get("tv") is not None + else None ), "volume": ( - VolumeState.from_dict(obj["volume"]) + VolumeState.from_dict(obj.get("volume")) if obj.get("volume") is not None else None ), diff --git a/python_client/mozart_api/models/remote_menu_item.py b/python_client/mozart_api/models/remote_menu_item.py index 333c625..cb016c2 100644 --- a/python_client/mozart_api/models/remote_menu_item.py +++ b/python_client/mozart_api/models/remote_menu_item.py @@ -18,64 +18,56 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, validator from mozart_api.models.action import Action from mozart_api.models.content_item import ContentItem -from typing import Optional, Set -from typing_extensions import Self class RemoteMenuItem(BaseModel): """ RemoteMenuItem - """ # noqa: E501 + """ - action_list: Optional[List[Action]] = Field( - default=None, - description="An ordered list of Actions to run on the product", + action_list: Optional[conlist(Action)] = Field( + None, alias="actionList", + description="An ordered list of Actions to run on the product", ) - scene_list: Optional[List[StrictStr]] = Field( - default=None, description="A list of scenes", alias="sceneList" + scene_list: Optional[conlist(StrictStr)] = Field( + None, alias="sceneList", description="A list of scenes" ) disabled: Optional[StrictBool] = None dynamic_list: Optional[StrictStr] = Field( - default=None, - description="Let mozart create a dynamic list. This list will be attached as children to the menu item. If dynamicList is set it's not possible to change or manipulate any of the children because mozart can alter them at any given time ", + None, alias="dynamicList", + description="Let mozart create a dynamic list. This list will be attached as children to the menu item. If dynamicList is set it's not possible to change or manipulate any of the children because mozart can alter them at any given time ", ) first_child_menu_item_id: Optional[StrictStr] = Field( - default=None, - description="ID of the first child menu item", + None, alias="firstChildMenuItemId", + description="ID of the first child menu item", ) label: Optional[StrictStr] = Field( - default=None, - description="Alternative label, if omitted mozart will try its best", + None, description="Alternative label, if omitted mozart will try its best" ) next_sibling_menu_item_id: Optional[StrictStr] = Field( - default=None, - description="ID of the next sibling menu item", + None, alias="nextSiblingMenuItemId", + description="ID of the next sibling menu item", ) parent_menu_item_id: Optional[StrictStr] = Field( - default=None, description="ID of the parent menu item", alias="parentMenuItemId" + None, alias="parentMenuItemId", description="ID of the parent menu item" ) available: Optional[StrictBool] = None content: Optional[ContentItem] = None fixed: StrictBool = Field( - description="True if this is a fixed menu item. A fixed item can't be deleted or moved" + ..., + description="True if this is a fixed menu item. A fixed item can't be deleted or moved", ) - id: StrictStr = Field(description="Unique ID for this menu item") - __properties: ClassVar[List[str]] = [ + id: StrictStr = Field(..., description="Unique ID for this menu item") + __properties = [ "actionList", "sceneList", "disabled", @@ -90,53 +82,38 @@ class RemoteMenuItem(BaseModel): "id", ] - @field_validator("dynamic_list") + @validator("dynamic_list") def dynamic_list_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["none", "radioFavorites"]): + if value not in ("none", "radioFavorites"): raise ValueError("must be one of enum values ('none', 'radioFavorites')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RemoteMenuItem: """Create an instance of RemoteMenuItem from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in action_list (list) _items = [] if self.action_list: @@ -148,77 +125,77 @@ def to_dict(self) -> Dict[str, Any]: if self.content: _dict["content"] = self.content.to_dict() # set to None if disabled (nullable) is None - # and model_fields_set contains the field - if self.disabled is None and "disabled" in self.model_fields_set: + # and __fields_set__ contains the field + if self.disabled is None and "disabled" in self.__fields_set__: _dict["disabled"] = None # set to None if dynamic_list (nullable) is None - # and model_fields_set contains the field - if self.dynamic_list is None and "dynamic_list" in self.model_fields_set: + # and __fields_set__ contains the field + if self.dynamic_list is None and "dynamic_list" in self.__fields_set__: _dict["dynamicList"] = None # set to None if first_child_menu_item_id (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.first_child_menu_item_id is None - and "first_child_menu_item_id" in self.model_fields_set + and "first_child_menu_item_id" in self.__fields_set__ ): _dict["firstChildMenuItemId"] = None # set to None if label (nullable) is None - # and model_fields_set contains the field - if self.label is None and "label" in self.model_fields_set: + # and __fields_set__ contains the field + if self.label is None and "label" in self.__fields_set__: _dict["label"] = None # set to None if next_sibling_menu_item_id (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.next_sibling_menu_item_id is None - and "next_sibling_menu_item_id" in self.model_fields_set + and "next_sibling_menu_item_id" in self.__fields_set__ ): _dict["nextSiblingMenuItemId"] = None # set to None if parent_menu_item_id (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.parent_menu_item_id is None - and "parent_menu_item_id" in self.model_fields_set + and "parent_menu_item_id" in self.__fields_set__ ): _dict["parentMenuItemId"] = None # set to None if available (nullable) is None - # and model_fields_set contains the field - if self.available is None and "available" in self.model_fields_set: + # and __fields_set__ contains the field + if self.available is None and "available" in self.__fields_set__: _dict["available"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RemoteMenuItem: """Create an instance of RemoteMenuItem from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RemoteMenuItem.parse_obj(obj) - _obj = cls.model_validate( + _obj = RemoteMenuItem.parse_obj( { - "actionList": ( - [Action.from_dict(_item) for _item in obj["actionList"]] + "action_list": ( + [Action.from_dict(_item) for _item in obj.get("actionList")] if obj.get("actionList") is not None else None ), - "sceneList": obj.get("sceneList"), + "scene_list": obj.get("sceneList"), "disabled": obj.get("disabled"), - "dynamicList": obj.get("dynamicList"), - "firstChildMenuItemId": obj.get("firstChildMenuItemId"), + "dynamic_list": obj.get("dynamicList"), + "first_child_menu_item_id": obj.get("firstChildMenuItemId"), "label": obj.get("label"), - "nextSiblingMenuItemId": obj.get("nextSiblingMenuItemId"), - "parentMenuItemId": obj.get("parentMenuItemId"), + "next_sibling_menu_item_id": obj.get("nextSiblingMenuItemId"), + "parent_menu_item_id": obj.get("parentMenuItemId"), "available": obj.get("available"), "content": ( - ContentItem.from_dict(obj["content"]) + ContentItem.from_dict(obj.get("content")) if obj.get("content") is not None else None ), diff --git a/python_client/mozart_api/models/remote_menu_item_properties.py b/python_client/mozart_api/models/remote_menu_item_properties.py index 4f90008..1589be5 100644 --- a/python_client/mozart_api/models/remote_menu_item_properties.py +++ b/python_client/mozart_api/models/remote_menu_item_properties.py @@ -18,57 +18,48 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, validator from mozart_api.models.action import Action -from typing import Optional, Set -from typing_extensions import Self class RemoteMenuItemProperties(BaseModel): """ RemoteMenuItemProperties - """ # noqa: E501 + """ - action_list: Optional[List[Action]] = Field( - default=None, - description="An ordered list of Actions to run on the product", + action_list: Optional[conlist(Action)] = Field( + None, alias="actionList", + description="An ordered list of Actions to run on the product", ) - scene_list: Optional[List[StrictStr]] = Field( - default=None, description="A list of scenes", alias="sceneList" + scene_list: Optional[conlist(StrictStr)] = Field( + None, alias="sceneList", description="A list of scenes" ) disabled: Optional[StrictBool] = None dynamic_list: Optional[StrictStr] = Field( - default=None, - description="Let mozart create a dynamic list. This list will be attached as children to the menu item. If dynamicList is set it's not possible to change or manipulate any of the children because mozart can alter them at any given time ", + None, alias="dynamicList", + description="Let mozart create a dynamic list. This list will be attached as children to the menu item. If dynamicList is set it's not possible to change or manipulate any of the children because mozart can alter them at any given time ", ) first_child_menu_item_id: Optional[StrictStr] = Field( - default=None, - description="ID of the first child menu item", + None, alias="firstChildMenuItemId", + description="ID of the first child menu item", ) label: Optional[StrictStr] = Field( - default=None, - description="Alternative label, if omitted mozart will try its best", + None, description="Alternative label, if omitted mozart will try its best" ) next_sibling_menu_item_id: Optional[StrictStr] = Field( - default=None, - description="ID of the next sibling menu item", + None, alias="nextSiblingMenuItemId", + description="ID of the next sibling menu item", ) parent_menu_item_id: Optional[StrictStr] = Field( - default=None, description="ID of the parent menu item", alias="parentMenuItemId" + None, alias="parentMenuItemId", description="ID of the parent menu item" ) - __properties: ClassVar[List[str]] = [ + __properties = [ "actionList", "sceneList", "disabled", @@ -79,53 +70,38 @@ class RemoteMenuItemProperties(BaseModel): "parentMenuItemId", ] - @field_validator("dynamic_list") + @validator("dynamic_list") def dynamic_list_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["none", "radioFavorites"]): + if value not in ("none", "radioFavorites"): raise ValueError("must be one of enum values ('none', 'radioFavorites')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RemoteMenuItemProperties: """Create an instance of RemoteMenuItemProperties from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in action_list (list) _items = [] if self.action_list: @@ -134,69 +110,69 @@ def to_dict(self) -> Dict[str, Any]: _items.append(_item.to_dict()) _dict["actionList"] = _items # set to None if disabled (nullable) is None - # and model_fields_set contains the field - if self.disabled is None and "disabled" in self.model_fields_set: + # and __fields_set__ contains the field + if self.disabled is None and "disabled" in self.__fields_set__: _dict["disabled"] = None # set to None if dynamic_list (nullable) is None - # and model_fields_set contains the field - if self.dynamic_list is None and "dynamic_list" in self.model_fields_set: + # and __fields_set__ contains the field + if self.dynamic_list is None and "dynamic_list" in self.__fields_set__: _dict["dynamicList"] = None # set to None if first_child_menu_item_id (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.first_child_menu_item_id is None - and "first_child_menu_item_id" in self.model_fields_set + and "first_child_menu_item_id" in self.__fields_set__ ): _dict["firstChildMenuItemId"] = None # set to None if label (nullable) is None - # and model_fields_set contains the field - if self.label is None and "label" in self.model_fields_set: + # and __fields_set__ contains the field + if self.label is None and "label" in self.__fields_set__: _dict["label"] = None # set to None if next_sibling_menu_item_id (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.next_sibling_menu_item_id is None - and "next_sibling_menu_item_id" in self.model_fields_set + and "next_sibling_menu_item_id" in self.__fields_set__ ): _dict["nextSiblingMenuItemId"] = None # set to None if parent_menu_item_id (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.parent_menu_item_id is None - and "parent_menu_item_id" in self.model_fields_set + and "parent_menu_item_id" in self.__fields_set__ ): _dict["parentMenuItemId"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RemoteMenuItemProperties: """Create an instance of RemoteMenuItemProperties from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RemoteMenuItemProperties.parse_obj(obj) - _obj = cls.model_validate( + _obj = RemoteMenuItemProperties.parse_obj( { - "actionList": ( - [Action.from_dict(_item) for _item in obj["actionList"]] + "action_list": ( + [Action.from_dict(_item) for _item in obj.get("actionList")] if obj.get("actionList") is not None else None ), - "sceneList": obj.get("sceneList"), + "scene_list": obj.get("sceneList"), "disabled": obj.get("disabled"), - "dynamicList": obj.get("dynamicList"), - "firstChildMenuItemId": obj.get("firstChildMenuItemId"), + "dynamic_list": obj.get("dynamicList"), + "first_child_menu_item_id": obj.get("firstChildMenuItemId"), "label": obj.get("label"), - "nextSiblingMenuItemId": obj.get("nextSiblingMenuItemId"), - "parentMenuItemId": obj.get("parentMenuItemId"), + "next_sibling_menu_item_id": obj.get("nextSiblingMenuItemId"), + "parent_menu_item_id": obj.get("parentMenuItemId"), } ) return _obj diff --git a/python_client/mozart_api/models/remote_ui_key_state.py b/python_client/mozart_api/models/remote_ui_key_state.py index 6722a16..91239c9 100644 --- a/python_client/mozart_api/models/remote_ui_key_state.py +++ b/python_client/mozart_api/models/remote_ui_key_state.py @@ -18,82 +18,66 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator class RemoteUIKeyState(BaseModel): """ RemoteUIKeyState - """ # noqa: E501 + """ state: Optional[StrictStr] = Field( - default=None, + None, description="The state of the pressed key. ShortPress and LongPress's duration are determined by the remote. Whereas Down, Continue, and Release reflect the state of the key and press duration is the time between a Down and a Release state. Continue indicates that a button is pressed and the key event should be handled multiple times until a release is received. ", ) - __properties: ClassVar[List[str]] = ["state"] + __properties = ["state"] - @field_validator("state") + @validator("state") def state_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["ShortPress", "LongPress", "Down", "Continue", "Release"]): + if value not in ("ShortPress", "LongPress", "Down", "Continue", "Release"): raise ValueError( "must be one of enum values ('ShortPress', 'LongPress', 'Down', 'Continue', 'Release')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RemoteUIKeyState: """Create an instance of RemoteUIKeyState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RemoteUIKeyState: """Create an instance of RemoteUIKeyState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RemoteUIKeyState.parse_obj(obj) - _obj = cls.model_validate({"state": obj.get("state")}) + _obj = RemoteUIKeyState.parse_obj({"state": obj.get("state")}) return _obj diff --git a/python_client/mozart_api/models/rendering_state.py b/python_client/mozart_api/models/rendering_state.py index 9ceeaa6..cc10b53 100644 --- a/python_client/mozart_api/models/rendering_state.py +++ b/python_client/mozart_api/models/rendering_state.py @@ -18,90 +18,72 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class RenderingState(BaseModel): """ RenderingState - """ # noqa: E501 + """ value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "idle", - "buffering", - "started", - "paused", - "stopped", - "ended", - "error", - "unknown", - ] + if value not in ( + "idle", + "buffering", + "started", + "paused", + "stopped", + "ended", + "error", + "unknown", ): raise ValueError( "must be one of enum values ('idle', 'buffering', 'started', 'paused', 'stopped', 'ended', 'error', 'unknown')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RenderingState: """Create an instance of RenderingState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RenderingState: """Create an instance of RenderingState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RenderingState.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = RenderingState.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/room_compensation.py b/python_client/mozart_api/models/room_compensation.py index 1490044..6421975 100644 --- a/python_client/mozart_api/models/room_compensation.py +++ b/python_client/mozart_api/models/room_compensation.py @@ -18,69 +18,54 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist class RoomCompensation(BaseModel): """ RoomCompensation - """ # noqa: E501 + """ - value: List[StrictStr] = Field( - description="List of room compensation sweeps to combine. No room compensation is done if this list is empty. The maximum length of this list is product specific. " + value: conlist(StrictStr) = Field( + ..., + description="List of room compensation sweeps to combine. No room compensation is done if this list is empty. The maximum length of this list is product specific. ", ) - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensation: """Create an instance of RoomCompensation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensation: """Create an instance of RoomCompensation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensation.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = RoomCompensation.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/room_compensation_current_measurement.py b/python_client/mozart_api/models/room_compensation_current_measurement.py index 5eb235b..a405d79 100644 --- a/python_client/mozart_api/models/room_compensation_current_measurement.py +++ b/python_client/mozart_api/models/room_compensation_current_measurement.py @@ -18,85 +18,69 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator class RoomCompensationCurrentMeasurement(BaseModel): """ - State and speaker ID of the currently running measurement. Is only relevant for advanced room compensation. - """ # noqa: E501 + State and speaker ID of the currently running measurement. Is only relevant for advanced room compensation. # noqa: E501 + """ - speaker_id: Optional[StrictStr] = Field(default=None, alias="speakerId") + speaker_id: Optional[StrictStr] = Field(None, alias="speakerId") state: Optional[StrictStr] = Field( - default=None, + None, description="State of the measurement for the speaker. started: The measurement has started. done: The measurement has ended successfully. lastDone: The last measurement in the run has ended successfully. error: An error occurred during measurement. ", ) - __properties: ClassVar[List[str]] = ["speakerId", "state"] + __properties = ["speakerId", "state"] - @field_validator("state") + @validator("state") def state_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["started", "done", "lastDone", "error"]): + if value not in ("started", "done", "lastDone", "error"): raise ValueError( "must be one of enum values ('started', 'done', 'lastDone', 'error')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationCurrentMeasurement: """Create an instance of RoomCompensationCurrentMeasurement from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationCurrentMeasurement: """Create an instance of RoomCompensationCurrentMeasurement from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationCurrentMeasurement.parse_obj(obj) - _obj = cls.model_validate( - {"speakerId": obj.get("speakerId"), "state": obj.get("state")} + _obj = RoomCompensationCurrentMeasurement.parse_obj( + {"speaker_id": obj.get("speakerId"), "state": obj.get("state")} ) return _obj diff --git a/python_client/mozart_api/models/room_compensation_debug.py b/python_client/mozart_api/models/room_compensation_debug.py index 1a6f42b..1e94710 100644 --- a/python_client/mozart_api/models/room_compensation_debug.py +++ b/python_client/mozart_api/models/room_compensation_debug.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictBool class RoomCompensationDebug(BaseModel): """ RoomCompensationDebug - """ # noqa: E501 + """ value: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationDebug: """Create an instance of RoomCompensationDebug from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationDebug: """Create an instance of RoomCompensationDebug from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationDebug.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = RoomCompensationDebug.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/room_compensation_enabled.py b/python_client/mozart_api/models/room_compensation_enabled.py index 56202af..3da4899 100644 --- a/python_client/mozart_api/models/room_compensation_enabled.py +++ b/python_client/mozart_api/models/room_compensation_enabled.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictBool class RoomCompensationEnabled(BaseModel): """ RoomCompensationEnabled - """ # noqa: E501 + """ value: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationEnabled: """Create an instance of RoomCompensationEnabled from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationEnabled: """Create an instance of RoomCompensationEnabled from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationEnabled.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = RoomCompensationEnabled.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/room_compensation_error_details.py b/python_client/mozart_api/models/room_compensation_error_details.py index 47a4e8e..8e12b55 100644 --- a/python_client/mozart_api/models/room_compensation_error_details.py +++ b/python_client/mozart_api/models/room_compensation_error_details.py @@ -18,64 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, Field, conlist from mozart_api.models.room_compensation_measurement_error import ( RoomCompensationMeasurementError, ) -from typing import Optional, Set -from typing_extensions import Self class RoomCompensationErrorDetails(BaseModel): """ RoomCompensationErrorDetails - """ # noqa: E501 + """ - error_list: Optional[List[RoomCompensationMeasurementError]] = Field( - default=None, - description="List of the speakers where measurement failed, including error type.", + error_list: Optional[conlist(RoomCompensationMeasurementError)] = Field( + None, alias="errorList", + description="List of the speakers where measurement failed, including error type.", ) - __properties: ClassVar[List[str]] = ["errorList"] + __properties = ["errorList"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationErrorDetails: """Create an instance of RoomCompensationErrorDetails from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in error_list (list) _items = [] if self.error_list: @@ -86,20 +70,20 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationErrorDetails: """Create an instance of RoomCompensationErrorDetails from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationErrorDetails.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationErrorDetails.parse_obj( { - "errorList": ( + "error_list": ( [ RoomCompensationMeasurementError.from_dict(_item) - for _item in obj["errorList"] + for _item in obj.get("errorList") ] if obj.get("errorList") is not None else None diff --git a/python_client/mozart_api/models/room_compensation_feature.py b/python_client/mozart_api/models/room_compensation_feature.py index b0d6d93..b871f5a 100644 --- a/python_client/mozart_api/models/room_compensation_feature.py +++ b/python_client/mozart_api/models/room_compensation_feature.py @@ -18,85 +18,72 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conint, conlist class RoomCompensationFeature(BaseModel): """ RoomCompensationFeature - """ # noqa: E501 + """ - value: List[StrictStr] = Field( - description="List of room compensation sweeps to combine. No room compensation is done if this list is empty. The maximum length of this list is product specific. " + value: conlist(StrictStr) = Field( + ..., + description="List of room compensation sweeps to combine. No room compensation is done if this list is empty. The maximum length of this list is product specific. ", ) - default: List[StrictStr] = Field( - description="List of room compensation sweeps to combine. No room compensation is done if this list is empty. The maximum length of this list is product specific. " + default: conlist(StrictStr) = Field( + ..., + description="List of room compensation sweeps to combine. No room compensation is done if this list is empty. The maximum length of this list is product specific. ", ) - max_items: Optional[Annotated[int, Field(le=20, strict=True, ge=1)]] = Field( - default=None, - description="Maximum number of items in the `value` field", + max_items: Optional[conint(strict=True, le=20, ge=1)] = Field( + None, alias="maxItems", + description="Maximum number of items in the `value` field", ) - range: List[StrictStr] = Field(description="Possible values for the `value` field") - __properties: ClassVar[List[str]] = ["value", "default", "maxItems", "range"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + range: conlist(StrictStr) = Field( + ..., description="Possible values for the `value` field" ) + __properties = ["value", "default", "maxItems", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationFeature: """Create an instance of RoomCompensationFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationFeature: """Create an instance of RoomCompensationFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationFeature.parse_obj( { "value": obj.get("value"), "default": obj.get("default"), - "maxItems": obj.get("maxItems"), + "max_items": obj.get("maxItems"), "range": obj.get("range"), } ) diff --git a/python_client/mozart_api/models/room_compensation_info.py b/python_client/mozart_api/models/room_compensation_info.py index 4f71318..d2f7a69 100644 --- a/python_client/mozart_api/models/room_compensation_info.py +++ b/python_client/mozart_api/models/room_compensation_info.py @@ -18,77 +18,52 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.room_compensation_debug import RoomCompensationDebug from mozart_api.models.room_compensation_enabled import RoomCompensationEnabled from mozart_api.models.room_compensation_result import RoomCompensationResult from mozart_api.models.room_compensation_state import RoomCompensationState from mozart_api.models.room_compensation_type import RoomCompensationType from mozart_api.models.room_compensation_version import RoomCompensationVersion -from typing import Optional, Set -from typing_extensions import Self class RoomCompensationInfo(BaseModel): """ RoomCompensationInfo - """ # noqa: E501 + """ debug: Optional[RoomCompensationDebug] = None enabled: Optional[RoomCompensationEnabled] = None - last_result: Optional[RoomCompensationResult] = Field( - default=None, alias="lastResult" - ) - last_run: Optional[RoomCompensationState] = Field(default=None, alias="lastRun") + last_result: Optional[RoomCompensationResult] = Field(None, alias="lastResult") + last_run: Optional[RoomCompensationState] = Field(None, alias="lastRun") type: Optional[RoomCompensationType] = None version: Optional[RoomCompensationVersion] = None - __properties: ClassVar[List[str]] = [ - "debug", - "enabled", - "lastResult", - "lastRun", - "type", - "version", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + __properties = ["debug", "enabled", "lastResult", "lastRun", "type", "version"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationInfo: """Create an instance of RoomCompensationInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of debug if self.debug: _dict["debug"] = self.debug.to_dict() @@ -110,43 +85,43 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationInfo: """Create an instance of RoomCompensationInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationInfo.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationInfo.parse_obj( { "debug": ( - RoomCompensationDebug.from_dict(obj["debug"]) + RoomCompensationDebug.from_dict(obj.get("debug")) if obj.get("debug") is not None else None ), "enabled": ( - RoomCompensationEnabled.from_dict(obj["enabled"]) + RoomCompensationEnabled.from_dict(obj.get("enabled")) if obj.get("enabled") is not None else None ), - "lastResult": ( - RoomCompensationResult.from_dict(obj["lastResult"]) + "last_result": ( + RoomCompensationResult.from_dict(obj.get("lastResult")) if obj.get("lastResult") is not None else None ), - "lastRun": ( - RoomCompensationState.from_dict(obj["lastRun"]) + "last_run": ( + RoomCompensationState.from_dict(obj.get("lastRun")) if obj.get("lastRun") is not None else None ), "type": ( - RoomCompensationType.from_dict(obj["type"]) + RoomCompensationType.from_dict(obj.get("type")) if obj.get("type") is not None else None ), "version": ( - RoomCompensationVersion.from_dict(obj["version"]) + RoomCompensationVersion.from_dict(obj.get("version")) if obj.get("version") is not None else None ), diff --git a/python_client/mozart_api/models/room_compensation_measurement_error.py b/python_client/mozart_api/models/room_compensation_measurement_error.py index 5549734..f19eabf 100644 --- a/python_client/mozart_api/models/room_compensation_measurement_error.py +++ b/python_client/mozart_api/models/room_compensation_measurement_error.py @@ -18,99 +18,81 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator class RoomCompensationMeasurementError(BaseModel): """ RoomCompensationMeasurementError - """ # noqa: E501 + """ error: Optional[StrictStr] = Field( - default=None, + None, description="noError: The measurement went OK. lowSignal: When there is too low signal in the recording, e.g. due to a loudspeaker being placed at too great a distance from the microphone. speakerSilent: No signal could be measured. Could be because: - The speaker is powered off or not connected. - The left/right switch on a wired powerlink speaker is set in the wrong position. - The speaker is placed in another room behind closed doors. noisyMicrophone: When the recording of the given microphone is too noisy. Could be because: - Something is blocking the microphone externalMicrophoneLocation: When the location of the external microphone is invalid. externalMicrophoneMissing: If the external microphone was missing/disconnected during a measurement. microphonesDisabled: If the microphones are either muted or disabled. noisyMeasurement: When too much background noise has been detected during the measurement internalError: Something went wrong internally - can not be fixed by the user. Try again. ", ) - speaker_id: Optional[StrictStr] = Field(default=None, alias="speakerId") - __properties: ClassVar[List[str]] = ["error", "speakerId"] + speaker_id: Optional[StrictStr] = Field(None, alias="speakerId") + __properties = ["error", "speakerId"] - @field_validator("error") + @validator("error") def error_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "noError", - "lowSignal", - "speakerSilent", - "noisyLeftMicrophone", - "noisyRightMicrophone", - "noisyExternalMicrophone", - "externalMicrophoneLocation", - "externalMicrophoneMissing", - "microphonesDisabled", - "noisyMeasurement", - "internalError", - ] + if value not in ( + "noError", + "lowSignal", + "speakerSilent", + "noisyLeftMicrophone", + "noisyRightMicrophone", + "noisyExternalMicrophone", + "externalMicrophoneLocation", + "externalMicrophoneMissing", + "microphonesDisabled", + "noisyMeasurement", + "internalError", ): raise ValueError( "must be one of enum values ('noError', 'lowSignal', 'speakerSilent', 'noisyLeftMicrophone', 'noisyRightMicrophone', 'noisyExternalMicrophone', 'externalMicrophoneLocation', 'externalMicrophoneMissing', 'microphonesDisabled', 'noisyMeasurement', 'internalError')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationMeasurementError: """Create an instance of RoomCompensationMeasurementError from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationMeasurementError: """Create an instance of RoomCompensationMeasurementError from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationMeasurementError.parse_obj(obj) - _obj = cls.model_validate( - {"error": obj.get("error"), "speakerId": obj.get("speakerId")} + _obj = RoomCompensationMeasurementError.parse_obj( + {"error": obj.get("error"), "speaker_id": obj.get("speakerId")} ) return _obj diff --git a/python_client/mozart_api/models/room_compensation_properties.py b/python_client/mozart_api/models/room_compensation_properties.py index 2735f97..c6924e9 100644 --- a/python_client/mozart_api/models/room_compensation_properties.py +++ b/python_client/mozart_api/models/room_compensation_properties.py @@ -18,58 +18,47 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conint, conlist, validator from mozart_api.models.latency_profile import LatencyProfile -from typing import Optional, Set -from typing_extensions import Self class RoomCompensationProperties(BaseModel): """ RoomCompensationProperties - """ # noqa: E501 + """ value: Optional[StrictStr] = Field( - default=None, + None, description="The type of roomcompensation used / to use. simple: For speakers without external speakers. advanced: For products with external speakers or other advanced multichannel capabilities. This requires that at least action in the other properties of RoomCompensationProperties is set. ", ) action: Optional[StrictStr] = Field( - default=None, + None, description="Must be set if room compensation type is advanced. runAll: Do measurements on all connected speakers. continue: Continue from and including the speaker where last interrupted (stopped or failed). useSpeakerList: Do measurements on the speakers in the list property. ", ) continue_on_error: Optional[StrictBool] = Field( - default=None, - description="On failing measurement on a speaker, default behavior is to stop measurement and skip the remaining speakers. Setting continueOnError to true will make the measurement process continue and finish measurement on all speakers, even though an error ocurred on one of the speakers. ", + None, alias="continueOnError", + description="On failing measurement on a speaker, default behavior is to stop measurement and skip the remaining speakers. Setting continueOnError to true will make the measurement process continue and finish measurement on all speakers, even though an error ocurred on one of the speakers. ", ) - latency_profile: Optional[LatencyProfile] = Field( - default=None, alias="latencyProfile" - ) + latency_profile: Optional[LatencyProfile] = Field(None, alias="latencyProfile") skip_automatic_role_assignment: Optional[StrictBool] = Field( - default=None, - description="Skip calculation of automatic role assignment.", + None, alias="skipAutomaticRoleAssignment", + description="Skip calculation of automatic role assignment.", ) - speaker_list: Optional[List[StrictStr]] = Field( - default=None, - description="List of speaker IDs to include in room compensation / automatic role assignment measurement. Relevant e.g. if you want to create a speaker group without the external speakers included. This can not be used for doing measurements on a partial speaker group, only on all speakers in an existing group or for all speakers in a new group. ", + speaker_list: Optional[conlist(StrictStr)] = Field( + None, alias="speakerList", + description="List of speaker IDs to include in room compensation / automatic role assignment measurement. Relevant e.g. if you want to create a speaker group without the external speakers included. This can not be used for doing measurements on a partial speaker group, only on all speakers in an existing group or for all speakers in a new group. ", ) - speaker_preset: Optional[Annotated[int, Field(le=255, strict=True, ge=0)]] = Field( - default=None, - description="The Powerlink preset to use for the external PL/WPL speakers.", + speaker_preset: Optional[conint(strict=True, le=255, ge=0)] = Field( + None, alias="speakerPreset", + description="The Powerlink preset to use for the external PL/WPL speakers.", ) - __properties: ClassVar[List[str]] = [ + __properties = [ "value", "action", "continueOnError", @@ -79,123 +68,110 @@ class RoomCompensationProperties(BaseModel): "speakerPreset", ] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["simple", "advanced"]): + if value not in ("simple", "advanced"): raise ValueError("must be one of enum values ('simple', 'advanced')") return value - @field_validator("action") + @validator("action") def action_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["runAll", "continue", "useSpeakerList"]): + if value not in ("runAll", "continue", "useSpeakerList"): raise ValueError( "must be one of enum values ('runAll', 'continue', 'useSpeakerList')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationProperties: """Create an instance of RoomCompensationProperties from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of latency_profile if self.latency_profile: _dict["latencyProfile"] = self.latency_profile.to_dict() # set to None if action (nullable) is None - # and model_fields_set contains the field - if self.action is None and "action" in self.model_fields_set: + # and __fields_set__ contains the field + if self.action is None and "action" in self.__fields_set__: _dict["action"] = None # set to None if continue_on_error (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.continue_on_error is None - and "continue_on_error" in self.model_fields_set + and "continue_on_error" in self.__fields_set__ ): _dict["continueOnError"] = None # set to None if skip_automatic_role_assignment (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.skip_automatic_role_assignment is None - and "skip_automatic_role_assignment" in self.model_fields_set + and "skip_automatic_role_assignment" in self.__fields_set__ ): _dict["skipAutomaticRoleAssignment"] = None # set to None if speaker_list (nullable) is None - # and model_fields_set contains the field - if self.speaker_list is None and "speaker_list" in self.model_fields_set: + # and __fields_set__ contains the field + if self.speaker_list is None and "speaker_list" in self.__fields_set__: _dict["speakerList"] = None # set to None if speaker_preset (nullable) is None - # and model_fields_set contains the field - if self.speaker_preset is None and "speaker_preset" in self.model_fields_set: + # and __fields_set__ contains the field + if self.speaker_preset is None and "speaker_preset" in self.__fields_set__: _dict["speakerPreset"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationProperties: """Create an instance of RoomCompensationProperties from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationProperties.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationProperties.parse_obj( { "value": obj.get("value"), "action": obj.get("action"), - "continueOnError": obj.get("continueOnError"), - "latencyProfile": ( - LatencyProfile.from_dict(obj["latencyProfile"]) + "continue_on_error": obj.get("continueOnError"), + "latency_profile": ( + LatencyProfile.from_dict(obj.get("latencyProfile")) if obj.get("latencyProfile") is not None else None ), - "skipAutomaticRoleAssignment": obj.get("skipAutomaticRoleAssignment"), - "speakerList": obj.get("speakerList"), - "speakerPreset": obj.get("speakerPreset"), + "skip_automatic_role_assignment": obj.get( + "skipAutomaticRoleAssignment" + ), + "speaker_list": obj.get("speakerList"), + "speaker_preset": obj.get("speakerPreset"), } ) return _obj diff --git a/python_client/mozart_api/models/room_compensation_range.py b/python_client/mozart_api/models/room_compensation_range.py index eb8175f..81ff8b3 100644 --- a/python_client/mozart_api/models/room_compensation_range.py +++ b/python_client/mozart_api/models/room_compensation_range.py @@ -18,81 +18,67 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conint, conlist class RoomCompensationRange(BaseModel): """ RoomCompensationRange - """ # noqa: E501 + """ - default: List[StrictStr] = Field( - description="List of room compensation sweeps to combine. No room compensation is done if this list is empty. The maximum length of this list is product specific. " + default: conlist(StrictStr) = Field( + ..., + description="List of room compensation sweeps to combine. No room compensation is done if this list is empty. The maximum length of this list is product specific. ", ) - max_items: Optional[Annotated[int, Field(le=20, strict=True, ge=1)]] = Field( - default=None, - description="Maximum number of items in the `value` field", + max_items: Optional[conint(strict=True, le=20, ge=1)] = Field( + None, alias="maxItems", + description="Maximum number of items in the `value` field", ) - range: List[StrictStr] = Field(description="Possible values for the `value` field") - __properties: ClassVar[List[str]] = ["default", "maxItems", "range"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + range: conlist(StrictStr) = Field( + ..., description="Possible values for the `value` field" ) + __properties = ["default", "maxItems", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationRange: """Create an instance of RoomCompensationRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationRange: """Create an instance of RoomCompensationRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationRange.parse_obj( { "default": obj.get("default"), - "maxItems": obj.get("maxItems"), + "max_items": obj.get("maxItems"), "range": obj.get("range"), } ) diff --git a/python_client/mozart_api/models/room_compensation_response.py b/python_client/mozart_api/models/room_compensation_response.py index c15864e..3461231 100644 --- a/python_client/mozart_api/models/room_compensation_response.py +++ b/python_client/mozart_api/models/room_compensation_response.py @@ -18,70 +18,54 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt class RoomCompensationResponse(BaseModel): """ RoomCompensationResponse - """ # noqa: E501 + """ frequency: Optional[StrictInt] = None gain: Optional[Union[StrictFloat, StrictInt]] = None - __properties: ClassVar[List[str]] = ["frequency", "gain"] + __properties = ["frequency", "gain"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationResponse: """Create an instance of RoomCompensationResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationResponse: """Create an instance of RoomCompensationResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationResponse.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationResponse.parse_obj( {"frequency": obj.get("frequency"), "gain": obj.get("gain")} ) return _obj diff --git a/python_client/mozart_api/models/room_compensation_result.py b/python_client/mozart_api/models/room_compensation_result.py index 1ff5bee..5ba8689 100644 --- a/python_client/mozart_api/models/room_compensation_result.py +++ b/python_client/mozart_api/models/room_compensation_result.py @@ -19,32 +19,30 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist, validator from mozart_api.models.room_compensation_response import RoomCompensationResponse from mozart_api.models.speaker_group import SpeakerGroup -from typing import Optional, Set -from typing_extensions import Self class RoomCompensationResult(BaseModel): """ RoomCompensationResult - """ # noqa: E501 + """ - compensation: Optional[List[RoomCompensationResponse]] = None - measured_response: Optional[List[RoomCompensationResponse]] = Field( - default=None, alias="measuredResponse" + compensation: Optional[conlist(RoomCompensationResponse)] = None + measured_response: Optional[conlist(RoomCompensationResponse)] = Field( + None, alias="measuredResponse" ) placement: Optional[StrictStr] = None - reference_response: Optional[List[RoomCompensationResponse]] = Field( - default=None, alias="referenceResponse" + reference_response: Optional[conlist(RoomCompensationResponse)] = Field( + None, alias="referenceResponse" ) speaker_group_suggestion: Optional[SpeakerGroup] = Field( - default=None, alias="speakerGroupSuggestion" + None, alias="speakerGroupSuggestion" ) - time_stamp: Optional[datetime] = Field(default=None, alias="timeStamp") - __properties: ClassVar[List[str]] = [ + time_stamp: Optional[datetime] = Field(None, alias="timeStamp") + __properties = [ "compensation", "measuredResponse", "placement", @@ -53,55 +51,40 @@ class RoomCompensationResult(BaseModel): "timeStamp", ] - @field_validator("placement") + @validator("placement") def placement_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["free", "nearWall", "unknown"]): + if value not in ("free", "nearWall", "unknown"): raise ValueError( "must be one of enum values ('free', 'nearWall', 'unknown')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationResult: """Create an instance of RoomCompensationResult from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in compensation (list) _items = [] if self.compensation: @@ -129,47 +112,47 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationResult: """Create an instance of RoomCompensationResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationResult.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationResult.parse_obj( { "compensation": ( [ RoomCompensationResponse.from_dict(_item) - for _item in obj["compensation"] + for _item in obj.get("compensation") ] if obj.get("compensation") is not None else None ), - "measuredResponse": ( + "measured_response": ( [ RoomCompensationResponse.from_dict(_item) - for _item in obj["measuredResponse"] + for _item in obj.get("measuredResponse") ] if obj.get("measuredResponse") is not None else None ), "placement": obj.get("placement"), - "referenceResponse": ( + "reference_response": ( [ RoomCompensationResponse.from_dict(_item) - for _item in obj["referenceResponse"] + for _item in obj.get("referenceResponse") ] if obj.get("referenceResponse") is not None else None ), - "speakerGroupSuggestion": ( - SpeakerGroup.from_dict(obj["speakerGroupSuggestion"]) + "speaker_group_suggestion": ( + SpeakerGroup.from_dict(obj.get("speakerGroupSuggestion")) if obj.get("speakerGroupSuggestion") is not None else None ), - "timeStamp": obj.get("timeStamp"), + "time_stamp": obj.get("timeStamp"), } ) return _obj diff --git a/python_client/mozart_api/models/room_compensation_state.py b/python_client/mozart_api/models/room_compensation_state.py index 3150876..ad2d7bf 100644 --- a/python_client/mozart_api/models/room_compensation_state.py +++ b/python_client/mozart_api/models/room_compensation_state.py @@ -19,44 +19,35 @@ import json from datetime import datetime -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, validator from mozart_api.models.room_compensation_error_details import ( RoomCompensationErrorDetails, ) from mozart_api.models.room_compensation_properties import RoomCompensationProperties -from typing import Optional, Set -from typing_extensions import Self class RoomCompensationState(BaseModel): """ RoomCompensationState - """ # noqa: E501 + """ state: Optional[StrictStr] = None error: Optional[StrictStr] = Field( - default=None, + None, description="microphoneMuted: The microphone is muted (soft-off, using touch button). microphoneSwitchOff: The microphone switch is set in its off position. microphoneSignalMissing: No signal was detected. Is the microphone blocked? externalMicrophoneMissing: The external microphone is not connected. Is only relevant for advanced room compensation. externalMicrophoneInvalidPosition: The external microphone is placed in an invalid position, e.g. placed too close or in an extreme angle to the internal speakers. Is only relevant for advanced room compensation. noisyEnvironment: Too much environment noise to get a valid measurement. speakerMeasurementFailed: A measurement failed, related to one of the individual speakers. See the errorDetails property for details about the error and which speaker measurement failed. Is only relevant for advanced room compensation. invalidSpeakerList: The speaker list contains invalid speakers. Valid speakers are: all external speakers and non-virtual internal speakers. Is only relevant for advanced room compensation. invalidAction: Could not start with given action. Eg. can't run from last failed speaker if there isn't any failed run. Is only relevant for advanced room compensation. internalError: Internal product error. ", ) error_details: Optional[RoomCompensationErrorDetails] = Field( - default=None, alias="errorDetails" + None, alias="errorDetails" ) last_run_available: Optional[StrictBool] = Field( - default=None, - description='When true, measurements have been cached due to manual interrupt or failure, making it possible to use the action "continue" where the system will continue from the speaker where interrupted. The cached measurements are only temporary and will be cleared after some time (default 15min), in which case lastRunAvailable becomes false. ', + None, alias="lastRunAvailable", + description='When true, measurements have been cached due to manual interrupt or failure, making it possible to use the action "continue" where the system will continue from the speaker where interrupted. The cached measurements are only temporary and will be cleared after some time (default 15min), in which case lastRunAvailable becomes false. ', ) properties: Optional[RoomCompensationProperties] = None - time_stamp: Optional[datetime] = Field(default=None, alias="timeStamp") - __properties: ClassVar[List[str]] = [ + time_stamp: Optional[datetime] = Field(None, alias="timeStamp") + __properties = [ "state", "error", "errorDetails", @@ -65,81 +56,64 @@ class RoomCompensationState(BaseModel): "timeStamp", ] - @field_validator("state") + @validator("state") def state_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["notStarted", "running", "done", "error", "stopped"]): + if value not in ("notStarted", "running", "done", "error", "stopped"): raise ValueError( "must be one of enum values ('notStarted', 'running', 'done', 'error', 'stopped')" ) return value - @field_validator("error") + @validator("error") def error_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "noError", - "microphoneMuted", - "microphoneSwitchOff", - "microphoneSignalMissing", - "externalMicrophoneMissing", - "externalMicrophoneInvalidPosition", - "noisyEnvironment", - "speakerMeasurementFailed", - "invalidSpeakerList", - "invalidAction", - "internalError", - ] + if value not in ( + "noError", + "microphoneMuted", + "microphoneSwitchOff", + "microphoneSignalMissing", + "externalMicrophoneMissing", + "externalMicrophoneInvalidPosition", + "noisyEnvironment", + "speakerMeasurementFailed", + "invalidSpeakerList", + "invalidAction", + "internalError", ): raise ValueError( "must be one of enum values ('noError', 'microphoneMuted', 'microphoneSwitchOff', 'microphoneSignalMissing', 'externalMicrophoneMissing', 'externalMicrophoneInvalidPosition', 'noisyEnvironment', 'speakerMeasurementFailed', 'invalidSpeakerList', 'invalidAction', 'internalError')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationState: """Create an instance of RoomCompensationState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of error_details if self.error_details: _dict["errorDetails"] = self.error_details.to_dict() @@ -149,30 +123,30 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationState: """Create an instance of RoomCompensationState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationState.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationState.parse_obj( { "state": obj.get("state"), "error": obj.get("error"), - "errorDetails": ( - RoomCompensationErrorDetails.from_dict(obj["errorDetails"]) + "error_details": ( + RoomCompensationErrorDetails.from_dict(obj.get("errorDetails")) if obj.get("errorDetails") is not None else None ), - "lastRunAvailable": obj.get("lastRunAvailable"), + "last_run_available": obj.get("lastRunAvailable"), "properties": ( - RoomCompensationProperties.from_dict(obj["properties"]) + RoomCompensationProperties.from_dict(obj.get("properties")) if obj.get("properties") is not None else None ), - "timeStamp": obj.get("timeStamp"), + "time_stamp": obj.get("timeStamp"), } ) return _obj diff --git a/python_client/mozart_api/models/room_compensation_state_value.py b/python_client/mozart_api/models/room_compensation_state_value.py index b5dc622..839d989 100644 --- a/python_client/mozart_api/models/room_compensation_state_value.py +++ b/python_client/mozart_api/models/room_compensation_state_value.py @@ -18,79 +18,63 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class RoomCompensationStateValue(BaseModel): """ RoomCompensationStateValue - """ # noqa: E501 + """ state: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["state"] + __properties = ["state"] - @field_validator("state") + @validator("state") def state_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["notStarted", "running", "done", "error", "stopped"]): + if value not in ("notStarted", "running", "done", "error", "stopped"): raise ValueError( "must be one of enum values ('notStarted', 'running', 'done', 'error', 'stopped')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationStateValue: """Create an instance of RoomCompensationStateValue from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationStateValue: """Create an instance of RoomCompensationStateValue from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationStateValue.parse_obj(obj) - _obj = cls.model_validate({"state": obj.get("state")}) + _obj = RoomCompensationStateValue.parse_obj({"state": obj.get("state")}) return _obj diff --git a/python_client/mozart_api/models/room_compensation_type.py b/python_client/mozart_api/models/room_compensation_type.py index f2fb488..e2787f0 100644 --- a/python_client/mozart_api/models/room_compensation_type.py +++ b/python_client/mozart_api/models/room_compensation_type.py @@ -18,80 +18,64 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator class RoomCompensationType(BaseModel): """ RoomCompensationType - """ # noqa: E501 + """ value: Optional[StrictStr] = Field( - default=None, + None, description="The type of roomcompensation used / to use. simple: For speakers without external speakers. advanced: For products with external speakers or other advanced multichannel capabilities. This requires that at least action in the other properties of RoomCompensationProperties is set. ", ) - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["simple", "advanced"]): + if value not in ("simple", "advanced"): raise ValueError("must be one of enum values ('simple', 'advanced')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationType: """Create an instance of RoomCompensationType from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationType: """Create an instance of RoomCompensationType from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationType.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = RoomCompensationType.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/room_compensation_version.py b/python_client/mozart_api/models/room_compensation_version.py index 46563f8..c66583e 100644 --- a/python_client/mozart_api/models/room_compensation_version.py +++ b/python_client/mozart_api/models/room_compensation_version.py @@ -18,71 +18,54 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, conint class RoomCompensationVersion(BaseModel): """ RoomCompensationVersion - """ # noqa: E501 + """ - algorithm: Optional[Annotated[int, Field(strict=True, ge=0)]] = None - coefficients: Optional[Annotated[int, Field(strict=True, ge=0)]] = None - __properties: ClassVar[List[str]] = ["algorithm", "coefficients"] + algorithm: Optional[conint(strict=True, ge=0)] = None + coefficients: Optional[conint(strict=True, ge=0)] = None + __properties = ["algorithm", "coefficients"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> RoomCompensationVersion: """Create an instance of RoomCompensationVersion from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> RoomCompensationVersion: """Create an instance of RoomCompensationVersion from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return RoomCompensationVersion.parse_obj(obj) - _obj = cls.model_validate( + _obj = RoomCompensationVersion.parse_obj( {"algorithm": obj.get("algorithm"), "coefficients": obj.get("coefficients")} ) return _obj diff --git a/python_client/mozart_api/models/scene.py b/python_client/mozart_api/models/scene.py index 2f127f9..6017c23 100644 --- a/python_client/mozart_api/models/scene.py +++ b/python_client/mozart_api/models/scene.py @@ -18,93 +18,69 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist, constr, validator from mozart_api.models.action import Action -from typing import Optional, Set -from typing_extensions import Self class Scene(BaseModel): """ Scene - """ # noqa: E501 + """ - action_list: List[Action] = Field( - description="An ordered list of Actions to run on the product", + action_list: conlist(Action) = Field( + ..., alias="actionList", + description="An ordered list of Actions to run on the product", ) - client_context: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = ( - Field( - default=None, - description="An optional generic string property supplied from the client. If supplied it will overwrite any currently stored clientContext. If not supplied any stored clientContext will be left unchanged. ", - alias="clientContext", - ) + client_context: Optional[constr(strict=True, max_length=4096)] = Field( + None, + alias="clientContext", + description="An optional generic string property supplied from the client. If supplied it will overwrite any currently stored clientContext. If not supplied any stored clientContext will be left unchanged. ", ) label: Optional[StrictStr] = None - tags: Optional[List[StrictStr]] = Field( - default=None, + tags: Optional[conlist(StrictStr)] = Field( + None, description="A list of user defined tags. This allows a client to create virtual lists", ) classification: Optional[StrictStr] = Field( - default=None, description="The classification of Scene" + None, description="The classification of Scene" ) - __properties: ClassVar[List[str]] = [ - "actionList", - "clientContext", - "label", - "tags", - "classification", - ] - - @field_validator("classification") + __properties = ["actionList", "clientContext", "label", "tags", "classification"] + + @validator("classification") def classification_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["system", "userDefined"]): + if value not in ("system", "userDefined"): raise ValueError("must be one of enum values ('system', 'userDefined')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Scene: """Create an instance of Scene from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in action_list (list) _items = [] if self.action_list: @@ -113,39 +89,39 @@ def to_dict(self) -> Dict[str, Any]: _items.append(_item.to_dict()) _dict["actionList"] = _items # set to None if client_context (nullable) is None - # and model_fields_set contains the field - if self.client_context is None and "client_context" in self.model_fields_set: + # and __fields_set__ contains the field + if self.client_context is None and "client_context" in self.__fields_set__: _dict["clientContext"] = None # set to None if label (nullable) is None - # and model_fields_set contains the field - if self.label is None and "label" in self.model_fields_set: + # and __fields_set__ contains the field + if self.label is None and "label" in self.__fields_set__: _dict["label"] = None # set to None if classification (nullable) is None - # and model_fields_set contains the field - if self.classification is None and "classification" in self.model_fields_set: + # and __fields_set__ contains the field + if self.classification is None and "classification" in self.__fields_set__: _dict["classification"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Scene: """Create an instance of Scene from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Scene.parse_obj(obj) - _obj = cls.model_validate( + _obj = Scene.parse_obj( { - "actionList": ( - [Action.from_dict(_item) for _item in obj["actionList"]] + "action_list": ( + [Action.from_dict(_item) for _item in obj.get("actionList")] if obj.get("actionList") is not None else None ), - "clientContext": obj.get("clientContext"), + "client_context": obj.get("clientContext"), "label": obj.get("label"), "tags": obj.get("tags"), "classification": obj.get("classification"), diff --git a/python_client/mozart_api/models/scene_classification.py b/python_client/mozart_api/models/scene_classification.py index 2e9e03d..c59917c 100644 --- a/python_client/mozart_api/models/scene_classification.py +++ b/python_client/mozart_api/models/scene_classification.py @@ -18,84 +18,70 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator class SceneClassification(BaseModel): """ SceneClassification - """ # noqa: E501 + """ classification: Optional[StrictStr] = Field( - default=None, description="The classification of Scene" + None, description="The classification of Scene" ) - __properties: ClassVar[List[str]] = ["classification"] + __properties = ["classification"] - @field_validator("classification") + @validator("classification") def classification_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["system", "userDefined"]): + if value not in ("system", "userDefined"): raise ValueError("must be one of enum values ('system', 'userDefined')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SceneClassification: """Create an instance of SceneClassification from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if classification (nullable) is None - # and model_fields_set contains the field - if self.classification is None and "classification" in self.model_fields_set: + # and __fields_set__ contains the field + if self.classification is None and "classification" in self.__fields_set__: _dict["classification"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SceneClassification: """Create an instance of SceneClassification from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SceneClassification.parse_obj(obj) - _obj = cls.model_validate({"classification": obj.get("classification")}) + _obj = SceneClassification.parse_obj( + {"classification": obj.get("classification")} + ) return _obj diff --git a/python_client/mozart_api/models/scene_match.py b/python_client/mozart_api/models/scene_match.py index b19d6d1..a507813 100644 --- a/python_client/mozart_api/models/scene_match.py +++ b/python_client/mozart_api/models/scene_match.py @@ -18,76 +18,62 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist class SceneMatch(BaseModel): """ SceneMatch - """ # noqa: E501 + """ label: Optional[StrictStr] = None - tags: Optional[List[StrictStr]] = Field( - default=None, + tags: Optional[conlist(StrictStr)] = Field( + None, description="A list of user defined tags. This allows a client to create virtual lists", ) - __properties: ClassVar[List[str]] = ["label", "tags"] + __properties = ["label", "tags"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SceneMatch: """Create an instance of SceneMatch from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if label (nullable) is None - # and model_fields_set contains the field - if self.label is None and "label" in self.model_fields_set: + # and __fields_set__ contains the field + if self.label is None and "label" in self.__fields_set__: _dict["label"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SceneMatch: """Create an instance of SceneMatch from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SceneMatch.parse_obj(obj) - _obj = cls.model_validate({"label": obj.get("label"), "tags": obj.get("tags")}) + _obj = SceneMatch.parse_obj( + {"label": obj.get("label"), "tags": obj.get("tags")} + ) return _obj diff --git a/python_client/mozart_api/models/scene_properties.py b/python_client/mozart_api/models/scene_properties.py index 20624f5..2500cbd 100644 --- a/python_client/mozart_api/models/scene_properties.py +++ b/python_client/mozart_api/models/scene_properties.py @@ -18,74 +18,56 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist, constr from mozart_api.models.action import Action -from typing import Optional, Set -from typing_extensions import Self class SceneProperties(BaseModel): """ SceneProperties - """ # noqa: E501 + """ - action_list: List[Action] = Field( - description="An ordered list of Actions to run on the product", + action_list: conlist(Action) = Field( + ..., alias="actionList", + description="An ordered list of Actions to run on the product", ) - client_context: Optional[Annotated[str, Field(strict=True, max_length=4096)]] = ( - Field( - default=None, - description="An optional generic string property supplied from the client. If supplied it will overwrite any currently stored clientContext. If not supplied any stored clientContext will be left unchanged. ", - alias="clientContext", - ) + client_context: Optional[constr(strict=True, max_length=4096)] = Field( + None, + alias="clientContext", + description="An optional generic string property supplied from the client. If supplied it will overwrite any currently stored clientContext. If not supplied any stored clientContext will be left unchanged. ", ) label: Optional[StrictStr] = None - tags: Optional[List[StrictStr]] = Field( - default=None, + tags: Optional[conlist(StrictStr)] = Field( + None, description="A list of user defined tags. This allows a client to create virtual lists", ) - __properties: ClassVar[List[str]] = ["actionList", "clientContext", "label", "tags"] + __properties = ["actionList", "clientContext", "label", "tags"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SceneProperties: """Create an instance of SceneProperties from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in action_list (list) _items = [] if self.action_list: @@ -94,34 +76,34 @@ def to_dict(self) -> Dict[str, Any]: _items.append(_item.to_dict()) _dict["actionList"] = _items # set to None if client_context (nullable) is None - # and model_fields_set contains the field - if self.client_context is None and "client_context" in self.model_fields_set: + # and __fields_set__ contains the field + if self.client_context is None and "client_context" in self.__fields_set__: _dict["clientContext"] = None # set to None if label (nullable) is None - # and model_fields_set contains the field - if self.label is None and "label" in self.model_fields_set: + # and __fields_set__ contains the field + if self.label is None and "label" in self.__fields_set__: _dict["label"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SceneProperties: """Create an instance of SceneProperties from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SceneProperties.parse_obj(obj) - _obj = cls.model_validate( + _obj = SceneProperties.parse_obj( { - "actionList": ( - [Action.from_dict(_item) for _item in obj["actionList"]] + "action_list": ( + [Action.from_dict(_item) for _item in obj.get("actionList")] if obj.get("actionList") is not None else None ), - "clientContext": obj.get("clientContext"), + "client_context": obj.get("clientContext"), "label": obj.get("label"), "tags": obj.get("tags"), } diff --git a/python_client/mozart_api/models/scene_trigger_base_properties.py b/python_client/mozart_api/models/scene_trigger_base_properties.py index 955a1cd..5b02615 100644 --- a/python_client/mozart_api/models/scene_trigger_base_properties.py +++ b/python_client/mozart_api/models/scene_trigger_base_properties.py @@ -18,65 +18,49 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist from mozart_api.models.action import Action -from typing import Optional, Set -from typing_extensions import Self class SceneTriggerBaseProperties(BaseModel): """ - Base properties for a scene trigger - """ # noqa: E501 + Base properties for a scene trigger # noqa: E501 + """ - action_list: Optional[List[Action]] = Field( - default=None, - description="An ordered list of Actions to run on the product", + action_list: Optional[conlist(Action)] = Field( + None, alias="actionList", + description="An ordered list of Actions to run on the product", ) - scene_list: Optional[List[StrictStr]] = Field( - default=None, description="A list of scenes", alias="sceneList" + scene_list: Optional[conlist(StrictStr)] = Field( + None, alias="sceneList", description="A list of scenes" ) - __properties: ClassVar[List[str]] = ["actionList", "sceneList"] + __properties = ["actionList", "sceneList"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SceneTriggerBaseProperties: """Create an instance of SceneTriggerBaseProperties from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in action_list (list) _items = [] if self.action_list: @@ -87,22 +71,22 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SceneTriggerBaseProperties: """Create an instance of SceneTriggerBaseProperties from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SceneTriggerBaseProperties.parse_obj(obj) - _obj = cls.model_validate( + _obj = SceneTriggerBaseProperties.parse_obj( { - "actionList": ( - [Action.from_dict(_item) for _item in obj["actionList"]] + "action_list": ( + [Action.from_dict(_item) for _item in obj.get("actionList")] if obj.get("actionList") is not None else None ), - "sceneList": obj.get("sceneList"), + "scene_list": obj.get("sceneList"), } ) return _obj diff --git a/python_client/mozart_api/models/software_update_state.py b/python_client/mozart_api/models/software_update_state.py index 5aba6cc..d7b2141 100644 --- a/python_client/mozart_api/models/software_update_state.py +++ b/python_client/mozart_api/models/software_update_state.py @@ -18,101 +18,84 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, validator class SoftwareUpdateState(BaseModel): """ SoftwareUpdateState - """ # noqa: E501 + """ - seconds_remaining: Optional[StrictInt] = Field( - default=None, alias="secondsRemaining" - ) + seconds_remaining: Optional[StrictInt] = Field(None, alias="secondsRemaining") value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["secondsRemaining", "value"] + __properties = ["secondsRemaining", "value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "idle", - "checking", - "updateCheckFailed", - "noUpdatesAvailable", - "updateAvailable", - "downloadingUpdate", - "updateDownloaded", - "downloadFailed", - "installingUpdate", - "installingAutomaticUpdate", - "installationFailed", - "installationDonePendingReboot", - "schedulerFailed", - "rebooting", - ] + if value not in ( + "idle", + "checking", + "updateCheckFailed", + "noUpdatesAvailable", + "updateAvailable", + "downloadingUpdate", + "updateDownloaded", + "downloadFailed", + "installingUpdate", + "installingAutomaticUpdate", + "installationFailed", + "installationDonePendingReboot", + "schedulerFailed", + "rebooting", ): raise ValueError( "must be one of enum values ('idle', 'checking', 'updateCheckFailed', 'noUpdatesAvailable', 'updateAvailable', 'downloadingUpdate', 'updateDownloaded', 'downloadFailed', 'installingUpdate', 'installingAutomaticUpdate', 'installationFailed', 'installationDonePendingReboot', 'schedulerFailed', 'rebooting')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SoftwareUpdateState: """Create an instance of SoftwareUpdateState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SoftwareUpdateState: """Create an instance of SoftwareUpdateState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SoftwareUpdateState.parse_obj(obj) - _obj = cls.model_validate( - {"secondsRemaining": obj.get("secondsRemaining"), "value": obj.get("value")} + _obj = SoftwareUpdateState.parse_obj( + { + "seconds_remaining": obj.get("secondsRemaining"), + "value": obj.get("value"), + } ) return _obj diff --git a/python_client/mozart_api/models/software_update_status.py b/python_client/mozart_api/models/software_update_status.py index 7a00f60..784a8aa 100644 --- a/python_client/mozart_api/models/software_update_status.py +++ b/python_client/mozart_api/models/software_update_status.py @@ -19,26 +19,24 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, validator from mozart_api.models.software_update_state import SoftwareUpdateState -from typing import Optional, Set -from typing_extensions import Self class SoftwareUpdateStatus(BaseModel): """ SoftwareUpdateStatus - """ # noqa: E501 - - available_update: Optional[StrictStr] = Field(default=None, alias="availableUpdate") - last_check: Optional[datetime] = Field(default=None, alias="lastCheck") - last_update: Optional[datetime] = Field(default=None, alias="lastUpdate") - software_version: StrictStr = Field(alias="softwareVersion") - state: SoftwareUpdateState - update_progress: Optional[StrictInt] = Field(default=None, alias="updateProgress") - update_type: Optional[StrictStr] = Field(default=None, alias="updateType") - __properties: ClassVar[List[str]] = [ + """ + + available_update: Optional[StrictStr] = Field(None, alias="availableUpdate") + last_check: Optional[datetime] = Field(None, alias="lastCheck") + last_update: Optional[datetime] = Field(None, alias="lastUpdate") + software_version: StrictStr = Field(..., alias="softwareVersion") + state: SoftwareUpdateState = Field(...) + update_progress: Optional[StrictInt] = Field(None, alias="updateProgress") + update_type: Optional[StrictStr] = Field(None, alias="updateType") + __properties = [ "availableUpdate", "lastCheck", "lastUpdate", @@ -48,82 +46,67 @@ class SoftwareUpdateStatus(BaseModel): "updateType", ] - @field_validator("update_type") + @validator("update_type") def update_type_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["none", "normal", "critical", "forced"]): + if value not in ("none", "normal", "critical", "forced"): raise ValueError( "must be one of enum values ('none', 'normal', 'critical', 'forced')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SoftwareUpdateStatus: """Create an instance of SoftwareUpdateStatus from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of state if self.state: _dict["state"] = self.state.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SoftwareUpdateStatus: """Create an instance of SoftwareUpdateStatus from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SoftwareUpdateStatus.parse_obj(obj) - _obj = cls.model_validate( + _obj = SoftwareUpdateStatus.parse_obj( { - "availableUpdate": obj.get("availableUpdate"), - "lastCheck": obj.get("lastCheck"), - "lastUpdate": obj.get("lastUpdate"), - "softwareVersion": obj.get("softwareVersion"), + "available_update": obj.get("availableUpdate"), + "last_check": obj.get("lastCheck"), + "last_update": obj.get("lastUpdate"), + "software_version": obj.get("softwareVersion"), "state": ( - SoftwareUpdateState.from_dict(obj["state"]) + SoftwareUpdateState.from_dict(obj.get("state")) if obj.get("state") is not None else None ), - "updateProgress": obj.get("updateProgress"), - "updateType": obj.get("updateType"), + "update_progress": obj.get("updateProgress"), + "update_type": obj.get("updateType"), } ) return _obj diff --git a/python_client/mozart_api/models/sound_adjustments.py b/python_client/mozart_api/models/sound_adjustments.py index f7d35e9..16cd0a1 100644 --- a/python_client/mozart_api/models/sound_adjustments.py +++ b/python_client/mozart_api/models/sound_adjustments.py @@ -18,33 +18,24 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictFloat, - StrictInt, - StrictStr, -) -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional, Union +from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr class SoundAdjustments(BaseModel): """ SoundAdjustments - """ # noqa: E501 + """ ambience: Optional[Union[StrictFloat, StrictInt]] = None bass: Optional[StrictInt] = None directivity: Optional[StrictStr] = None - eco_mode: Optional[StrictBool] = Field(default=None, alias="ecoMode") + eco_mode: Optional[StrictBool] = Field(None, alias="ecoMode") fadein: Optional[StrictBool] = None loudness: Optional[StrictBool] = None treble: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = [ + __properties = [ "ambience", "bass", "directivity", @@ -54,60 +45,45 @@ class SoundAdjustments(BaseModel): "treble", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SoundAdjustments: """Create an instance of SoundAdjustments from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SoundAdjustments: """Create an instance of SoundAdjustments from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SoundAdjustments.parse_obj(obj) - _obj = cls.model_validate( + _obj = SoundAdjustments.parse_obj( { "ambience": obj.get("ambience"), "bass": obj.get("bass"), "directivity": obj.get("directivity"), - "ecoMode": obj.get("ecoMode"), + "eco_mode": obj.get("ecoMode"), "fadein": obj.get("fadein"), "loudness": obj.get("loudness"), "treble": obj.get("treble"), diff --git a/python_client/mozart_api/models/sound_feature_set.py b/python_client/mozart_api/models/sound_feature_set.py index 3f0581f..a80d4f2 100644 --- a/python_client/mozart_api/models/sound_feature_set.py +++ b/python_client/mozart_api/models/sound_feature_set.py @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.ambience_feature import AmbienceFeature from mozart_api.models.balance_feature import BalanceFeature from mozart_api.models.bass_feature import BassFeature @@ -37,49 +38,41 @@ from mozart_api.models.tone_touch_x_feature import ToneTouchXFeature from mozart_api.models.tone_touch_y_feature import ToneTouchYFeature from mozart_api.models.treble_feature import TrebleFeature -from typing import Optional, Set -from typing_extensions import Self class SoundFeatureSet(BaseModel): """ SoundFeatureSet - """ # noqa: E501 + """ ambience: Optional[AmbienceFeature] = None balance: Optional[BalanceFeature] = None bass: Optional[BassFeature] = None bass_management: Optional[BassManagementFeature] = Field( - default=None, alias="bass-management" + None, alias="bass-management" ) compression: Optional[CompressionFeature] = None directivity: Optional[DirectivityFeature] = None fader: Optional[FaderFeature] = None room_compensation: Optional[RoomCompensationFeature] = Field( - default=None, alias="roomCompensation" + None, alias="roomCompensation" ) spatial_envelopment: Optional[SpatialEnvelopmentFeature] = Field( - default=None, alias="spatial-envelopment" - ) - spatial_height: Optional[SpatialHeightFeature] = Field( - default=None, alias="spatial-height" + None, alias="spatial-envelopment" ) + spatial_height: Optional[SpatialHeightFeature] = Field(None, alias="spatial-height") spatial_processing: Optional[SpatialProcessingFeature] = Field( - default=None, alias="spatial-processing" + None, alias="spatial-processing" ) spatial_surround: Optional[SpatialSurroundFeature] = Field( - default=None, alias="spatial-surround" + None, alias="spatial-surround" ) - spatial_width: Optional[SpatialWidthFeature] = Field( - default=None, alias="spatial-width" - ) - speech_enhance: Optional[SpeechEnhanceFeature] = Field( - default=None, alias="speech-enhance" - ) - tone_touch_x: Optional[ToneTouchXFeature] = Field(default=None, alias="toneTouchX") - tone_touch_y: Optional[ToneTouchYFeature] = Field(default=None, alias="toneTouchY") + spatial_width: Optional[SpatialWidthFeature] = Field(None, alias="spatial-width") + speech_enhance: Optional[SpeechEnhanceFeature] = Field(None, alias="speech-enhance") + tone_touch_x: Optional[ToneTouchXFeature] = Field(None, alias="toneTouchX") + tone_touch_y: Optional[ToneTouchYFeature] = Field(None, alias="toneTouchY") treble: Optional[TrebleFeature] = None - __properties: ClassVar[List[str]] = [ + __properties = [ "ambience", "balance", "bass", @@ -99,43 +92,28 @@ class SoundFeatureSet(BaseModel): "treble", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SoundFeatureSet: """Create an instance of SoundFeatureSet from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of ambience if self.ambience: _dict["ambience"] = self.ambience.to_dict() @@ -190,98 +168,98 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SoundFeatureSet: """Create an instance of SoundFeatureSet from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SoundFeatureSet.parse_obj(obj) - _obj = cls.model_validate( + _obj = SoundFeatureSet.parse_obj( { "ambience": ( - AmbienceFeature.from_dict(obj["ambience"]) + AmbienceFeature.from_dict(obj.get("ambience")) if obj.get("ambience") is not None else None ), "balance": ( - BalanceFeature.from_dict(obj["balance"]) + BalanceFeature.from_dict(obj.get("balance")) if obj.get("balance") is not None else None ), "bass": ( - BassFeature.from_dict(obj["bass"]) + BassFeature.from_dict(obj.get("bass")) if obj.get("bass") is not None else None ), - "bass-management": ( - BassManagementFeature.from_dict(obj["bass-management"]) + "bass_management": ( + BassManagementFeature.from_dict(obj.get("bass-management")) if obj.get("bass-management") is not None else None ), "compression": ( - CompressionFeature.from_dict(obj["compression"]) + CompressionFeature.from_dict(obj.get("compression")) if obj.get("compression") is not None else None ), "directivity": ( - DirectivityFeature.from_dict(obj["directivity"]) + DirectivityFeature.from_dict(obj.get("directivity")) if obj.get("directivity") is not None else None ), "fader": ( - FaderFeature.from_dict(obj["fader"]) + FaderFeature.from_dict(obj.get("fader")) if obj.get("fader") is not None else None ), - "roomCompensation": ( - RoomCompensationFeature.from_dict(obj["roomCompensation"]) + "room_compensation": ( + RoomCompensationFeature.from_dict(obj.get("roomCompensation")) if obj.get("roomCompensation") is not None else None ), - "spatial-envelopment": ( - SpatialEnvelopmentFeature.from_dict(obj["spatial-envelopment"]) + "spatial_envelopment": ( + SpatialEnvelopmentFeature.from_dict(obj.get("spatial-envelopment")) if obj.get("spatial-envelopment") is not None else None ), - "spatial-height": ( - SpatialHeightFeature.from_dict(obj["spatial-height"]) + "spatial_height": ( + SpatialHeightFeature.from_dict(obj.get("spatial-height")) if obj.get("spatial-height") is not None else None ), - "spatial-processing": ( - SpatialProcessingFeature.from_dict(obj["spatial-processing"]) + "spatial_processing": ( + SpatialProcessingFeature.from_dict(obj.get("spatial-processing")) if obj.get("spatial-processing") is not None else None ), - "spatial-surround": ( - SpatialSurroundFeature.from_dict(obj["spatial-surround"]) + "spatial_surround": ( + SpatialSurroundFeature.from_dict(obj.get("spatial-surround")) if obj.get("spatial-surround") is not None else None ), - "spatial-width": ( - SpatialWidthFeature.from_dict(obj["spatial-width"]) + "spatial_width": ( + SpatialWidthFeature.from_dict(obj.get("spatial-width")) if obj.get("spatial-width") is not None else None ), - "speech-enhance": ( - SpeechEnhanceFeature.from_dict(obj["speech-enhance"]) + "speech_enhance": ( + SpeechEnhanceFeature.from_dict(obj.get("speech-enhance")) if obj.get("speech-enhance") is not None else None ), - "toneTouchX": ( - ToneTouchXFeature.from_dict(obj["toneTouchX"]) + "tone_touch_x": ( + ToneTouchXFeature.from_dict(obj.get("toneTouchX")) if obj.get("toneTouchX") is not None else None ), - "toneTouchY": ( - ToneTouchYFeature.from_dict(obj["toneTouchY"]) + "tone_touch_y": ( + ToneTouchYFeature.from_dict(obj.get("toneTouchY")) if obj.get("toneTouchY") is not None else None ), "treble": ( - TrebleFeature.from_dict(obj["treble"]) + TrebleFeature.from_dict(obj.get("treble")) if obj.get("treble") is not None else None ), diff --git a/python_client/mozart_api/models/sound_settings.py b/python_client/mozart_api/models/sound_settings.py index f3ca26f..f613226 100644 --- a/python_client/mozart_api/models/sound_settings.py +++ b/python_client/mozart_api/models/sound_settings.py @@ -18,64 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.room_compensation_info import RoomCompensationInfo from mozart_api.models.sound_adjustments import SoundAdjustments from mozart_api.models.sound_tone_touch import SoundToneTouch -from typing import Optional, Set -from typing_extensions import Self class SoundSettings(BaseModel): """ SoundSettings - """ # noqa: E501 + """ adjustments: Optional[SoundAdjustments] = None room_compensation: Optional[RoomCompensationInfo] = Field( - default=None, alias="roomCompensation" + None, alias="roomCompensation" ) - tone_touch: Optional[SoundToneTouch] = Field(default=None, alias="toneTouch") - __properties: ClassVar[List[str]] = ["adjustments", "roomCompensation", "toneTouch"] + tone_touch: Optional[SoundToneTouch] = Field(None, alias="toneTouch") + __properties = ["adjustments", "roomCompensation", "toneTouch"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SoundSettings: """Create an instance of SoundSettings from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of adjustments if self.adjustments: _dict["adjustments"] = self.adjustments.to_dict() @@ -88,28 +72,28 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SoundSettings: """Create an instance of SoundSettings from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SoundSettings.parse_obj(obj) - _obj = cls.model_validate( + _obj = SoundSettings.parse_obj( { "adjustments": ( - SoundAdjustments.from_dict(obj["adjustments"]) + SoundAdjustments.from_dict(obj.get("adjustments")) if obj.get("adjustments") is not None else None ), - "roomCompensation": ( - RoomCompensationInfo.from_dict(obj["roomCompensation"]) + "room_compensation": ( + RoomCompensationInfo.from_dict(obj.get("roomCompensation")) if obj.get("roomCompensation") is not None else None ), - "toneTouch": ( - SoundToneTouch.from_dict(obj["toneTouch"]) + "tone_touch": ( + SoundToneTouch.from_dict(obj.get("toneTouch")) if obj.get("toneTouch") is not None else None ), diff --git a/python_client/mozart_api/models/sound_tone_touch.py b/python_client/mozart_api/models/sound_tone_touch.py index 8e50cfe..5e7f8bc 100644 --- a/python_client/mozart_api/models/sound_tone_touch.py +++ b/python_client/mozart_api/models/sound_tone_touch.py @@ -18,71 +18,55 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt class SoundToneTouch(BaseModel): """ SoundToneTouch - """ # noqa: E501 + """ x: Optional[Union[StrictFloat, StrictInt]] = None y: Optional[Union[StrictFloat, StrictInt]] = None z: Optional[Union[StrictFloat, StrictInt]] = None - __properties: ClassVar[List[str]] = ["x", "y", "z"] + __properties = ["x", "y", "z"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SoundToneTouch: """Create an instance of SoundToneTouch from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SoundToneTouch: """Create an instance of SoundToneTouch from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SoundToneTouch.parse_obj(obj) - _obj = cls.model_validate( + _obj = SoundToneTouch.parse_obj( {"x": obj.get("x"), "y": obj.get("y"), "z": obj.get("z")} ) return _obj diff --git a/python_client/mozart_api/models/source.py b/python_client/mozart_api/models/source.py index d2e385d..34e4526 100644 --- a/python_client/mozart_api/models/source.py +++ b/python_client/mozart_api/models/source.py @@ -18,31 +18,30 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr from mozart_api.models.source_type_enum import SourceTypeEnum -from typing import Optional, Set -from typing_extensions import Self class Source(BaseModel): """ Source - """ # noqa: E501 + """ id: Optional[StrictStr] = None is_enabled: Optional[StrictBool] = Field( - default=None, - description="some sources require an explicit activation or accept of terms before being enabled", + None, alias="isEnabled", + description="some sources require an explicit activation or accept of terms before being enabled", ) is_multiroom_available: Optional[StrictBool] = Field( - default=None, alias="isMultiroomAvailable" + None, alias="isMultiroomAvailable" ) - is_playable: Optional[StrictBool] = Field(default=None, alias="isPlayable") + is_playable: Optional[StrictBool] = Field(None, alias="isPlayable") name: Optional[StrictStr] = None type: Optional[SourceTypeEnum] = None - __properties: ClassVar[List[str]] = [ + __properties = [ "id", "isEnabled", "isMultiroomAvailable", @@ -51,66 +50,51 @@ class Source(BaseModel): "type", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Source: """Create an instance of Source from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of type if self.type: _dict["type"] = self.type.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Source: """Create an instance of Source from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Source.parse_obj(obj) - _obj = cls.model_validate( + _obj = Source.parse_obj( { "id": obj.get("id"), - "isEnabled": obj.get("isEnabled"), - "isMultiroomAvailable": obj.get("isMultiroomAvailable"), - "isPlayable": obj.get("isPlayable"), + "is_enabled": obj.get("isEnabled"), + "is_multiroom_available": obj.get("isMultiroomAvailable"), + "is_playable": obj.get("isPlayable"), "name": obj.get("name"), "type": ( - SourceTypeEnum.from_dict(obj["type"]) + SourceTypeEnum.from_dict(obj.get("type")) if obj.get("type") is not None else None ), diff --git a/python_client/mozart_api/models/source_array.py b/python_client/mozart_api/models/source_array.py index 6fb5553..d08ccf7 100644 --- a/python_client/mozart_api/models/source_array.py +++ b/python_client/mozart_api/models/source_array.py @@ -18,58 +18,42 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import List, Optional +from pydantic import BaseModel, conlist from mozart_api.models.source import Source -from typing import Optional, Set -from typing_extensions import Self class SourceArray(BaseModel): """ SourceArray - """ # noqa: E501 + """ - items: Optional[List[Source]] = None - __properties: ClassVar[List[str]] = ["items"] + items: Optional[conlist(Source)] = None + __properties = ["items"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SourceArray: """Create an instance of SourceArray from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in items (list) _items = [] if self.items: @@ -80,18 +64,18 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SourceArray: """Create an instance of SourceArray from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SourceArray.parse_obj(obj) - _obj = cls.model_validate( + _obj = SourceArray.parse_obj( { "items": ( - [Source.from_dict(_item) for _item in obj["items"]] + [Source.from_dict(_item) for _item in obj.get("items")] if obj.get("items") is not None else None ) diff --git a/python_client/mozart_api/models/source_type_enum.py b/python_client/mozart_api/models/source_type_enum.py index 01ce6ef..af01251 100644 --- a/python_client/mozart_api/models/source_type_enum.py +++ b/python_client/mozart_api/models/source_type_enum.py @@ -18,70 +18,54 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class SourceTypeEnum(BaseModel): """ SourceTypeEnum - """ # noqa: E501 + """ value: Optional[StrictStr] = Field( - default=None, + None, description="- beolink - bluetooth - dlna - qplay - airPlay - lineIn - chromeCast - uriStreamer - netRadio - local - generator - spotify - spdif - pl - wpl - tv - deezer - usbIn - tidal - tidalConnect - unknown", ) - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SourceTypeEnum: """Create an instance of SourceTypeEnum from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SourceTypeEnum: """Create an instance of SourceTypeEnum from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SourceTypeEnum.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = SourceTypeEnum.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/spatial_envelopment.py b/python_client/mozart_api/models/spatial_envelopment.py index a695ea9..beff13d 100644 --- a/python_client/mozart_api/models/spatial_envelopment.py +++ b/python_client/mozart_api/models/spatial_envelopment.py @@ -18,69 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class SpatialEnvelopment(BaseModel): """ SpatialEnvelopment - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected spatial-envelopment value" + ..., description="Selected spatial-envelopment value" ) - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialEnvelopment: """Create an instance of SpatialEnvelopment from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialEnvelopment: """Create an instance of SpatialEnvelopment from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialEnvelopment.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = SpatialEnvelopment.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/spatial_envelopment_feature.py b/python_client/mozart_api/models/spatial_envelopment_feature.py index c8af73b..ae9e252 100644 --- a/python_client/mozart_api/models/spatial_envelopment_feature.py +++ b/python_client/mozart_api/models/spatial_envelopment_feature.py @@ -18,62 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.spatial_envelopment import SpatialEnvelopment -from typing import Optional, Set -from typing_extensions import Self class SpatialEnvelopmentFeature(BaseModel): """ SpatialEnvelopmentFeature - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected spatial-envelopment value" + ..., description="Selected spatial-envelopment value" ) - default: SpatialEnvelopment - range: List[SpatialEnvelopment] = Field(description="spatial-envelopment range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialEnvelopment = Field(...) + range: conlist(SpatialEnvelopment, unique_items=True) = Field( + ..., description="spatial-envelopment range" ) + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialEnvelopmentFeature: """Create an instance of SpatialEnvelopmentFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -87,24 +73,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialEnvelopmentFeature: """Create an instance of SpatialEnvelopmentFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialEnvelopmentFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialEnvelopmentFeature.parse_obj( { "value": obj.get("value"), "default": ( - SpatialEnvelopment.from_dict(obj["default"]) + SpatialEnvelopment.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialEnvelopment.from_dict(_item) for _item in obj["range"]] + [SpatialEnvelopment.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_envelopment_range.py b/python_client/mozart_api/models/spatial_envelopment_range.py index dc9aab0..466f18d 100644 --- a/python_client/mozart_api/models/spatial_envelopment_range.py +++ b/python_client/mozart_api/models/spatial_envelopment_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.spatial_envelopment import SpatialEnvelopment -from typing import Optional, Set -from typing_extensions import Self class SpatialEnvelopmentRange(BaseModel): """ SpatialEnvelopmentRange - """ # noqa: E501 - - default: SpatialEnvelopment - range: List[SpatialEnvelopment] = Field(description="spatial-envelopment range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialEnvelopment = Field(...) + range: conlist(SpatialEnvelopment, unique_items=True) = Field( + ..., description="spatial-envelopment range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialEnvelopmentRange: """Create an instance of SpatialEnvelopmentRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialEnvelopmentRange: """Create an instance of SpatialEnvelopmentRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialEnvelopmentRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialEnvelopmentRange.parse_obj( { "default": ( - SpatialEnvelopment.from_dict(obj["default"]) + SpatialEnvelopment.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialEnvelopment.from_dict(_item) for _item in obj["range"]] + [SpatialEnvelopment.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_height.py b/python_client/mozart_api/models/spatial_height.py index 2a4d3e0..be6afd7 100644 --- a/python_client/mozart_api/models/spatial_height.py +++ b/python_client/mozart_api/models/spatial_height.py @@ -18,69 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class SpatialHeight(BaseModel): """ SpatialHeight - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected spatial-height value" + ..., description="Selected spatial-height value" ) - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialHeight: """Create an instance of SpatialHeight from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialHeight: """Create an instance of SpatialHeight from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialHeight.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = SpatialHeight.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/spatial_height_feature.py b/python_client/mozart_api/models/spatial_height_feature.py index bdc441b..5d56f55 100644 --- a/python_client/mozart_api/models/spatial_height_feature.py +++ b/python_client/mozart_api/models/spatial_height_feature.py @@ -18,62 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.spatial_height import SpatialHeight -from typing import Optional, Set -from typing_extensions import Self class SpatialHeightFeature(BaseModel): """ SpatialHeightFeature - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected spatial-height value" + ..., description="Selected spatial-height value" ) - default: SpatialHeight - range: List[SpatialHeight] = Field(description="spatial-height range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialHeight = Field(...) + range: conlist(SpatialHeight, unique_items=True) = Field( + ..., description="spatial-height range" ) + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialHeightFeature: """Create an instance of SpatialHeightFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -87,24 +73,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialHeightFeature: """Create an instance of SpatialHeightFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialHeightFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialHeightFeature.parse_obj( { "value": obj.get("value"), "default": ( - SpatialHeight.from_dict(obj["default"]) + SpatialHeight.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialHeight.from_dict(_item) for _item in obj["range"]] + [SpatialHeight.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_height_range.py b/python_client/mozart_api/models/spatial_height_range.py index 27b65e2..d7d8b96 100644 --- a/python_client/mozart_api/models/spatial_height_range.py +++ b/python_client/mozart_api/models/spatial_height_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.spatial_height import SpatialHeight -from typing import Optional, Set -from typing_extensions import Self class SpatialHeightRange(BaseModel): """ SpatialHeightRange - """ # noqa: E501 - - default: SpatialHeight - range: List[SpatialHeight] = Field(description="spatial-height range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialHeight = Field(...) + range: conlist(SpatialHeight, unique_items=True) = Field( + ..., description="spatial-height range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialHeightRange: """Create an instance of SpatialHeightRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialHeightRange: """Create an instance of SpatialHeightRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialHeightRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialHeightRange.parse_obj( { "default": ( - SpatialHeight.from_dict(obj["default"]) + SpatialHeight.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialHeight.from_dict(_item) for _item in obj["range"]] + [SpatialHeight.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_processing.py b/python_client/mozart_api/models/spatial_processing.py index 21c6812..d10e7d4 100644 --- a/python_client/mozart_api/models/spatial_processing.py +++ b/python_client/mozart_api/models/spatial_processing.py @@ -18,76 +18,59 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictStr, validator class SpatialProcessing(BaseModel): """ SpatialProcessing - """ # noqa: E501 + """ - value: StrictStr = Field(description="Selected spatial-processing value") - __properties: ClassVar[List[str]] = ["value"] + value: StrictStr = Field(..., description="Selected spatial-processing value") + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set(["direct", "trueimage", "downmix"]): + if value not in ("direct", "trueimage", "downmix"): raise ValueError( "must be one of enum values ('direct', 'trueimage', 'downmix')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialProcessing: """Create an instance of SpatialProcessing from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialProcessing: """Create an instance of SpatialProcessing from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialProcessing.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = SpatialProcessing.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/spatial_processing_feature.py b/python_client/mozart_api/models/spatial_processing_feature.py index 274ac90..26d317d 100644 --- a/python_client/mozart_api/models/spatial_processing_feature.py +++ b/python_client/mozart_api/models/spatial_processing_feature.py @@ -18,69 +18,55 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator from mozart_api.models.spatial_processing import SpatialProcessing -from typing import Optional, Set -from typing_extensions import Self class SpatialProcessingFeature(BaseModel): """ SpatialProcessingFeature - """ # noqa: E501 + """ - value: StrictStr = Field(description="Selected spatial-processing value") - default: SpatialProcessing - range: List[SpatialProcessing] = Field(description="spatial-processing range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] + value: StrictStr = Field(..., description="Selected spatial-processing value") + default: SpatialProcessing = Field(...) + range: conlist(SpatialProcessing, unique_items=True) = Field( + ..., description="spatial-processing range" + ) + __properties = ["value", "default", "range"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" - if value not in set(["direct", "trueimage", "downmix"]): + if value not in ("direct", "trueimage", "downmix"): raise ValueError( "must be one of enum values ('direct', 'trueimage', 'downmix')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialProcessingFeature: """Create an instance of SpatialProcessingFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -94,24 +80,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialProcessingFeature: """Create an instance of SpatialProcessingFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialProcessingFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialProcessingFeature.parse_obj( { "value": obj.get("value"), "default": ( - SpatialProcessing.from_dict(obj["default"]) + SpatialProcessing.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialProcessing.from_dict(_item) for _item in obj["range"]] + [SpatialProcessing.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_processing_range.py b/python_client/mozart_api/models/spatial_processing_range.py index 31cb7fa..70bba62 100644 --- a/python_client/mozart_api/models/spatial_processing_range.py +++ b/python_client/mozart_api/models/spatial_processing_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.spatial_processing import SpatialProcessing -from typing import Optional, Set -from typing_extensions import Self class SpatialProcessingRange(BaseModel): """ SpatialProcessingRange - """ # noqa: E501 - - default: SpatialProcessing - range: List[SpatialProcessing] = Field(description="spatial-processing range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialProcessing = Field(...) + range: conlist(SpatialProcessing, unique_items=True) = Field( + ..., description="spatial-processing range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialProcessingRange: """Create an instance of SpatialProcessingRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialProcessingRange: """Create an instance of SpatialProcessingRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialProcessingRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialProcessingRange.parse_obj( { "default": ( - SpatialProcessing.from_dict(obj["default"]) + SpatialProcessing.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialProcessing.from_dict(_item) for _item in obj["range"]] + [SpatialProcessing.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_surround.py b/python_client/mozart_api/models/spatial_surround.py index 979b0fd..df402bd 100644 --- a/python_client/mozart_api/models/spatial_surround.py +++ b/python_client/mozart_api/models/spatial_surround.py @@ -18,69 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class SpatialSurround(BaseModel): """ SpatialSurround - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected spatial-surround value" + ..., description="Selected spatial-surround value" ) - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialSurround: """Create an instance of SpatialSurround from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialSurround: """Create an instance of SpatialSurround from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialSurround.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = SpatialSurround.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/spatial_surround_feature.py b/python_client/mozart_api/models/spatial_surround_feature.py index ef28d5b..e52c4dc 100644 --- a/python_client/mozart_api/models/spatial_surround_feature.py +++ b/python_client/mozart_api/models/spatial_surround_feature.py @@ -18,62 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.spatial_surround import SpatialSurround -from typing import Optional, Set -from typing_extensions import Self class SpatialSurroundFeature(BaseModel): """ SpatialSurroundFeature - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected spatial-surround value" + ..., description="Selected spatial-surround value" ) - default: SpatialSurround - range: List[SpatialSurround] = Field(description="spatial-surround range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialSurround = Field(...) + range: conlist(SpatialSurround, unique_items=True) = Field( + ..., description="spatial-surround range" ) + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialSurroundFeature: """Create an instance of SpatialSurroundFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -87,24 +73,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialSurroundFeature: """Create an instance of SpatialSurroundFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialSurroundFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialSurroundFeature.parse_obj( { "value": obj.get("value"), "default": ( - SpatialSurround.from_dict(obj["default"]) + SpatialSurround.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialSurround.from_dict(_item) for _item in obj["range"]] + [SpatialSurround.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_surround_range.py b/python_client/mozart_api/models/spatial_surround_range.py index 701bf7d..79f21ff 100644 --- a/python_client/mozart_api/models/spatial_surround_range.py +++ b/python_client/mozart_api/models/spatial_surround_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.spatial_surround import SpatialSurround -from typing import Optional, Set -from typing_extensions import Self class SpatialSurroundRange(BaseModel): """ SpatialSurroundRange - """ # noqa: E501 - - default: SpatialSurround - range: List[SpatialSurround] = Field(description="spatial-surround range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialSurround = Field(...) + range: conlist(SpatialSurround, unique_items=True) = Field( + ..., description="spatial-surround range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialSurroundRange: """Create an instance of SpatialSurroundRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialSurroundRange: """Create an instance of SpatialSurroundRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialSurroundRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialSurroundRange.parse_obj( { "default": ( - SpatialSurround.from_dict(obj["default"]) + SpatialSurround.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialSurround.from_dict(_item) for _item in obj["range"]] + [SpatialSurround.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_width.py b/python_client/mozart_api/models/spatial_width.py index e02a68a..b205d56 100644 --- a/python_client/mozart_api/models/spatial_width.py +++ b/python_client/mozart_api/models/spatial_width.py @@ -18,69 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class SpatialWidth(BaseModel): """ SpatialWidth - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected spatial-width value" + ..., description="Selected spatial-width value" ) - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialWidth: """Create an instance of SpatialWidth from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialWidth: """Create an instance of SpatialWidth from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialWidth.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = SpatialWidth.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/spatial_width_feature.py b/python_client/mozart_api/models/spatial_width_feature.py index c6ae27e..73302ea 100644 --- a/python_client/mozart_api/models/spatial_width_feature.py +++ b/python_client/mozart_api/models/spatial_width_feature.py @@ -18,62 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.spatial_width import SpatialWidth -from typing import Optional, Set -from typing_extensions import Self class SpatialWidthFeature(BaseModel): """ SpatialWidthFeature - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected spatial-width value" + ..., description="Selected spatial-width value" ) - default: SpatialWidth - range: List[SpatialWidth] = Field(description="spatial-width range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialWidth = Field(...) + range: conlist(SpatialWidth, unique_items=True) = Field( + ..., description="spatial-width range" ) + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialWidthFeature: """Create an instance of SpatialWidthFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -87,24 +73,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialWidthFeature: """Create an instance of SpatialWidthFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialWidthFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialWidthFeature.parse_obj( { "value": obj.get("value"), "default": ( - SpatialWidth.from_dict(obj["default"]) + SpatialWidth.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialWidth.from_dict(_item) for _item in obj["range"]] + [SpatialWidth.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/spatial_width_range.py b/python_client/mozart_api/models/spatial_width_range.py index f35468a..6fde5ed 100644 --- a/python_client/mozart_api/models/spatial_width_range.py +++ b/python_client/mozart_api/models/spatial_width_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.spatial_width import SpatialWidth -from typing import Optional, Set -from typing_extensions import Self class SpatialWidthRange(BaseModel): """ SpatialWidthRange - """ # noqa: E501 - - default: SpatialWidth - range: List[SpatialWidth] = Field(description="spatial-width range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpatialWidth = Field(...) + range: conlist(SpatialWidth, unique_items=True) = Field( + ..., description="spatial-width range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpatialWidthRange: """Create an instance of SpatialWidthRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpatialWidthRange: """Create an instance of SpatialWidthRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpatialWidthRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpatialWidthRange.parse_obj( { "default": ( - SpatialWidth.from_dict(obj["default"]) + SpatialWidth.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpatialWidth.from_dict(_item) for _item in obj["range"]] + [SpatialWidth.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/speaker_group.py b/python_client/mozart_api/models/speaker_group.py index 5bc56b7..9e74eb3 100644 --- a/python_client/mozart_api/models/speaker_group.py +++ b/python_client/mozart_api/models/speaker_group.py @@ -18,54 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conint, conlist from mozart_api.models.latency_profile import LatencyProfile from mozart_api.models.speaker_group_member import SpeakerGroupMember -from typing import Optional, Set -from typing_extensions import Self class SpeakerGroup(BaseModel): """ SpeakerGroup - """ # noqa: E501 + """ - crossover_frequency: Optional[Annotated[int, Field(le=300, strict=True, ge=20)]] = ( - Field( - default=None, - description="Crossover frequency for bass management in Hz", - alias="crossoverFrequency", - ) + crossover_frequency: Optional[conint(strict=True, le=300, ge=20)] = Field( + None, + alias="crossoverFrequency", + description="Crossover frequency for bass management in Hz", ) enable_phase_compensation: Optional[StrictBool] = Field( - default=None, - description="Enable phase compensation in bass management.", + None, alias="enablePhaseCompensation", + description="Enable phase compensation in bass management.", ) friendly_name: Optional[StrictStr] = Field( - default=None, - description="Friendly name of the SpeakerGroup. Required when creating a new group ", + None, alias="friendlyName", + description="Friendly name of the SpeakerGroup. Required when creating a new group ", ) id: Optional[StrictStr] = None - is_deleteable: Optional[StrictBool] = Field(default=None, alias="isDeleteable") - items: Optional[List[SpeakerGroupMember]] = None - latency_profile: Optional[LatencyProfile] = Field( - default=None, alias="latencyProfile" - ) + is_deleteable: Optional[StrictBool] = Field(None, alias="isDeleteable") + items: Optional[conlist(SpeakerGroupMember)] = None + latency_profile: Optional[LatencyProfile] = Field(None, alias="latencyProfile") room_compensation_id: Optional[StrictStr] = Field( - default=None, - description="ID of the calculated coefficents for this group, made during advanced room compensation. When updating an existing group, an empty string will clear roomCompensationId. ", + None, alias="roomCompensationId", + description="ID of the calculated coefficents for this group, made during advanced room compensation. When updating an existing group, an empty string will clear roomCompensationId. ", ) - speaker_preset: Optional[Annotated[int, Field(le=99, strict=True, ge=0)]] = Field( - default=None, - description="Speaker preset / listening mode eg. BL28 curtain position etc.", + speaker_preset: Optional[conint(strict=True, le=99, ge=0)] = Field( + None, alias="speakerPreset", + description="Speaker preset / listening mode eg. BL28 curtain position etc.", ) - __properties: ClassVar[List[str]] = [ + __properties = [ "crossoverFrequency", "enablePhaseCompensation", "friendlyName", @@ -77,43 +71,28 @@ class SpeakerGroup(BaseModel): "speakerPreset", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeakerGroup: """Create an instance of SpeakerGroup from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in items (list) _items = [] if self.items: @@ -125,79 +104,79 @@ def to_dict(self) -> Dict[str, Any]: if self.latency_profile: _dict["latencyProfile"] = self.latency_profile.to_dict() # set to None if crossover_frequency (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.crossover_frequency is None - and "crossover_frequency" in self.model_fields_set + and "crossover_frequency" in self.__fields_set__ ): _dict["crossoverFrequency"] = None # set to None if enable_phase_compensation (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.enable_phase_compensation is None - and "enable_phase_compensation" in self.model_fields_set + and "enable_phase_compensation" in self.__fields_set__ ): _dict["enablePhaseCompensation"] = None # set to None if friendly_name (nullable) is None - # and model_fields_set contains the field - if self.friendly_name is None and "friendly_name" in self.model_fields_set: + # and __fields_set__ contains the field + if self.friendly_name is None and "friendly_name" in self.__fields_set__: _dict["friendlyName"] = None # set to None if is_deleteable (nullable) is None - # and model_fields_set contains the field - if self.is_deleteable is None and "is_deleteable" in self.model_fields_set: + # and __fields_set__ contains the field + if self.is_deleteable is None and "is_deleteable" in self.__fields_set__: _dict["isDeleteable"] = None # set to None if items (nullable) is None - # and model_fields_set contains the field - if self.items is None and "items" in self.model_fields_set: + # and __fields_set__ contains the field + if self.items is None and "items" in self.__fields_set__: _dict["items"] = None # set to None if room_compensation_id (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.room_compensation_id is None - and "room_compensation_id" in self.model_fields_set + and "room_compensation_id" in self.__fields_set__ ): _dict["roomCompensationId"] = None # set to None if speaker_preset (nullable) is None - # and model_fields_set contains the field - if self.speaker_preset is None and "speaker_preset" in self.model_fields_set: + # and __fields_set__ contains the field + if self.speaker_preset is None and "speaker_preset" in self.__fields_set__: _dict["speakerPreset"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeakerGroup: """Create an instance of SpeakerGroup from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeakerGroup.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpeakerGroup.parse_obj( { - "crossoverFrequency": obj.get("crossoverFrequency"), - "enablePhaseCompensation": obj.get("enablePhaseCompensation"), - "friendlyName": obj.get("friendlyName"), + "crossover_frequency": obj.get("crossoverFrequency"), + "enable_phase_compensation": obj.get("enablePhaseCompensation"), + "friendly_name": obj.get("friendlyName"), "id": obj.get("id"), - "isDeleteable": obj.get("isDeleteable"), + "is_deleteable": obj.get("isDeleteable"), "items": ( - [SpeakerGroupMember.from_dict(_item) for _item in obj["items"]] + [SpeakerGroupMember.from_dict(_item) for _item in obj.get("items")] if obj.get("items") is not None else None ), - "latencyProfile": ( - LatencyProfile.from_dict(obj["latencyProfile"]) + "latency_profile": ( + LatencyProfile.from_dict(obj.get("latencyProfile")) if obj.get("latencyProfile") is not None else None ), - "roomCompensationId": obj.get("roomCompensationId"), - "speakerPreset": obj.get("speakerPreset"), + "room_compensation_id": obj.get("roomCompensationId"), + "speaker_preset": obj.get("speakerPreset"), } ) return _obj diff --git a/python_client/mozart_api/models/speaker_group_member.py b/python_client/mozart_api/models/speaker_group_member.py index 3b00d48..69fe1cc 100644 --- a/python_client/mozart_api/models/speaker_group_member.py +++ b/python_client/mozart_api/models/speaker_group_member.py @@ -18,41 +18,34 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing_extensions import Annotated + +from typing import Optional, Union +from pydantic import BaseModel, Field, StrictStr, confloat, conint from mozart_api.models.speaker_group_member_location import SpeakerGroupMemberLocation -from typing import Optional, Set -from typing_extensions import Self class SpeakerGroupMember(BaseModel): """ SpeakerGroupMember - """ # noqa: E501 + """ - distance: Optional[Annotated[int, Field(le=1500, strict=True, ge=0)]] = Field( - default=None, description="Distance from listening position in cm" + distance: Optional[conint(strict=True, le=1500, ge=0)] = Field( + None, description="Distance from listening position in cm" ) - friendly_name: Optional[StrictStr] = Field(default=None, alias="friendlyName") + friendly_name: Optional[StrictStr] = Field(None, alias="friendlyName") gain: Optional[ - Union[ - Annotated[float, Field(le=6, strict=True, ge=-24)], - Annotated[int, Field(le=6, strict=True, ge=-24)], - ] - ] = Field(default=None, description="Level in dB") - id: StrictStr + Union[confloat(le=6, ge=-24, strict=True), conint(le=6, ge=-24, strict=True)] + ] = Field(None, description="Level in dB") + id: StrictStr = Field(...) location: Optional[SpeakerGroupMemberLocation] = None - redirection_level: Optional[Annotated[int, Field(le=6, strict=True, ge=-100)]] = ( - Field( - default=None, - description="Redirection level for bass management in dB", - alias="redirectionLevel", - ) + redirection_level: Optional[conint(strict=True, le=6, ge=-100)] = Field( + None, + alias="redirectionLevel", + description="Redirection level for bass management in dB", ) role: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = [ + __properties = [ "distance", "friendlyName", "gain", @@ -63,107 +56,92 @@ class SpeakerGroupMember(BaseModel): "type", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeakerGroupMember: """Create an instance of SpeakerGroupMember from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of location if self.location: _dict["location"] = self.location.to_dict() # set to None if distance (nullable) is None - # and model_fields_set contains the field - if self.distance is None and "distance" in self.model_fields_set: + # and __fields_set__ contains the field + if self.distance is None and "distance" in self.__fields_set__: _dict["distance"] = None # set to None if friendly_name (nullable) is None - # and model_fields_set contains the field - if self.friendly_name is None and "friendly_name" in self.model_fields_set: + # and __fields_set__ contains the field + if self.friendly_name is None and "friendly_name" in self.__fields_set__: _dict["friendlyName"] = None # set to None if gain (nullable) is None - # and model_fields_set contains the field - if self.gain is None and "gain" in self.model_fields_set: + # and __fields_set__ contains the field + if self.gain is None and "gain" in self.__fields_set__: _dict["gain"] = None # set to None if location (nullable) is None - # and model_fields_set contains the field - if self.location is None and "location" in self.model_fields_set: + # and __fields_set__ contains the field + if self.location is None and "location" in self.__fields_set__: _dict["location"] = None # set to None if redirection_level (nullable) is None - # and model_fields_set contains the field + # and __fields_set__ contains the field if ( self.redirection_level is None - and "redirection_level" in self.model_fields_set + and "redirection_level" in self.__fields_set__ ): _dict["redirectionLevel"] = None # set to None if role (nullable) is None - # and model_fields_set contains the field - if self.role is None and "role" in self.model_fields_set: + # and __fields_set__ contains the field + if self.role is None and "role" in self.__fields_set__: _dict["role"] = None # set to None if type (nullable) is None - # and model_fields_set contains the field - if self.type is None and "type" in self.model_fields_set: + # and __fields_set__ contains the field + if self.type is None and "type" in self.__fields_set__: _dict["type"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeakerGroupMember: """Create an instance of SpeakerGroupMember from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeakerGroupMember.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpeakerGroupMember.parse_obj( { "distance": obj.get("distance"), - "friendlyName": obj.get("friendlyName"), + "friendly_name": obj.get("friendlyName"), "gain": obj.get("gain"), "id": obj.get("id"), "location": ( - SpeakerGroupMemberLocation.from_dict(obj["location"]) + SpeakerGroupMemberLocation.from_dict(obj.get("location")) if obj.get("location") is not None else None ), - "redirectionLevel": obj.get("redirectionLevel"), + "redirection_level": obj.get("redirectionLevel"), "role": obj.get("role"), "type": obj.get("type"), } diff --git a/python_client/mozart_api/models/speaker_group_member_location.py b/python_client/mozart_api/models/speaker_group_member_location.py index b49120a..d27b630 100644 --- a/python_client/mozart_api/models/speaker_group_member_location.py +++ b/python_client/mozart_api/models/speaker_group_member_location.py @@ -18,71 +18,54 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictInt class SpeakerGroupMemberLocation(BaseModel): """ - Coordinates of the speaker position in cm. Location is only relevant when the group is based on the automatic role assignment of advanced room compensation. The location is relative to the external microphone used during advanced room compensation measurements: x=0, y=0, z=0: The location of the external microphone used during measurement. x<0: To the left of the external microphone. x>0: To the right of the external microphone. y<0: Behind the external microphone. y>0: In front of the external microphone. z<0: Above the external microphone (may not be reliable). z>0: Below the external microphone (may not be reliable). - """ # noqa: E501 + Coordinates of the speaker position in cm. Location is only relevant when the group is based on the automatic role assignment of advanced room compensation. The location is relative to the external microphone used during advanced room compensation measurements: x=0, y=0, z=0: The location of the external microphone used during measurement. x<0: To the left of the external microphone. x>0: To the right of the external microphone. y<0: Behind the external microphone. y>0: In front of the external microphone. z<0: Above the external microphone (may not be reliable). z>0: Below the external microphone (may not be reliable). # noqa: E501 + """ - x: StrictInt - y: StrictInt - z: StrictInt - __properties: ClassVar[List[str]] = ["x", "y", "z"] + x: StrictInt = Field(...) + y: StrictInt = Field(...) + z: StrictInt = Field(...) + __properties = ["x", "y", "z"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeakerGroupMemberLocation: """Create an instance of SpeakerGroupMemberLocation from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeakerGroupMemberLocation: """Create an instance of SpeakerGroupMemberLocation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeakerGroupMemberLocation.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpeakerGroupMemberLocation.parse_obj( {"x": obj.get("x"), "y": obj.get("y"), "z": obj.get("z")} ) return _obj diff --git a/python_client/mozart_api/models/speaker_group_overview.py b/python_client/mozart_api/models/speaker_group_overview.py index a525137..2e727da 100644 --- a/python_client/mozart_api/models/speaker_group_overview.py +++ b/python_client/mozart_api/models/speaker_group_overview.py @@ -18,75 +18,58 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictBool, StrictStr class SpeakerGroupOverview(BaseModel): """ SpeakerGroupOverview - """ # noqa: E501 + """ - friendly_name: StrictStr = Field(alias="friendlyName") - id: StrictStr - is_deleteable: StrictBool = Field(alias="isDeleteable") - __properties: ClassVar[List[str]] = ["friendlyName", "id", "isDeleteable"] + friendly_name: StrictStr = Field(..., alias="friendlyName") + id: StrictStr = Field(...) + is_deleteable: StrictBool = Field(..., alias="isDeleteable") + __properties = ["friendlyName", "id", "isDeleteable"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeakerGroupOverview: """Create an instance of SpeakerGroupOverview from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeakerGroupOverview: """Create an instance of SpeakerGroupOverview from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeakerGroupOverview.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpeakerGroupOverview.parse_obj( { - "friendlyName": obj.get("friendlyName"), + "friendly_name": obj.get("friendlyName"), "id": obj.get("id"), - "isDeleteable": obj.get("isDeleteable"), + "is_deleteable": obj.get("isDeleteable"), } ) return _obj diff --git a/python_client/mozart_api/models/speaker_link_member_status.py b/python_client/mozart_api/models/speaker_link_member_status.py index 4b301c9..f45240f 100644 --- a/python_client/mozart_api/models/speaker_link_member_status.py +++ b/python_client/mozart_api/models/speaker_link_member_status.py @@ -19,36 +19,33 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, constr, validator class SpeakerLinkMemberStatus(BaseModel): """ SpeakerLinkMemberStatus - """ # noqa: E501 + """ base_url: Optional[StrictStr] = Field( - default=None, - description="API prefix to use when talking to the secondary", + None, alias="baseUrl", + description="API prefix to use when talking to the secondary", ) - health: StrictStr + health: StrictStr = Field(...) ip_address: Optional[StrictStr] = Field( - default=None, description="IP address", alias="ipAddress" + None, alias="ipAddress", description="IP address" ) - network_type: StrictStr = Field(alias="networkType") - product_type: Optional[StrictStr] = Field(default=None, alias="productType") - serial_number: Annotated[str, Field(strict=True)] = Field( - description="Speaker serial number", alias="serialNumber" + network_type: StrictStr = Field(..., alias="networkType") + product_type: Optional[StrictStr] = Field(None, alias="productType") + serial_number: constr(strict=True) = Field( + ..., alias="serialNumber", description="Speaker serial number" ) updated_at: datetime = Field( - description="Timestamp in RFC3393 format", alias="updatedAt" + ..., alias="updatedAt", description="Timestamp in RFC3393 format" ) - __properties: ClassVar[List[str]] = [ + __properties = [ "baseUrl", "health", "ipAddress", @@ -58,96 +55,81 @@ class SpeakerLinkMemberStatus(BaseModel): "updatedAt", ] - @field_validator("health") + @validator("health") def health_validate_enum(cls, value): """Validates the enum""" - if value not in set(["unknown", "good", "warning", "bad"]): + if value not in ("unknown", "good", "warning", "bad"): raise ValueError( "must be one of enum values ('unknown', 'good', 'warning', 'bad')" ) return value - @field_validator("network_type") + @validator("network_type") def network_type_validate_enum(cls, value): """Validates the enum""" - if value not in set(["none", "wired", "wireless"]): + if value not in ("none", "wired", "wireless"): raise ValueError("must be one of enum values ('none', 'wired', 'wireless')") return value - @field_validator("serial_number") + @validator("serial_number") def serial_number_validate_regular_expression(cls, value): """Validates the regular expression""" if not re.match(r"^\d{8}", value): raise ValueError(r"must validate the regular expression /^\d{8}/") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeakerLinkMemberStatus: """Create an instance of SpeakerLinkMemberStatus from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if base_url (nullable) is None - # and model_fields_set contains the field - if self.base_url is None and "base_url" in self.model_fields_set: + # and __fields_set__ contains the field + if self.base_url is None and "base_url" in self.__fields_set__: _dict["baseUrl"] = None # set to None if ip_address (nullable) is None - # and model_fields_set contains the field - if self.ip_address is None and "ip_address" in self.model_fields_set: + # and __fields_set__ contains the field + if self.ip_address is None and "ip_address" in self.__fields_set__: _dict["ipAddress"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeakerLinkMemberStatus: """Create an instance of SpeakerLinkMemberStatus from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeakerLinkMemberStatus.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpeakerLinkMemberStatus.parse_obj( { - "baseUrl": obj.get("baseUrl"), + "base_url": obj.get("baseUrl"), "health": obj.get("health"), - "ipAddress": obj.get("ipAddress"), - "networkType": obj.get("networkType"), - "productType": obj.get("productType"), - "serialNumber": obj.get("serialNumber"), - "updatedAt": obj.get("updatedAt"), + "ip_address": obj.get("ipAddress"), + "network_type": obj.get("networkType"), + "product_type": obj.get("productType"), + "serial_number": obj.get("serialNumber"), + "updated_at": obj.get("updatedAt"), } ) return _obj diff --git a/python_client/mozart_api/models/speaker_link_status.py b/python_client/mozart_api/models/speaker_link_status.py index c03d919..3dc5c67 100644 --- a/python_client/mozart_api/models/speaker_link_status.py +++ b/python_client/mozart_api/models/speaker_link_status.py @@ -18,68 +18,52 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator from mozart_api.models.speaker_link_member_status import SpeakerLinkMemberStatus -from typing import Optional, Set -from typing_extensions import Self class SpeakerLinkStatus(BaseModel): """ SpeakerLinkStatus - """ # noqa: E501 + """ - speakers: List[SpeakerLinkMemberStatus] - type: StrictStr - __properties: ClassVar[List[str]] = ["speakers", "type"] + speakers: conlist(SpeakerLinkMemberStatus) = Field(...) + type: StrictStr = Field(...) + __properties = ["speakers", "type"] - @field_validator("type") + @validator("type") def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(["standalone", "stereo", "surround"]): + if value not in ("standalone", "stereo", "surround"): raise ValueError( "must be one of enum values ('standalone', 'stereo', 'surround')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeakerLinkStatus: """Create an instance of SpeakerLinkStatus from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in speakers (list) _items = [] if self.speakers: @@ -90,20 +74,20 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeakerLinkStatus: """Create an instance of SpeakerLinkStatus from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeakerLinkStatus.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpeakerLinkStatus.parse_obj( { "speakers": ( [ SpeakerLinkMemberStatus.from_dict(_item) - for _item in obj["speakers"] + for _item in obj.get("speakers") ] if obj.get("speakers") is not None else None diff --git a/python_client/mozart_api/models/speaker_role_enum.py b/python_client/mozart_api/models/speaker_role_enum.py index f37da75..5b8113c 100644 --- a/python_client/mozart_api/models/speaker_role_enum.py +++ b/python_client/mozart_api/models/speaker_role_enum.py @@ -18,79 +18,63 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class SpeakerRoleEnum(BaseModel): """ SpeakerRoleEnum - """ # noqa: E501 + """ value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["standalone", "multichannel"]): + if value not in ("standalone", "multichannel"): raise ValueError( "must be one of enum values ('standalone', 'multichannel')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeakerRoleEnum: """Create an instance of SpeakerRoleEnum from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeakerRoleEnum: """Create an instance of SpeakerRoleEnum from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeakerRoleEnum.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = SpeakerRoleEnum.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/speech_enhance.py b/python_client/mozart_api/models/speech_enhance.py index 78695b6..e8c995e 100644 --- a/python_client/mozart_api/models/speech_enhance.py +++ b/python_client/mozart_api/models/speech_enhance.py @@ -18,69 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class SpeechEnhance(BaseModel): """ SpeechEnhance - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected speech-enhance value" + ..., description="Selected speech-enhance value" ) - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeechEnhance: """Create an instance of SpeechEnhance from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeechEnhance: """Create an instance of SpeechEnhance from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeechEnhance.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = SpeechEnhance.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/speech_enhance_feature.py b/python_client/mozart_api/models/speech_enhance_feature.py index 3eb299a..7cb73df 100644 --- a/python_client/mozart_api/models/speech_enhance_feature.py +++ b/python_client/mozart_api/models/speech_enhance_feature.py @@ -18,62 +18,48 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.speech_enhance import SpeechEnhance -from typing import Optional, Set -from typing_extensions import Self class SpeechEnhanceFeature(BaseModel): """ SpeechEnhanceFeature - """ # noqa: E501 + """ value: Union[StrictFloat, StrictInt] = Field( - description="Selected speech-enhance value" + ..., description="Selected speech-enhance value" ) - default: SpeechEnhance - range: List[SpeechEnhance] = Field(description="speech-enhance range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpeechEnhance = Field(...) + range: conlist(SpeechEnhance, unique_items=True) = Field( + ..., description="speech-enhance range" ) + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeechEnhanceFeature: """Create an instance of SpeechEnhanceFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -87,24 +73,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeechEnhanceFeature: """Create an instance of SpeechEnhanceFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeechEnhanceFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpeechEnhanceFeature.parse_obj( { "value": obj.get("value"), "default": ( - SpeechEnhance.from_dict(obj["default"]) + SpeechEnhance.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpeechEnhance.from_dict(_item) for _item in obj["range"]] + [SpeechEnhance.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/speech_enhance_range.py b/python_client/mozart_api/models/speech_enhance_range.py index 33e54be..a58ca05 100644 --- a/python_client/mozart_api/models/speech_enhance_range.py +++ b/python_client/mozart_api/models/speech_enhance_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.speech_enhance import SpeechEnhance -from typing import Optional, Set -from typing_extensions import Self class SpeechEnhanceRange(BaseModel): """ SpeechEnhanceRange - """ # noqa: E501 - - default: SpeechEnhance - range: List[SpeechEnhance] = Field(description="speech-enhance range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: SpeechEnhance = Field(...) + range: conlist(SpeechEnhance, unique_items=True) = Field( + ..., description="speech-enhance range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> SpeechEnhanceRange: """Create an instance of SpeechEnhanceRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> SpeechEnhanceRange: """Create an instance of SpeechEnhanceRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return SpeechEnhanceRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = SpeechEnhanceRange.parse_obj( { "default": ( - SpeechEnhance.from_dict(obj["default"]) + SpeechEnhance.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [SpeechEnhance.from_dict(_item) for _item in obj["range"]] + [SpeechEnhance.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/stand_connected.py b/python_client/mozart_api/models/stand_connected.py index 52a7796..3b1fbf7 100644 --- a/python_client/mozart_api/models/stand_connected.py +++ b/python_client/mozart_api/models/stand_connected.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictBool class StandConnected(BaseModel): """ StandConnected - """ # noqa: E501 + """ connected: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["connected"] + __properties = ["connected"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> StandConnected: """Create an instance of StandConnected from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> StandConnected: """Create an instance of StandConnected from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return StandConnected.parse_obj(obj) - _obj = cls.model_validate({"connected": obj.get("connected")}) + _obj = StandConnected.parse_obj({"connected": obj.get("connected")}) return _obj diff --git a/python_client/mozart_api/models/stand_movement.py b/python_client/mozart_api/models/stand_movement.py index da2b3d7..a4bc97a 100644 --- a/python_client/mozart_api/models/stand_movement.py +++ b/python_client/mozart_api/models/stand_movement.py @@ -18,103 +18,84 @@ import re # noqa: F401 import json + +from typing import Optional, Union from pydantic import ( BaseModel, - ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, - field_validator, + validator, ) -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self class StandMovement(BaseModel): """ StandMovement - """ # noqa: E501 + """ angle: Optional[Union[StrictFloat, StrictInt]] = None - ignore_endstop: Optional[StrictBool] = Field(default=None, alias="ignoreEndstop") - stand_motion: Optional[StrictStr] = Field(default=None, alias="standMotion") - __properties: ClassVar[List[str]] = ["angle", "ignoreEndstop", "standMotion"] + ignore_endstop: Optional[StrictBool] = Field(None, alias="ignoreEndstop") + stand_motion: Optional[StrictStr] = Field(None, alias="standMotion") + __properties = ["angle", "ignoreEndstop", "standMotion"] - @field_validator("stand_motion") + @validator("stand_motion") def stand_motion_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - ["continuousCCW", "stepCCW", "stop", "stepCW", "continuousCW"] - ): + if value not in ("continuousCCW", "stepCCW", "stop", "stepCW", "continuousCW"): raise ValueError( "must be one of enum values ('continuousCCW', 'stepCCW', 'stop', 'stepCW', 'continuousCW')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> StandMovement: """Create an instance of StandMovement from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # set to None if angle (nullable) is None - # and model_fields_set contains the field - if self.angle is None and "angle" in self.model_fields_set: + # and __fields_set__ contains the field + if self.angle is None and "angle" in self.__fields_set__: _dict["angle"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> StandMovement: """Create an instance of StandMovement from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return StandMovement.parse_obj(obj) - _obj = cls.model_validate( + _obj = StandMovement.parse_obj( { "angle": obj.get("angle"), - "ignoreEndstop": obj.get("ignoreEndstop"), - "standMotion": obj.get("standMotion"), + "ignore_endstop": obj.get("ignoreEndstop"), + "stand_motion": obj.get("standMotion"), } ) return _obj diff --git a/python_client/mozart_api/models/stand_position.py b/python_client/mozart_api/models/stand_position.py index 2af3c08..036ec1e 100644 --- a/python_client/mozart_api/models/stand_position.py +++ b/python_client/mozart_api/models/stand_position.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt class StandPosition(BaseModel): """ StandPosition - """ # noqa: E501 + """ angle: Optional[Union[StrictFloat, StrictInt]] = None - __properties: ClassVar[List[str]] = ["angle"] + __properties = ["angle"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> StandPosition: """Create an instance of StandPosition from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> StandPosition: """Create an instance of StandPosition from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return StandPosition.parse_obj(obj) - _obj = cls.model_validate({"angle": obj.get("angle")}) + _obj = StandPosition.parse_obj({"angle": obj.get("angle")}) return _obj diff --git a/python_client/mozart_api/models/tone_touch.py b/python_client/mozart_api/models/tone_touch.py index ffdb0af..0404a56 100644 --- a/python_client/mozart_api/models/tone_touch.py +++ b/python_client/mozart_api/models/tone_touch.py @@ -18,59 +18,43 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel from mozart_api.models.tone_touch_type import ToneTouchType -from typing import Optional, Set -from typing_extensions import Self class ToneTouch(BaseModel): """ ToneTouch - """ # noqa: E501 + """ x: Optional[ToneTouchType] = None y: Optional[ToneTouchType] = None - __properties: ClassVar[List[str]] = ["x", "y"] + __properties = ["x", "y"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ToneTouch: """Create an instance of ToneTouch from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of x if self.x: _dict["x"] = self.x.to_dict() @@ -80,23 +64,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ToneTouch: """Create an instance of ToneTouch from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ToneTouch.parse_obj(obj) - _obj = cls.model_validate( + _obj = ToneTouch.parse_obj( { "x": ( - ToneTouchType.from_dict(obj["x"]) + ToneTouchType.from_dict(obj.get("x")) if obj.get("x") is not None else None ), "y": ( - ToneTouchType.from_dict(obj["y"]) + ToneTouchType.from_dict(obj.get("y")) if obj.get("y") is not None else None ), diff --git a/python_client/mozart_api/models/tone_touch_type.py b/python_client/mozart_api/models/tone_touch_type.py index 40bd34b..364c36b 100644 --- a/python_client/mozart_api/models/tone_touch_type.py +++ b/python_client/mozart_api/models/tone_touch_type.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt class ToneTouchType(BaseModel): """ ToneTouchType - """ # noqa: E501 + """ + + value: Union[StrictFloat, StrictInt] = Field(...) + __properties = ["value"] - value: Union[StrictFloat, StrictInt] - __properties: ClassVar[List[str]] = ["value"] + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ToneTouchType: """Create an instance of ToneTouchType from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ToneTouchType: """Create an instance of ToneTouchType from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ToneTouchType.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = ToneTouchType.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/tone_touch_type_range.py b/python_client/mozart_api/models/tone_touch_type_range.py index a8442f8..6a75d6a 100644 --- a/python_client/mozart_api/models/tone_touch_type_range.py +++ b/python_client/mozart_api/models/tone_touch_type_range.py @@ -18,61 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.tone_touch_type import ToneTouchType -from typing import Optional, Set -from typing_extensions import Self class ToneTouchTypeRange(BaseModel): """ ToneTouchTypeRange - """ # noqa: E501 + """ - default: ToneTouchType - range: List[ToneTouchType] = Field( - description="Product and role specific tone touch X or Y range" + default: ToneTouchType = Field(...) + range: conlist(ToneTouchType, unique_items=True) = Field( + ..., description="Product and role specific tone touch X or Y range" ) - __properties: ClassVar[List[str]] = ["default", "range"] + __properties = ["default", "range"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ToneTouchTypeRange: """Create an instance of ToneTouchTypeRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -86,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ToneTouchTypeRange: """Create an instance of ToneTouchTypeRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ToneTouchTypeRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = ToneTouchTypeRange.parse_obj( { "default": ( - ToneTouchType.from_dict(obj["default"]) + ToneTouchType.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [ToneTouchType.from_dict(_item) for _item in obj["range"]] + [ToneTouchType.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/tone_touch_x_feature.py b/python_client/mozart_api/models/tone_touch_x_feature.py index d4603b4..48c7576 100644 --- a/python_client/mozart_api/models/tone_touch_x_feature.py +++ b/python_client/mozart_api/models/tone_touch_x_feature.py @@ -18,62 +18,46 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.tone_touch_type import ToneTouchType -from typing import Optional, Set -from typing_extensions import Self class ToneTouchXFeature(BaseModel): """ ToneTouchXFeature - """ # noqa: E501 + """ - value: Union[StrictFloat, StrictInt] - default: ToneTouchType - range: List[ToneTouchType] = Field( - description="Product and role specific tone touch X or Y range" + value: Union[StrictFloat, StrictInt] = Field(...) + default: ToneTouchType = Field(...) + range: conlist(ToneTouchType, unique_items=True) = Field( + ..., description="Product and role specific tone touch X or Y range" ) - __properties: ClassVar[List[str]] = ["value", "default", "range"] + __properties = ["value", "default", "range"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ToneTouchXFeature: """Create an instance of ToneTouchXFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -87,24 +71,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ToneTouchXFeature: """Create an instance of ToneTouchXFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ToneTouchXFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = ToneTouchXFeature.parse_obj( { "value": obj.get("value"), "default": ( - ToneTouchType.from_dict(obj["default"]) + ToneTouchType.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [ToneTouchType.from_dict(_item) for _item in obj["range"]] + [ToneTouchType.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/tone_touch_y_feature.py b/python_client/mozart_api/models/tone_touch_y_feature.py index 0bb8d39..5f263a9 100644 --- a/python_client/mozart_api/models/tone_touch_y_feature.py +++ b/python_client/mozart_api/models/tone_touch_y_feature.py @@ -18,62 +18,46 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist from mozart_api.models.tone_touch_type import ToneTouchType -from typing import Optional, Set -from typing_extensions import Self class ToneTouchYFeature(BaseModel): """ ToneTouchYFeature - """ # noqa: E501 + """ - value: Union[StrictFloat, StrictInt] - default: ToneTouchType - range: List[ToneTouchType] = Field( - description="Product and role specific tone touch X or Y range" + value: Union[StrictFloat, StrictInt] = Field(...) + default: ToneTouchType = Field(...) + range: conlist(ToneTouchType, unique_items=True) = Field( + ..., description="Product and role specific tone touch X or Y range" ) - __properties: ClassVar[List[str]] = ["value", "default", "range"] + __properties = ["value", "default", "range"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> ToneTouchYFeature: """Create an instance of ToneTouchYFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -87,24 +71,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> ToneTouchYFeature: """Create an instance of ToneTouchYFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return ToneTouchYFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = ToneTouchYFeature.parse_obj( { "value": obj.get("value"), "default": ( - ToneTouchType.from_dict(obj["default"]) + ToneTouchType.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [ToneTouchType.from_dict(_item) for _item in obj["range"]] + [ToneTouchType.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/treble.py b/python_client/mozart_api/models/treble.py index 2f88370..8594083 100644 --- a/python_client/mozart_api/models/treble.py +++ b/python_client/mozart_api/models/treble.py @@ -18,67 +18,50 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self + +from pydantic import BaseModel, Field, StrictInt class Treble(BaseModel): """ Treble - """ # noqa: E501 + """ + + value: StrictInt = Field(..., description="Selected treble value") + __properties = ["value"] - value: StrictInt = Field(description="Selected treble value") - __properties: ClassVar[List[str]] = ["value"] + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Treble: """Create an instance of Treble from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Treble: """Create an instance of Treble from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Treble.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = Treble.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/treble_feature.py b/python_client/mozart_api/models/treble_feature.py index aa1b0e8..74b43fa 100644 --- a/python_client/mozart_api/models/treble_feature.py +++ b/python_client/mozart_api/models/treble_feature.py @@ -18,60 +18,46 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, StrictInt, conlist from mozart_api.models.treble import Treble -from typing import Optional, Set -from typing_extensions import Self class TrebleFeature(BaseModel): """ TrebleFeature - """ # noqa: E501 - - value: StrictInt = Field(description="Selected treble value") - default: Treble - range: List[Treble] = Field(description="Product and role specific treble range") - __properties: ClassVar[List[str]] = ["value", "default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + value: StrictInt = Field(..., description="Selected treble value") + default: Treble = Field(...) + range: conlist(Treble, unique_items=True) = Field( + ..., description="Product and role specific treble range" ) + __properties = ["value", "default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> TrebleFeature: """Create an instance of TrebleFeature from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -85,24 +71,24 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> TrebleFeature: """Create an instance of TrebleFeature from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return TrebleFeature.parse_obj(obj) - _obj = cls.model_validate( + _obj = TrebleFeature.parse_obj( { "value": obj.get("value"), "default": ( - Treble.from_dict(obj["default"]) + Treble.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Treble.from_dict(_item) for _item in obj["range"]] + [Treble.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/treble_range.py b/python_client/mozart_api/models/treble_range.py index 466e4a4..86a8e86 100644 --- a/python_client/mozart_api/models/treble_range.py +++ b/python_client/mozart_api/models/treble_range.py @@ -18,59 +18,45 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List + +from typing import List +from pydantic import BaseModel, Field, conlist from mozart_api.models.treble import Treble -from typing import Optional, Set -from typing_extensions import Self class TrebleRange(BaseModel): """ TrebleRange - """ # noqa: E501 - - default: Treble - range: List[Treble] = Field(description="Product and role specific treble range") - __properties: ClassVar[List[str]] = ["default", "range"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + default: Treble = Field(...) + range: conlist(Treble, unique_items=True) = Field( + ..., description="Product and role specific treble range" ) + __properties = ["default", "range"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> TrebleRange: """Create an instance of TrebleRange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -84,23 +70,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> TrebleRange: """Create an instance of TrebleRange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return TrebleRange.parse_obj(obj) - _obj = cls.model_validate( + _obj = TrebleRange.parse_obj( { "default": ( - Treble.from_dict(obj["default"]) + Treble.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "range": ( - [Treble.from_dict(_item) for _item in obj["range"]] + [Treble.from_dict(_item) for _item in obj.get("range")] if obj.get("range") is not None else None ), diff --git a/python_client/mozart_api/models/tv_info_event_data.py b/python_client/mozart_api/models/tv_info_event_data.py index ae091a4..cf9747f 100644 --- a/python_client/mozart_api/models/tv_info_event_data.py +++ b/python_client/mozart_api/models/tv_info_event_data.py @@ -18,76 +18,60 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel from mozart_api.models.tv_integration_types import TvIntegrationTypes -from typing import Optional, Set -from typing_extensions import Self class TvInfoEventData(BaseModel): """ TvInfoEventData - """ # noqa: E501 + """ integration: Optional[TvIntegrationTypes] = None - __properties: ClassVar[List[str]] = ["integration"] + __properties = ["integration"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> TvInfoEventData: """Create an instance of TvInfoEventData from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of integration if self.integration: _dict["integration"] = self.integration.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> TvInfoEventData: """Create an instance of TvInfoEventData from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return TvInfoEventData.parse_obj(obj) - _obj = cls.model_validate( + _obj = TvInfoEventData.parse_obj( { "integration": ( - TvIntegrationTypes.from_dict(obj["integration"]) + TvIntegrationTypes.from_dict(obj.get("integration")) if obj.get("integration") is not None else None ) diff --git a/python_client/mozart_api/models/tv_integration_types.py b/python_client/mozart_api/models/tv_integration_types.py index 80f2147..719e6f5 100644 --- a/python_client/mozart_api/models/tv_integration_types.py +++ b/python_client/mozart_api/models/tv_integration_types.py @@ -18,77 +18,61 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class TvIntegrationTypes(BaseModel): """ TvIntegrationTypes - """ # noqa: E501 + """ value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["ThirdParty", "Lge"]): + if value not in ("ThirdParty", "Lge"): raise ValueError("must be one of enum values ('ThirdParty', 'Lge')") return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> TvIntegrationTypes: """Create an instance of TvIntegrationTypes from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> TvIntegrationTypes: """Create an instance of TvIntegrationTypes from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return TvIntegrationTypes.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = TvIntegrationTypes.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/tv_properties.py b/python_client/mozart_api/models/tv_properties.py index a3c8a58..9e8f548 100644 --- a/python_client/mozart_api/models/tv_properties.py +++ b/python_client/mozart_api/models/tv_properties.py @@ -18,90 +18,74 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr from mozart_api.models.tv_integration_types import TvIntegrationTypes -from typing import Optional, Set -from typing_extensions import Self class TvProperties(BaseModel): """ TvProperties - """ # noqa: E501 + """ integration_supported: Optional[TvIntegrationTypes] = Field( - default=None, alias="integrationSupported" + None, alias="integrationSupported" ) name: Optional[StrictStr] = None year: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["integrationSupported", "name", "year"] + __properties = ["integrationSupported", "name", "year"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> TvProperties: """Create an instance of TvProperties from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of integration_supported if self.integration_supported: _dict["integrationSupported"] = self.integration_supported.to_dict() # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: + # and __fields_set__ contains the field + if self.name is None and "name" in self.__fields_set__: _dict["name"] = None # set to None if year (nullable) is None - # and model_fields_set contains the field - if self.year is None and "year" in self.model_fields_set: + # and __fields_set__ contains the field + if self.year is None and "year" in self.__fields_set__: _dict["year"] = None return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> TvProperties: """Create an instance of TvProperties from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return TvProperties.parse_obj(obj) - _obj = cls.model_validate( + _obj = TvProperties.parse_obj( { - "integrationSupported": ( - TvIntegrationTypes.from_dict(obj["integrationSupported"]) + "integration_supported": ( + TvIntegrationTypes.from_dict(obj.get("integrationSupported")) if obj.get("integrationSupported") is not None else None ), diff --git a/python_client/mozart_api/models/tv_sound_settings.py b/python_client/mozart_api/models/tv_sound_settings.py index d34adbe..979e497 100644 --- a/python_client/mozart_api/models/tv_sound_settings.py +++ b/python_client/mozart_api/models/tv_sound_settings.py @@ -18,76 +18,60 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel from mozart_api.models.lge_tv_sound_settings import LgeTvSoundSettings -from typing import Optional, Set -from typing_extensions import Self class TvSoundSettings(BaseModel): """ TvSoundSettings - """ # noqa: E501 + """ lge: Optional[LgeTvSoundSettings] = None - __properties: ClassVar[List[str]] = ["lge"] + __properties = ["lge"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> TvSoundSettings: """Create an instance of TvSoundSettings from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of lge if self.lge: _dict["lge"] = self.lge.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> TvSoundSettings: """Create an instance of TvSoundSettings from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return TvSoundSettings.parse_obj(obj) - _obj = cls.model_validate( + _obj = TvSoundSettings.parse_obj( { "lge": ( - LgeTvSoundSettings.from_dict(obj["lge"]) + LgeTvSoundSettings.from_dict(obj.get("lge")) if obj.get("lge") is not None else None ) diff --git a/python_client/mozart_api/models/tv_state.py b/python_client/mozart_api/models/tv_state.py index 8638da3..6e00c5d 100644 --- a/python_client/mozart_api/models/tv_state.py +++ b/python_client/mozart_api/models/tv_state.py @@ -18,64 +18,46 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field from mozart_api.models.tv_integration_types import TvIntegrationTypes from mozart_api.models.tv_properties import TvProperties from mozart_api.models.tv_sound_settings import TvSoundSettings -from typing import Optional, Set -from typing_extensions import Self class TvState(BaseModel): """ TvState - """ # noqa: E501 + """ integration: Optional[TvIntegrationTypes] = None - sound_settings: Optional[TvSoundSettings] = Field( - default=None, alias="soundSettings" - ) - tv_info: Optional[TvProperties] = Field(default=None, alias="tvInfo") - __properties: ClassVar[List[str]] = ["integration", "soundSettings", "tvInfo"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + sound_settings: Optional[TvSoundSettings] = Field(None, alias="soundSettings") + tv_info: Optional[TvProperties] = Field(None, alias="tvInfo") + __properties = ["integration", "soundSettings", "tvInfo"] + + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> TvState: """Create an instance of TvState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of integration if self.integration: _dict["integration"] = self.integration.to_dict() @@ -88,28 +70,28 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> TvState: """Create an instance of TvState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return TvState.parse_obj(obj) - _obj = cls.model_validate( + _obj = TvState.parse_obj( { "integration": ( - TvIntegrationTypes.from_dict(obj["integration"]) + TvIntegrationTypes.from_dict(obj.get("integration")) if obj.get("integration") is not None else None ), - "soundSettings": ( - TvSoundSettings.from_dict(obj["soundSettings"]) + "sound_settings": ( + TvSoundSettings.from_dict(obj.get("soundSettings")) if obj.get("soundSettings") is not None else None ), - "tvInfo": ( - TvProperties.from_dict(obj["tvInfo"]) + "tv_info": ( + TvProperties.from_dict(obj.get("tvInfo")) if obj.get("tvInfo") is not None else None ), diff --git a/python_client/mozart_api/models/uri.py b/python_client/mozart_api/models/uri.py index f42bc2a..8d090fb 100644 --- a/python_client/mozart_api/models/uri.py +++ b/python_client/mozart_api/models/uri.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr class Uri(BaseModel): """ Uri - """ # noqa: E501 + """ location: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["location"] + __properties = ["location"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> Uri: """Create an instance of Uri from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> Uri: """Create an instance of Uri from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return Uri.parse_obj(obj) - _obj = cls.model_validate({"location": obj.get("location")}) + _obj = Uri.parse_obj({"location": obj.get("location")}) return _obj diff --git a/python_client/mozart_api/models/user_flow.py b/python_client/mozart_api/models/user_flow.py index 90993c3..9bf9c69 100644 --- a/python_client/mozart_api/models/user_flow.py +++ b/python_client/mozart_api/models/user_flow.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class UserFlow(BaseModel): """ UserFlow - """ # noqa: E501 + """ + + user_id: Optional[StrictStr] = Field(None, alias="userId") + __properties = ["userId"] - user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> UserFlow: """Create an instance of UserFlow from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> UserFlow: """Create an instance of UserFlow from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return UserFlow.parse_obj(obj) - _obj = cls.model_validate({"userId": obj.get("userId")}) + _obj = UserFlow.parse_obj({"user_id": obj.get("userId")}) return _obj diff --git a/python_client/mozart_api/models/video_pixel_format.py b/python_client/mozart_api/models/video_pixel_format.py index e306266..1751dd4 100644 --- a/python_client/mozart_api/models/video_pixel_format.py +++ b/python_client/mozart_api/models/video_pixel_format.py @@ -18,139 +18,109 @@ import re # noqa: F401 import json -from pydantic import ( - BaseModel, - ConfigDict, - Field, - StrictBool, - StrictStr, - field_validator, -) -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, validator class VideoPixelFormat(BaseModel): """ VideoPixelFormat - """ # noqa: E501 + """ bitdepth: Optional[StrictStr] = None - chroma_subsample: Optional[StrictStr] = Field(default=None, alias="chromaSubsample") + chroma_subsample: Optional[StrictStr] = Field(None, alias="chromaSubsample") colorimetry: Optional[StrictStr] = None - full_range: Optional[StrictBool] = Field(default=None, alias="fullRange") - __properties: ClassVar[List[str]] = [ - "bitdepth", - "chromaSubsample", - "colorimetry", - "fullRange", - ] - - @field_validator("bitdepth") + full_range: Optional[StrictBool] = Field(None, alias="fullRange") + __properties = ["bitdepth", "chromaSubsample", "colorimetry", "fullRange"] + + @validator("bitdepth") def bitdepth_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["bit8", "bit10", "bit12"]): + if value not in ("bit8", "bit10", "bit12"): raise ValueError("must be one of enum values ('bit8', 'bit10', 'bit12')") return value - @field_validator("chroma_subsample") + @validator("chroma_subsample") def chroma_subsample_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(["yCbCr444RGB", "yCbCr422", "yCbCr420"]): + if value not in ("yCbCr444RGB", "yCbCr422", "yCbCr420"): raise ValueError( "must be one of enum values ('yCbCr444RGB', 'yCbCr422', 'yCbCr420')" ) return value - @field_validator("colorimetry") + @validator("colorimetry") def colorimetry_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "rGB", - "opRGB", - "rGBP3D65", - "rGBP3DCI", - "rGB2020", - "yCC601", - "yCC709", - "xvYCC601", - "xvYCC709", - "sYCC601", - "opYCC601", - "yCC2020NCL", - "yCC2020NL", - ] + if value not in ( + "rGB", + "opRGB", + "rGBP3D65", + "rGBP3DCI", + "rGB2020", + "yCC601", + "yCC709", + "xvYCC601", + "xvYCC709", + "sYCC601", + "opYCC601", + "yCC2020NCL", + "yCC2020NL", ): raise ValueError( "must be one of enum values ('rGB', 'opRGB', 'rGBP3D65', 'rGBP3DCI', 'rGB2020', 'yCC601', 'yCC709', 'xvYCC601', 'xvYCC709', 'sYCC601', 'opYCC601', 'yCC2020NCL', 'yCC2020NL')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> VideoPixelFormat: """Create an instance of VideoPixelFormat from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> VideoPixelFormat: """Create an instance of VideoPixelFormat from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return VideoPixelFormat.parse_obj(obj) - _obj = cls.model_validate( + _obj = VideoPixelFormat.parse_obj( { "bitdepth": obj.get("bitdepth"), - "chromaSubsample": obj.get("chromaSubsample"), + "chroma_subsample": obj.get("chromaSubsample"), "colorimetry": obj.get("colorimetry"), - "fullRange": obj.get("fullRange"), + "full_range": obj.get("fullRange"), } ) return _obj diff --git a/python_client/mozart_api/models/video_timings.py b/python_client/mozart_api/models/video_timings.py index 827eb96..f282469 100644 --- a/python_client/mozart_api/models/video_timings.py +++ b/python_client/mozart_api/models/video_timings.py @@ -18,88 +18,70 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional, Union +from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt class VideoTimings(BaseModel): """ VideoTimings - """ # noqa: E501 + """ horizontal_resolution: Optional[StrictInt] = Field( - default=None, alias="horizontalResolution" + None, alias="horizontalResolution" ) interlaced: Optional[StrictBool] = None refresh_rate: Optional[Union[StrictFloat, StrictInt]] = Field( - default=None, alias="refreshRate" - ) - vertical_resolution: Optional[StrictInt] = Field( - default=None, alias="verticalResolution" + None, alias="refreshRate" ) - __properties: ClassVar[List[str]] = [ + vertical_resolution: Optional[StrictInt] = Field(None, alias="verticalResolution") + __properties = [ "horizontalResolution", "interlaced", "refreshRate", "verticalResolution", ] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> VideoTimings: """Create an instance of VideoTimings from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> VideoTimings: """Create an instance of VideoTimings from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return VideoTimings.parse_obj(obj) - _obj = cls.model_validate( + _obj = VideoTimings.parse_obj( { - "horizontalResolution": obj.get("horizontalResolution"), + "horizontal_resolution": obj.get("horizontalResolution"), "interlaced": obj.get("interlaced"), - "refreshRate": obj.get("refreshRate"), - "verticalResolution": obj.get("verticalResolution"), + "refresh_rate": obj.get("refreshRate"), + "vertical_resolution": obj.get("verticalResolution"), } ) return _obj diff --git a/python_client/mozart_api/models/volume_level.py b/python_client/mozart_api/models/volume_level.py index 6b5b2fc..5b6cd86 100644 --- a/python_client/mozart_api/models/volume_level.py +++ b/python_client/mozart_api/models/volume_level.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictInt class VolumeLevel(BaseModel): """ VolumeLevel - """ # noqa: E501 + """ level: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["level"] + __properties = ["level"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> VolumeLevel: """Create an instance of VolumeLevel from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> VolumeLevel: """Create an instance of VolumeLevel from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return VolumeLevel.parse_obj(obj) - _obj = cls.model_validate({"level": obj.get("level")}) + _obj = VolumeLevel.parse_obj({"level": obj.get("level")}) return _obj diff --git a/python_client/mozart_api/models/volume_mute.py b/python_client/mozart_api/models/volume_mute.py index 1c6ceb0..77d7e33 100644 --- a/python_client/mozart_api/models/volume_mute.py +++ b/python_client/mozart_api/models/volume_mute.py @@ -18,67 +18,51 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictBool class VolumeMute(BaseModel): """ VolumeMute - """ # noqa: E501 + """ muted: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["muted"] + __properties = ["muted"] + + class Config: + """Pydantic configuration""" - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> VolumeMute: """Create an instance of VolumeMute from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> VolumeMute: """Create an instance of VolumeMute from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return VolumeMute.parse_obj(obj) - _obj = cls.model_validate({"muted": obj.get("muted")}) + _obj = VolumeMute.parse_obj({"muted": obj.get("muted")}) return _obj diff --git a/python_client/mozart_api/models/volume_settings.py b/python_client/mozart_api/models/volume_settings.py index 9aa94b5..6b8b5a3 100644 --- a/python_client/mozart_api/models/volume_settings.py +++ b/python_client/mozart_api/models/volume_settings.py @@ -18,59 +18,43 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel from mozart_api.models.volume_level import VolumeLevel -from typing import Optional, Set -from typing_extensions import Self class VolumeSettings(BaseModel): """ VolumeSettings - """ # noqa: E501 + """ default: Optional[VolumeLevel] = None maximum: Optional[VolumeLevel] = None - __properties: ClassVar[List[str]] = ["default", "maximum"] + __properties = ["default", "maximum"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> VolumeSettings: """Create an instance of VolumeSettings from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -80,23 +64,23 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> VolumeSettings: """Create an instance of VolumeSettings from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return VolumeSettings.parse_obj(obj) - _obj = cls.model_validate( + _obj = VolumeSettings.parse_obj( { "default": ( - VolumeLevel.from_dict(obj["default"]) + VolumeLevel.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "maximum": ( - VolumeLevel.from_dict(obj["maximum"]) + VolumeLevel.from_dict(obj.get("maximum")) if obj.get("maximum") is not None else None ), diff --git a/python_client/mozart_api/models/volume_state.py b/python_client/mozart_api/models/volume_state.py index b0f7895..7c09b0b 100644 --- a/python_client/mozart_api/models/volume_state.py +++ b/python_client/mozart_api/models/volume_state.py @@ -18,62 +18,46 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel from mozart_api.models.volume_level import VolumeLevel from mozart_api.models.volume_mute import VolumeMute -from typing import Optional, Set -from typing_extensions import Self class VolumeState(BaseModel): """ VolumeState - """ # noqa: E501 + """ default: Optional[VolumeLevel] = None level: Optional[VolumeLevel] = None maximum: Optional[VolumeLevel] = None muted: Optional[VolumeMute] = None - __properties: ClassVar[List[str]] = ["default", "level", "maximum", "muted"] + __properties = ["default", "level", "maximum", "muted"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> VolumeState: """Create an instance of VolumeState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of default if self.default: _dict["default"] = self.default.to_dict() @@ -89,33 +73,33 @@ def to_dict(self) -> Dict[str, Any]: return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> VolumeState: """Create an instance of VolumeState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return VolumeState.parse_obj(obj) - _obj = cls.model_validate( + _obj = VolumeState.parse_obj( { "default": ( - VolumeLevel.from_dict(obj["default"]) + VolumeLevel.from_dict(obj.get("default")) if obj.get("default") is not None else None ), "level": ( - VolumeLevel.from_dict(obj["level"]) + VolumeLevel.from_dict(obj.get("level")) if obj.get("level") is not None else None ), "maximum": ( - VolumeLevel.from_dict(obj["maximum"]) + VolumeLevel.from_dict(obj.get("maximum")) if obj.get("maximum") is not None else None ), "muted": ( - VolumeMute.from_dict(obj["muted"]) + VolumeMute.from_dict(obj.get("muted")) if obj.get("muted") is not None else None ), diff --git a/python_client/mozart_api/models/web_socket_event_active_hdmi_input_signal.py b/python_client/mozart_api/models/web_socket_event_active_hdmi_input_signal.py index ffbf033..81cd60c 100644 --- a/python_client/mozart_api/models/web_socket_event_active_hdmi_input_signal.py +++ b/python_client/mozart_api/models/web_socket_event_active_hdmi_input_signal.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.hdmi_input import HdmiInput -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventActiveHdmiInputSignal(BaseModel): """ WebSocketEventActiveHdmiInputSignal - """ # noqa: E501 + """ - event_data: Optional[HdmiInput] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[HdmiInput] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventActiveHdmiInputSignal: """Create an instance of WebSocketEventActiveHdmiInputSignal from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventActiveHdmiInputSignal: """Create an instance of WebSocketEventActiveHdmiInputSignal from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventActiveHdmiInputSignal.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventActiveHdmiInputSignal.parse_obj( { - "eventData": ( - HdmiInput.from_dict(obj["eventData"]) + "event_data": ( + HdmiInput.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_active_listening_mode.py b/python_client/mozart_api/models/web_socket_event_active_listening_mode.py index d70e42e..fb7449f 100644 --- a/python_client/mozart_api/models/web_socket_event_active_listening_mode.py +++ b/python_client/mozart_api/models/web_socket_event_active_listening_mode.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.listening_mode_props import ListeningModeProps -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventActiveListeningMode(BaseModel): """ WebSocketEventActiveListeningMode - """ # noqa: E501 + """ - event_data: Optional[ListeningModeProps] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[ListeningModeProps] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventActiveListeningMode: """Create an instance of WebSocketEventActiveListeningMode from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventActiveListeningMode: """Create an instance of WebSocketEventActiveListeningMode from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventActiveListeningMode.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventActiveListeningMode.parse_obj( { - "eventData": ( - ListeningModeProps.from_dict(obj["eventData"]) + "event_data": ( + ListeningModeProps.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_active_speaker_group.py b/python_client/mozart_api/models/web_socket_event_active_speaker_group.py index bacb4f0..9fd94fa 100644 --- a/python_client/mozart_api/models/web_socket_event_active_speaker_group.py +++ b/python_client/mozart_api/models/web_socket_event_active_speaker_group.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.speaker_group_overview import SpeakerGroupOverview -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventActiveSpeakerGroup(BaseModel): """ WebSocketEventActiveSpeakerGroup - """ # noqa: E501 + """ - event_data: Optional[SpeakerGroupOverview] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[SpeakerGroupOverview] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventActiveSpeakerGroup: """Create an instance of WebSocketEventActiveSpeakerGroup from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventActiveSpeakerGroup: """Create an instance of WebSocketEventActiveSpeakerGroup from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventActiveSpeakerGroup.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventActiveSpeakerGroup.parse_obj( { - "eventData": ( - SpeakerGroupOverview.from_dict(obj["eventData"]) + "event_data": ( + SpeakerGroupOverview.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_alarm_timer.py b/python_client/mozart_api/models/web_socket_event_alarm_timer.py index 18a02d8..aea9b54 100644 --- a/python_client/mozart_api/models/web_socket_event_alarm_timer.py +++ b/python_client/mozart_api/models/web_socket_event_alarm_timer.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.alarm_timer_event_data import AlarmTimerEventData -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventAlarmTimer(BaseModel): """ WebSocketEventAlarmTimer - """ # noqa: E501 + """ - event_data: Optional[AlarmTimerEventData] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[AlarmTimerEventData] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventAlarmTimer: """Create an instance of WebSocketEventAlarmTimer from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventAlarmTimer: """Create an instance of WebSocketEventAlarmTimer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventAlarmTimer.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventAlarmTimer.parse_obj( { - "eventData": ( - AlarmTimerEventData.from_dict(obj["eventData"]) + "event_data": ( + AlarmTimerEventData.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_alarm_triggered.py b/python_client/mozart_api/models/web_socket_event_alarm_triggered.py index 9f78ae6..0911487 100644 --- a/python_client/mozart_api/models/web_socket_event_alarm_triggered.py +++ b/python_client/mozart_api/models/web_socket_event_alarm_triggered.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.alarm_triggered_info import AlarmTriggeredInfo -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventAlarmTriggered(BaseModel): """ WebSocketEventAlarmTriggered - """ # noqa: E501 + """ - event_data: Optional[AlarmTriggeredInfo] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[AlarmTriggeredInfo] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventAlarmTriggered: """Create an instance of WebSocketEventAlarmTriggered from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventAlarmTriggered: """Create an instance of WebSocketEventAlarmTriggered from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventAlarmTriggered.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventAlarmTriggered.parse_obj( { - "eventData": ( - AlarmTriggeredInfo.from_dict(obj["eventData"]) + "event_data": ( + AlarmTriggeredInfo.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_battery.py b/python_client/mozart_api/models/web_socket_event_battery.py index bc32a78..50c05b0 100644 --- a/python_client/mozart_api/models/web_socket_event_battery.py +++ b/python_client/mozart_api/models/web_socket_event_battery.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.battery_state import BatteryState -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventBattery(BaseModel): """ WebSocketEventBattery - """ # noqa: E501 + """ - event_data: Optional[BatteryState] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[BatteryState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventBattery: """Create an instance of WebSocketEventBattery from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventBattery: """Create an instance of WebSocketEventBattery from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventBattery.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventBattery.parse_obj( { - "eventData": ( - BatteryState.from_dict(obj["eventData"]) + "event_data": ( + BatteryState.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_beo_remote_button.py b/python_client/mozart_api/models/web_socket_event_beo_remote_button.py index 1688fa7..b0dbc0a 100644 --- a/python_client/mozart_api/models/web_socket_event_beo_remote_button.py +++ b/python_client/mozart_api/models/web_socket_event_beo_remote_button.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.beo_remote_button import BeoRemoteButton -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventBeoRemoteButton(BaseModel): """ WebSocketEventBeoRemoteButton - """ # noqa: E501 + """ - event_data: Optional[BeoRemoteButton] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[BeoRemoteButton] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventBeoRemoteButton: """Create an instance of WebSocketEventBeoRemoteButton from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventBeoRemoteButton: """Create an instance of WebSocketEventBeoRemoteButton from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventBeoRemoteButton.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventBeoRemoteButton.parse_obj( { - "eventData": ( - BeoRemoteButton.from_dict(obj["eventData"]) + "event_data": ( + BeoRemoteButton.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_beolink_experiences_result.py b/python_client/mozart_api/models/web_socket_event_beolink_experiences_result.py index 040fe44..9a69825 100644 --- a/python_client/mozart_api/models/web_socket_event_beolink_experiences_result.py +++ b/python_client/mozart_api/models/web_socket_event_beolink_experiences_result.py @@ -18,81 +18,64 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List + +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.beolink_experiences_result import BeolinkExperiencesResult -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventBeolinkExperiencesResult(BaseModel): """ WebSocketEventBeolinkExperiencesResult - """ # noqa: E501 + """ - event_data: BeolinkExperiencesResult = Field(alias="eventData") - event_type: StrictStr = Field(alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: BeolinkExperiencesResult = Field(..., alias="eventData") + event_type: StrictStr = Field(..., alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventBeolinkExperiencesResult: """Create an instance of WebSocketEventBeolinkExperiencesResult from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventBeolinkExperiencesResult: """Create an instance of WebSocketEventBeolinkExperiencesResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventBeolinkExperiencesResult.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventBeolinkExperiencesResult.parse_obj( { - "eventData": ( - BeolinkExperiencesResult.from_dict(obj["eventData"]) + "event_data": ( + BeolinkExperiencesResult.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_beolink_join_result.py b/python_client/mozart_api/models/web_socket_event_beolink_join_result.py index 646ffd7..f7871f2 100644 --- a/python_client/mozart_api/models/web_socket_event_beolink_join_result.py +++ b/python_client/mozart_api/models/web_socket_event_beolink_join_result.py @@ -18,81 +18,64 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List + +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.beolink_join_result import BeolinkJoinResult -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventBeolinkJoinResult(BaseModel): """ WebSocketEventBeolinkJoinResult - """ # noqa: E501 + """ - event_data: BeolinkJoinResult = Field(alias="eventData") - event_type: StrictStr = Field(alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: BeolinkJoinResult = Field(..., alias="eventData") + event_type: StrictStr = Field(..., alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventBeolinkJoinResult: """Create an instance of WebSocketEventBeolinkJoinResult from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventBeolinkJoinResult: """Create an instance of WebSocketEventBeolinkJoinResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventBeolinkJoinResult.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventBeolinkJoinResult.parse_obj( { - "eventData": ( - BeolinkJoinResult.from_dict(obj["eventData"]) + "event_data": ( + BeolinkJoinResult.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_button.py b/python_client/mozart_api/models/web_socket_event_button.py index 04e7cf6..caa8c98 100644 --- a/python_client/mozart_api/models/web_socket_event_button.py +++ b/python_client/mozart_api/models/web_socket_event_button.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.button_event import ButtonEvent -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventButton(BaseModel): """ WebSocketEventButton - """ # noqa: E501 + """ - event_data: Optional[ButtonEvent] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[ButtonEvent] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventButton: """Create an instance of WebSocketEventButton from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventButton: """Create an instance of WebSocketEventButton from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventButton.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventButton.parse_obj( { - "eventData": ( - ButtonEvent.from_dict(obj["eventData"]) + "event_data": ( + ButtonEvent.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_curtains.py b/python_client/mozart_api/models/web_socket_event_curtains.py index a26e2b9..d4fe26c 100644 --- a/python_client/mozart_api/models/web_socket_event_curtains.py +++ b/python_client/mozart_api/models/web_socket_event_curtains.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.product_curtain_status import ProductCurtainStatus -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventCurtains(BaseModel): """ WebSocketEventCurtains - """ # noqa: E501 + """ - event_data: Optional[ProductCurtainStatus] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[ProductCurtainStatus] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventCurtains: """Create an instance of WebSocketEventCurtains from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventCurtains: """Create an instance of WebSocketEventCurtains from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventCurtains.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventCurtains.parse_obj( { - "eventData": ( - ProductCurtainStatus.from_dict(obj["eventData"]) + "event_data": ( + ProductCurtainStatus.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_hdmi_video_format_signal.py b/python_client/mozart_api/models/web_socket_event_hdmi_video_format_signal.py index 16da48a..da5de79 100644 --- a/python_client/mozart_api/models/web_socket_event_hdmi_video_format_signal.py +++ b/python_client/mozart_api/models/web_socket_event_hdmi_video_format_signal.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.hdmi_video_format import HdmiVideoFormat -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventHdmiVideoFormatSignal(BaseModel): """ WebSocketEventHdmiVideoFormatSignal - """ # noqa: E501 + """ - event_data: Optional[HdmiVideoFormat] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[HdmiVideoFormat] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventHdmiVideoFormatSignal: """Create an instance of WebSocketEventHdmiVideoFormatSignal from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventHdmiVideoFormatSignal: """Create an instance of WebSocketEventHdmiVideoFormatSignal from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventHdmiVideoFormatSignal.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventHdmiVideoFormatSignal.parse_obj( { - "eventData": ( - HdmiVideoFormat.from_dict(obj["eventData"]) + "event_data": ( + HdmiVideoFormat.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_notification.py b/python_client/mozart_api/models/web_socket_event_notification.py index ca7d555..dcfd640 100644 --- a/python_client/mozart_api/models/web_socket_event_notification.py +++ b/python_client/mozart_api/models/web_socket_event_notification.py @@ -18,83 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.websocket_notification_tag import WebsocketNotificationTag -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventNotification(BaseModel): """ - This telegram is used to send a tagged notification. - """ # noqa: E501 + This telegram is used to send a tagged notification. # noqa: E501 + """ - event_data: Optional[WebsocketNotificationTag] = Field( - default=None, alias="eventData" - ) - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[WebsocketNotificationTag] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventNotification: """Create an instance of WebSocketEventNotification from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventNotification: """Create an instance of WebSocketEventNotification from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventNotification.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventNotification.parse_obj( { - "eventData": ( - WebsocketNotificationTag.from_dict(obj["eventData"]) + "event_data": ( + WebsocketNotificationTag.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_playback_error.py b/python_client/mozart_api/models/web_socket_event_playback_error.py index fd3fca0..5bbbe3b 100644 --- a/python_client/mozart_api/models/web_socket_event_playback_error.py +++ b/python_client/mozart_api/models/web_socket_event_playback_error.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.playback_error import PlaybackError -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventPlaybackError(BaseModel): """ WebSocketEventPlaybackError - """ # noqa: E501 + """ - event_data: Optional[PlaybackError] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[PlaybackError] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventPlaybackError: """Create an instance of WebSocketEventPlaybackError from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventPlaybackError: """Create an instance of WebSocketEventPlaybackError from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventPlaybackError.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventPlaybackError.parse_obj( { - "eventData": ( - PlaybackError.from_dict(obj["eventData"]) + "event_data": ( + PlaybackError.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_playback_metadata.py b/python_client/mozart_api/models/web_socket_event_playback_metadata.py index bc5cf71..7485dbe 100644 --- a/python_client/mozart_api/models/web_socket_event_playback_metadata.py +++ b/python_client/mozart_api/models/web_socket_event_playback_metadata.py @@ -18,83 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.playback_content_metadata import PlaybackContentMetadata -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventPlaybackMetadata(BaseModel): """ WebSocketEventPlaybackMetadata - """ # noqa: E501 + """ - event_data: Optional[PlaybackContentMetadata] = Field( - default=None, alias="eventData" - ) - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[PlaybackContentMetadata] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventPlaybackMetadata: """Create an instance of WebSocketEventPlaybackMetadata from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventPlaybackMetadata: """Create an instance of WebSocketEventPlaybackMetadata from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventPlaybackMetadata.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventPlaybackMetadata.parse_obj( { - "eventData": ( - PlaybackContentMetadata.from_dict(obj["eventData"]) + "event_data": ( + PlaybackContentMetadata.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_playback_progress.py b/python_client/mozart_api/models/web_socket_event_playback_progress.py index b075d9e..589b2da 100644 --- a/python_client/mozart_api/models/web_socket_event_playback_progress.py +++ b/python_client/mozart_api/models/web_socket_event_playback_progress.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.playback_progress import PlaybackProgress -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventPlaybackProgress(BaseModel): """ WebSocketEventPlaybackProgress - """ # noqa: E501 + """ - event_data: Optional[PlaybackProgress] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[PlaybackProgress] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventPlaybackProgress: """Create an instance of WebSocketEventPlaybackProgress from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventPlaybackProgress: """Create an instance of WebSocketEventPlaybackProgress from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventPlaybackProgress.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventPlaybackProgress.parse_obj( { - "eventData": ( - PlaybackProgress.from_dict(obj["eventData"]) + "event_data": ( + PlaybackProgress.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_playback_source.py b/python_client/mozart_api/models/web_socket_event_playback_source.py index 51b9001..12f9161 100644 --- a/python_client/mozart_api/models/web_socket_event_playback_source.py +++ b/python_client/mozart_api/models/web_socket_event_playback_source.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.source import Source -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventPlaybackSource(BaseModel): """ WebSocketEventPlaybackSource - """ # noqa: E501 + """ - event_data: Optional[Source] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[Source] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventPlaybackSource: """Create an instance of WebSocketEventPlaybackSource from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventPlaybackSource: """Create an instance of WebSocketEventPlaybackSource from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventPlaybackSource.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventPlaybackSource.parse_obj( { - "eventData": ( - Source.from_dict(obj["eventData"]) + "event_data": ( + Source.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_playback_state.py b/python_client/mozart_api/models/web_socket_event_playback_state.py index 137df79..4fbc242 100644 --- a/python_client/mozart_api/models/web_socket_event_playback_state.py +++ b/python_client/mozart_api/models/web_socket_event_playback_state.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.rendering_state import RenderingState -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventPlaybackState(BaseModel): """ WebSocketEventPlaybackState - """ # noqa: E501 + """ - event_data: Optional[RenderingState] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[RenderingState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventPlaybackState: """Create an instance of WebSocketEventPlaybackState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventPlaybackState: """Create an instance of WebSocketEventPlaybackState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventPlaybackState.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventPlaybackState.parse_obj( { - "eventData": ( - RenderingState.from_dict(obj["eventData"]) + "event_data": ( + RenderingState.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_power_state.py b/python_client/mozart_api/models/web_socket_event_power_state.py index 86966b6..6abac38 100644 --- a/python_client/mozart_api/models/web_socket_event_power_state.py +++ b/python_client/mozart_api/models/web_socket_event_power_state.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.power_state_enum import PowerStateEnum -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventPowerState(BaseModel): """ WebSocketEventPowerState - """ # noqa: E501 + """ - event_data: Optional[PowerStateEnum] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[PowerStateEnum] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventPowerState: """Create an instance of WebSocketEventPowerState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventPowerState: """Create an instance of WebSocketEventPowerState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventPowerState.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventPowerState.parse_obj( { - "eventData": ( - PowerStateEnum.from_dict(obj["eventData"]) + "event_data": ( + PowerStateEnum.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_puc_install_remote_id_status.py b/python_client/mozart_api/models/web_socket_event_puc_install_remote_id_status.py index 7c8ddf5..f33c34a 100644 --- a/python_client/mozart_api/models/web_socket_event_puc_install_remote_id_status.py +++ b/python_client/mozart_api/models/web_socket_event_puc_install_remote_id_status.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.install_record_id_state import InstallRecordIdState -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventPucInstallRemoteIdStatus(BaseModel): """ WebSocketEventPucInstallRemoteIdStatus - """ # noqa: E501 + """ - event_data: Optional[InstallRecordIdState] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[InstallRecordIdState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventPucInstallRemoteIdStatus: """Create an instance of WebSocketEventPucInstallRemoteIdStatus from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventPucInstallRemoteIdStatus: """Create an instance of WebSocketEventPucInstallRemoteIdStatus from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventPucInstallRemoteIdStatus.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventPucInstallRemoteIdStatus.parse_obj( { - "eventData": ( - InstallRecordIdState.from_dict(obj["eventData"]) + "event_data": ( + InstallRecordIdState.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_role.py b/python_client/mozart_api/models/web_socket_event_role.py index dabaff1..8cf87f0 100644 --- a/python_client/mozart_api/models/web_socket_event_role.py +++ b/python_client/mozart_api/models/web_socket_event_role.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.speaker_role_enum import SpeakerRoleEnum -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventRole(BaseModel): """ WebSocketEventRole - """ # noqa: E501 + """ - event_data: Optional[SpeakerRoleEnum] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[SpeakerRoleEnum] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventRole: """Create an instance of WebSocketEventRole from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventRole: """Create an instance of WebSocketEventRole from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventRole.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventRole.parse_obj( { - "eventData": ( - SpeakerRoleEnum.from_dict(obj["eventData"]) + "event_data": ( + SpeakerRoleEnum.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_room_compensation_current_measurement_event.py b/python_client/mozart_api/models/web_socket_event_room_compensation_current_measurement_event.py index 96912c4..016de88 100644 --- a/python_client/mozart_api/models/web_socket_event_room_compensation_current_measurement_event.py +++ b/python_client/mozart_api/models/web_socket_event_room_compensation_current_measurement_event.py @@ -18,85 +18,73 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.room_compensation_current_measurement import ( RoomCompensationCurrentMeasurement, ) -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventRoomCompensationCurrentMeasurementEvent(BaseModel): """ - Sent when a room compensation measurement is started/done. Is only sent when room compensation type is advanced. - """ # noqa: E501 + Sent when a room compensation measurement is started/done. Is only sent when room compensation type is advanced. # noqa: E501 + """ event_data: Optional[RoomCompensationCurrentMeasurement] = Field( - default=None, alias="eventData" + None, alias="eventData" ) - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json( + cls, json_str: str + ) -> WebSocketEventRoomCompensationCurrentMeasurementEvent: """Create an instance of WebSocketEventRoomCompensationCurrentMeasurementEvent from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict( + cls, obj: dict + ) -> WebSocketEventRoomCompensationCurrentMeasurementEvent: """Create an instance of WebSocketEventRoomCompensationCurrentMeasurementEvent from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventRoomCompensationCurrentMeasurementEvent.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventRoomCompensationCurrentMeasurementEvent.parse_obj( { - "eventData": ( - RoomCompensationCurrentMeasurement.from_dict(obj["eventData"]) + "event_data": ( + RoomCompensationCurrentMeasurement.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_room_compensation_state.py b/python_client/mozart_api/models/web_socket_event_room_compensation_state.py index ad17880..d1b708c 100644 --- a/python_client/mozart_api/models/web_socket_event_room_compensation_state.py +++ b/python_client/mozart_api/models/web_socket_event_room_compensation_state.py @@ -18,83 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.room_compensation_state_value import RoomCompensationStateValue -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventRoomCompensationState(BaseModel): """ WebSocketEventRoomCompensationState - """ # noqa: E501 + """ - event_data: Optional[RoomCompensationStateValue] = Field( - default=None, alias="eventData" - ) - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[RoomCompensationStateValue] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventRoomCompensationState: """Create an instance of WebSocketEventRoomCompensationState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventRoomCompensationState: """Create an instance of WebSocketEventRoomCompensationState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventRoomCompensationState.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventRoomCompensationState.parse_obj( { - "eventData": ( - RoomCompensationStateValue.from_dict(obj["eventData"]) + "event_data": ( + RoomCompensationStateValue.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_software_update_state.py b/python_client/mozart_api/models/web_socket_event_software_update_state.py index 9374ff8..f360875 100644 --- a/python_client/mozart_api/models/web_socket_event_software_update_state.py +++ b/python_client/mozart_api/models/web_socket_event_software_update_state.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.software_update_state import SoftwareUpdateState -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventSoftwareUpdateState(BaseModel): """ WebSocketEventSoftwareUpdateState - """ # noqa: E501 + """ - event_data: Optional[SoftwareUpdateState] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[SoftwareUpdateState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventSoftwareUpdateState: """Create an instance of WebSocketEventSoftwareUpdateState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventSoftwareUpdateState: """Create an instance of WebSocketEventSoftwareUpdateState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventSoftwareUpdateState.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventSoftwareUpdateState.parse_obj( { - "eventData": ( - SoftwareUpdateState.from_dict(obj["eventData"]) + "event_data": ( + SoftwareUpdateState.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_sound_settings.py b/python_client/mozart_api/models/web_socket_event_sound_settings.py index fc72413..dad0d16 100644 --- a/python_client/mozart_api/models/web_socket_event_sound_settings.py +++ b/python_client/mozart_api/models/web_socket_event_sound_settings.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.sound_settings import SoundSettings -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventSoundSettings(BaseModel): """ WebSocketEventSoundSettings - """ # noqa: E501 + """ - event_data: Optional[SoundSettings] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[SoundSettings] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventSoundSettings: """Create an instance of WebSocketEventSoundSettings from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventSoundSettings: """Create an instance of WebSocketEventSoundSettings from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventSoundSettings.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventSoundSettings.parse_obj( { - "eventData": ( - SoundSettings.from_dict(obj["eventData"]) + "event_data": ( + SoundSettings.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_source_change.py b/python_client/mozart_api/models/web_socket_event_source_change.py index 2e7e203..2e9cf31 100644 --- a/python_client/mozart_api/models/web_socket_event_source_change.py +++ b/python_client/mozart_api/models/web_socket_event_source_change.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.source import Source -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventSourceChange(BaseModel): """ WebSocketEventSourceChange - """ # noqa: E501 + """ - event_data: Optional[Source] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[Source] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventSourceChange: """Create an instance of WebSocketEventSourceChange from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventSourceChange: """Create an instance of WebSocketEventSourceChange from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventSourceChange.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventSourceChange.parse_obj( { - "eventData": ( - Source.from_dict(obj["eventData"]) + "event_data": ( + Source.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_speaker_group_changed.py b/python_client/mozart_api/models/web_socket_event_speaker_group_changed.py index a78857d..bd97996 100644 --- a/python_client/mozart_api/models/web_socket_event_speaker_group_changed.py +++ b/python_client/mozart_api/models/web_socket_event_speaker_group_changed.py @@ -18,70 +18,54 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr class WebSocketEventSpeakerGroupChanged(BaseModel): """ WebSocketEventSpeakerGroupChanged - """ # noqa: E501 + """ - event_data: Optional[StrictStr] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[StrictStr] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventSpeakerGroupChanged: """Create an instance of WebSocketEventSpeakerGroupChanged from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventSpeakerGroupChanged: """Create an instance of WebSocketEventSpeakerGroupChanged from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventSpeakerGroupChanged.parse_obj(obj) - _obj = cls.model_validate( - {"eventData": obj.get("eventData"), "eventType": obj.get("eventType")} + _obj = WebSocketEventSpeakerGroupChanged.parse_obj( + {"event_data": obj.get("eventData"), "event_type": obj.get("eventType")} ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_speaker_link_status_changed.py b/python_client/mozart_api/models/web_socket_event_speaker_link_status_changed.py index e48f438..72ba492 100644 --- a/python_client/mozart_api/models/web_socket_event_speaker_link_status_changed.py +++ b/python_client/mozart_api/models/web_socket_event_speaker_link_status_changed.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.speaker_link_status import SpeakerLinkStatus -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventSpeakerLinkStatusChanged(BaseModel): """ WebSocketEventSpeakerLinkStatusChanged - """ # noqa: E501 + """ - event_data: Optional[SpeakerLinkStatus] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[SpeakerLinkStatus] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventSpeakerLinkStatusChanged: """Create an instance of WebSocketEventSpeakerLinkStatusChanged from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventSpeakerLinkStatusChanged: """Create an instance of WebSocketEventSpeakerLinkStatusChanged from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventSpeakerLinkStatusChanged.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventSpeakerLinkStatusChanged.parse_obj( { - "eventData": ( - SpeakerLinkStatus.from_dict(obj["eventData"]) + "event_data": ( + SpeakerLinkStatus.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_stand_connected.py b/python_client/mozart_api/models/web_socket_event_stand_connected.py index 8e093c5..58f6c2e 100644 --- a/python_client/mozart_api/models/web_socket_event_stand_connected.py +++ b/python_client/mozart_api/models/web_socket_event_stand_connected.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.stand_connected import StandConnected -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventStandConnected(BaseModel): """ WebSocketEventStandConnected - """ # noqa: E501 + """ - event_data: Optional[StandConnected] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[StandConnected] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventStandConnected: """Create an instance of WebSocketEventStandConnected from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventStandConnected: """Create an instance of WebSocketEventStandConnected from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventStandConnected.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventStandConnected.parse_obj( { - "eventData": ( - StandConnected.from_dict(obj["eventData"]) + "event_data": ( + StandConnected.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_stand_position.py b/python_client/mozart_api/models/web_socket_event_stand_position.py index 8aa8a5c..ea467dc 100644 --- a/python_client/mozart_api/models/web_socket_event_stand_position.py +++ b/python_client/mozart_api/models/web_socket_event_stand_position.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.stand_position import StandPosition -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventStandPosition(BaseModel): """ WebSocketEventStandPosition - """ # noqa: E501 + """ - event_data: Optional[StandPosition] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[StandPosition] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventStandPosition: """Create an instance of WebSocketEventStandPosition from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventStandPosition: """Create an instance of WebSocketEventStandPosition from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventStandPosition.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventStandPosition.parse_obj( { - "eventData": ( - StandPosition.from_dict(obj["eventData"]) + "event_data": ( + StandPosition.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_tv_info.py b/python_client/mozart_api/models/web_socket_event_tv_info.py index 872ac15..b91b977 100644 --- a/python_client/mozart_api/models/web_socket_event_tv_info.py +++ b/python_client/mozart_api/models/web_socket_event_tv_info.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.tv_info_event_data import TvInfoEventData -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventTvInfo(BaseModel): """ WebSocketEventTvInfo - """ # noqa: E501 + """ - event_data: Optional[TvInfoEventData] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[TvInfoEventData] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventTvInfo: """Create an instance of WebSocketEventTvInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventTvInfo: """Create an instance of WebSocketEventTvInfo from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventTvInfo.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventTvInfo.parse_obj( { - "eventData": ( - TvInfoEventData.from_dict(obj["eventData"]) + "event_data": ( + TvInfoEventData.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_volume.py b/python_client/mozart_api/models/web_socket_event_volume.py index 69f1e37..982f62f 100644 --- a/python_client/mozart_api/models/web_socket_event_volume.py +++ b/python_client/mozart_api/models/web_socket_event_volume.py @@ -18,81 +18,65 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.volume_state import VolumeState -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventVolume(BaseModel): """ WebSocketEventVolume - """ # noqa: E501 + """ - event_data: Optional[VolumeState] = Field(default=None, alias="eventData") - event_type: Optional[StrictStr] = Field(default=None, alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: Optional[VolumeState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventVolume: """Create an instance of WebSocketEventVolume from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventVolume: """Create an instance of WebSocketEventVolume from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventVolume.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventVolume.parse_obj( { - "eventData": ( - VolumeState.from_dict(obj["eventData"]) + "event_data": ( + VolumeState.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/web_socket_event_wisa_out_state.py b/python_client/mozart_api/models/web_socket_event_wisa_out_state.py index 9b10710..375d613 100644 --- a/python_client/mozart_api/models/web_socket_event_wisa_out_state.py +++ b/python_client/mozart_api/models/web_socket_event_wisa_out_state.py @@ -18,81 +18,64 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List + +from pydantic import BaseModel, Field, StrictStr from mozart_api.models.wisa_out_state import WisaOutState -from typing import Optional, Set -from typing_extensions import Self class WebSocketEventWisaOutState(BaseModel): """ - Speaker Discovery State changed - """ # noqa: E501 + Speaker Discovery State changed # noqa: E501 + """ - event_data: WisaOutState = Field(alias="eventData") - event_type: StrictStr = Field(alias="eventType") - __properties: ClassVar[List[str]] = ["eventData", "eventType"] + event_data: WisaOutState = Field(..., alias="eventData") + event_type: StrictStr = Field(..., alias="eventType") + __properties = ["eventData", "eventType"] - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebSocketEventWisaOutState: """Create an instance of WebSocketEventWisaOutState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) # override the default output from pydantic by calling `to_dict()` of event_data if self.event_data: _dict["eventData"] = self.event_data.to_dict() return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebSocketEventWisaOutState: """Create an instance of WebSocketEventWisaOutState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebSocketEventWisaOutState.parse_obj(obj) - _obj = cls.model_validate( + _obj = WebSocketEventWisaOutState.parse_obj( { - "eventData": ( - WisaOutState.from_dict(obj["eventData"]) + "event_data": ( + WisaOutState.from_dict(obj.get("eventData")) if obj.get("eventData") is not None else None ), - "eventType": obj.get("eventType"), + "event_type": obj.get("eventType"), } ) return _obj diff --git a/python_client/mozart_api/models/websocket_notification_tag.py b/python_client/mozart_api/models/websocket_notification_tag.py index e50180a..f6c11c9 100644 --- a/python_client/mozart_api/models/websocket_notification_tag.py +++ b/python_client/mozart_api/models/websocket_notification_tag.py @@ -18,100 +18,82 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class WebsocketNotificationTag(BaseModel): """ WebsocketNotificationTag - """ # noqa: E501 + """ value: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["value"] + __properties = ["value"] - @field_validator("value") + @validator("value") def value_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - [ - "configuration", - "uri", - "generatorSettings", - "lineInSettings", - "bluetoothDevices", - "remoteControlDevices", - "secondariesList", - "queueHasBeenChanged", - "endOfQueueHasBeenReached", - "beolinkPeers", - "beolinkListeners", - "beolinkAvailableListeners", - "bluetoothPairingStateChanged", - "outputsChanged", - "speakerGroupOverviewChanged", - "remoteMenuChanged", - "proximityPresenceDetected", - "proximityPresenceNotDetected", - ] + if value not in ( + "configuration", + "uri", + "generatorSettings", + "lineInSettings", + "bluetoothDevices", + "remoteControlDevices", + "secondariesList", + "queueHasBeenChanged", + "endOfQueueHasBeenReached", + "beolinkPeers", + "beolinkListeners", + "beolinkAvailableListeners", + "bluetoothPairingStateChanged", + "outputsChanged", + "speakerGroupOverviewChanged", + "remoteMenuChanged", + "proximityPresenceDetected", + "proximityPresenceNotDetected", ): raise ValueError( "must be one of enum values ('configuration', 'uri', 'generatorSettings', 'lineInSettings', 'bluetoothDevices', 'remoteControlDevices', 'secondariesList', 'queueHasBeenChanged', 'endOfQueueHasBeenReached', 'beolinkPeers', 'beolinkListeners', 'beolinkAvailableListeners', 'bluetoothPairingStateChanged', 'outputsChanged', 'speakerGroupOverviewChanged', 'remoteMenuChanged', 'proximityPresenceDetected', 'proximityPresenceNotDetected')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WebsocketNotificationTag: """Create an instance of WebsocketNotificationTag from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WebsocketNotificationTag: """Create an instance of WebsocketNotificationTag from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WebsocketNotificationTag.parse_obj(obj) - _obj = cls.model_validate({"value": obj.get("value")}) + _obj = WebsocketNotificationTag.parse_obj({"value": obj.get("value")}) return _obj diff --git a/python_client/mozart_api/models/wisa_out_state.py b/python_client/mozart_api/models/wisa_out_state.py index f0a657d..b45f70b 100644 --- a/python_client/mozart_api/models/wisa_out_state.py +++ b/python_client/mozart_api/models/wisa_out_state.py @@ -18,81 +18,63 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator class WisaOutState(BaseModel): """ WisaOutState - """ # noqa: E501 + """ state: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["state"] + __properties = ["state"] - @field_validator("state") + @validator("state") def state_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set( - ["idle", "discovering", "deleting", "updatingSpeakerFirmware"] - ): + if value not in ("idle", "discovering", "deleting", "updatingSpeakerFirmware"): raise ValueError( "must be one of enum values ('idle', 'discovering', 'deleting', 'updatingSpeakerFirmware')" ) return value - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) + class Config: + """Pydantic configuration""" + + allow_population_by_field_name = True + validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) + return pprint.pformat(self.dict(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: + def from_json(cls, json_str: str) -> WisaOutState: """Create an instance of WisaOutState from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) return _dict @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + def from_dict(cls, obj: dict) -> WisaOutState: """Create an instance of WisaOutState from a dict""" if obj is None: return None if not isinstance(obj, dict): - return cls.model_validate(obj) + return WisaOutState.parse_obj(obj) - _obj = cls.model_validate({"state": obj.get("state")}) + _obj = WisaOutState.parse_obj({"state": obj.get("state")}) return _obj diff --git a/python_client/mozart_api/mozart_client.py b/python_client/mozart_api/mozart_client.py index ff8faba..fd701bf 100644 --- a/python_client/mozart_api/mozart_client.py +++ b/python_client/mozart_api/mozart_client.py @@ -1,6 +1,6 @@ """Helper classes for using auto-generated API.""" -# pylint: disable=line-too-long too-many-instance-attributes too-many-public-methods protected-access +# pylint: disable=line-too-long too-many-instance-attributes too-many-public-methods import asyncio import contextlib diff --git a/python_client/mozart_api/rest.py b/python_client/mozart_api/rest.py index 77ef9b3..df4b1b6 100644 --- a/python_client/mozart_api/rest.py +++ b/python_client/mozart_api/rest.py @@ -15,48 +15,42 @@ import io import json +import logging import re import ssl -from typing import Optional, Union import aiohttp -import aiohttp_retry +from urllib.parse import urlencode, quote_plus from mozart_api.exceptions import ApiException, ApiValueError -RESTResponseType = aiohttp.ClientResponse - -ALLOW_RETRY_METHODS = frozenset({"DELETE", "GET", "HEAD", "OPTIONS", "PUT", "TRACE"}) +logger = logging.getLogger(__name__) class RESTResponse(io.IOBase): - def __init__(self, resp) -> None: - self.response = resp + def __init__(self, resp, data) -> None: + self.aiohttp_response = resp self.status = resp.status self.reason = resp.reason - self.data = None - - async def read(self): - if self.data is None: - self.data = await self.response.read() - return self.data + self.data = data def getheaders(self): """Returns a CIMultiDictProxy of the response headers.""" - return self.response.headers + return self.aiohttp_response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.response.headers.get(name, default) + return self.aiohttp_response.headers.get(name, default) class RESTClientObject: - def __init__(self, configuration) -> None: + def __init__(self, configuration, pools_size=4, maxsize=None) -> None: # maxsize is number of requests to host that are allowed in parallel - maxsize = configuration.connection_pool_maxsize + if maxsize is None: + maxsize = configuration.connection_pool_maxsize ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) if configuration.cert_file: @@ -76,41 +70,32 @@ def __init__(self, configuration) -> None: # https pool manager self.pool_manager = aiohttp.ClientSession(connector=connector, trust_env=True) - retries = configuration.retries - self.retry_client: Optional[aiohttp_retry.RetryClient] - if retries is not None: - self.retry_client = aiohttp_retry.RetryClient( - client_session=self.pool_manager, - retry_options=aiohttp_retry.ExponentialRetry( - attempts=retries, factor=0.0, start_timeout=0.0, max_timeout=120.0 - ), - ) - else: - self.retry_client = None - async def close(self): await self.pool_manager.close() - if self.retry_client is not None: - await self.retry_client.close() async def request( self, method, url, + query_params=None, headers=None, body=None, post_params=None, + _preload_content=True, _request_timeout=None, ): """Execute request :param method: http request method :param url: http request url + :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` + :param _preload_content: this is a non-applicable field for + the AiohttpClient. :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 @@ -127,6 +112,8 @@ async def request( post_params = post_params or {} headers = headers or {} # url already contains the URL query string + # so reset query_params to empty dict + query_params = {} timeout = _request_timeout or 5 * 60 if "Content-Type" not in headers: @@ -139,13 +126,18 @@ async def request( if self.proxy_headers: args["proxy_headers"] = self.proxy_headers + if query_params: + args["url"] += "?" + urlencode(query_params) + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: if re.search("json", headers["Content-Type"], re.IGNORECASE): if body is not None: body = json.dumps(body) args["data"] = body - elif headers["Content-Type"] == "application/x-www-form-urlencoded": + elif ( + headers["Content-Type"] == "application/x-www-form-urlencoded" + ): # noqa: E501 args["data"] = aiohttp.FormData(post_params) elif headers["Content-Type"] == "multipart/form-data": # must del headers['Content-Type'], or the correct @@ -172,12 +164,153 @@ async def request( declared content type.""" raise ApiException(status=0, reason=msg) - pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient] - if self.retry_client is not None and method in ALLOW_RETRY_METHODS: - pool_manager = self.retry_client - else: - pool_manager = self.pool_manager + r = await self.pool_manager.request(**args) + if _preload_content: + + data = await r.read() + r = RESTResponse(r, data) + + # log response body + logger.debug("response body: %s", r.data) - r = await pool_manager.request(**args) + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) - return RESTResponse(r) + return r + + async def get_request( + self, + url, + headers=None, + query_params=None, + _preload_content=True, + _request_timeout=None, + ): + return await self.request( + "GET", + url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params, + ) + + async def head_request( + self, + url, + headers=None, + query_params=None, + _preload_content=True, + _request_timeout=None, + ): + return await self.request( + "HEAD", + url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params, + ) + + async def options_request( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return await self.request( + "OPTIONS", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + async def delete_request( + self, + url, + headers=None, + query_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return await self.request( + "DELETE", + url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + async def post_request( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return await self.request( + "POST", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + async def put_request( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return await self.request( + "PUT", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + async def patch_request( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return await self.request( + "PATCH", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) diff --git a/python_client/pyproject.toml b/python_client/pyproject.toml index e173cfd..8f2eb6f 100644 --- a/python_client/pyproject.toml +++ b/python_client/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mozart_api" -version = "3.4.1.8.2" +version = "3.4.1.8.3" description = "Mozart platform API" authors = [ "BangOlufsen ", @@ -33,11 +33,11 @@ exclude = [ urllib3 = ">= 1.25.3" python-dateutil = ">=2.8.2" aiohttp = ">=3.8.3" -aiohttp-retry = ">= 2.8.3" -pydantic = ">=2" -typing-extensions = ">=4.7.1" +pydantic = "^1.10.5, <2" +aenum = ">=3.1.11" aioconsole = ">=0.4.1" inflection = ">=0.5.1" +typing-extensions = ">=4.7.1" zeroconf = ">=0.25.1" websockets = ">=12.0" python = ">=3.11" @@ -46,8 +46,6 @@ python = ">=3.11" pytest = ">=7.2.1" tox = ">=3.9.0" flake8 = ">=4.0.0" -types-python-dateutil = ">=2.8.19.14" -mypy = "1.4.1" [tool.poetry.urls] "Bug Tracker" = "https://github.com/bang-olufsen/mozart-open-api/issues" @@ -58,21 +56,6 @@ mozart_api = "mozart_api.mozart_cli:MozartApiCli" [tool.pylint."MESSAGES CONTROL"] extension-pkg-whitelist = "pydantic" -[tool.mypy] -files = [ - "mozart_api", - "tests", -] -warn_unused_configs = true -warn_redundant_casts = true -warn_unused_ignores = true -strict_equality = true -strict_concatenate = true -check_untyped_defs = true -disallow_subclassing_any = true -disallow_untyped_decorators = true -disallow_any_generics = true - [build-system] requires = [ "poetry-core",