diff --git a/python_client/LICENSE b/python_client/LICENSE new file mode 100755 index 0000000..175422d --- /dev/null +++ b/python_client/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Bang & Olufsen a/s + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/python_client/PKG-INFO b/python_client/PKG-INFO new file mode 100644 index 0000000..a803f23 --- /dev/null +++ b/python_client/PKG-INFO @@ -0,0 +1,59 @@ +Metadata-Version: 2.1 +Name: mozart_api +Version: 3.2.1.150.6 +Summary: Mozart platform API +Home-page: https://pypi.org/project/mozart-api/ +License: MIT +Keywords: OpenAPI,OpenAPI-Generator,Mozart platform API +Author: BangOlufsen +Author-email: support@bang-olufsen.dk +Requires-Python: >=3.8 +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +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: inflection (>=0.5.1) +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) +Requires-Dist: zeroconf (>=0.25.1) +Project-URL: Bug Tracker, https://github.com/bang-olufsen/mozart-open-api/issues +Project-URL: Documentation, https://bang-olufsen.github.io/mozart-open-api/ +Project-URL: Repository, https://github.com/bang-olufsen/mozart-open-api +Description-Content-Type: text/markdown + +# Mozart platform API + +[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/bang-olufsen/mozart-open-api/blob/main/LICENSE) +[![Version](https://img.shields.io/pypi/v/mozart-api?color=g)](https://pypi.org/project/mozart-api) +[![Downloads](https://img.shields.io/pypi/dm/mozart-api)](https://pypi.org/project/mozart-api) +![Python version](https://img.shields.io/pypi/pyversions/mozart-api) + +[![Balance stereo](https://raw.githubusercontent.com/bang-olufsen/mozart-open-api/main/docs/media/balance_stereo.png)](https://www.bang-olufsen.com/en/dk/speakers/beosound-balance-stereo-set?variant=beosound-balance-gva-naturaloak-bundle) + +The Mozart API is an async REST API with WebSocket notification channel for immediate state information from Mozart devices. Currently the API is distributed as a [Python package](https://pypi.org/project/mozart-api) and as an OpenAPI document that can be found in the [Github releases](https://github.com/bang-olufsen/mozart-open-api/releases). + +Supported by: + +- [Beolab 8](https://www.bang-olufsen.com/en/dk/speakers/beolab-8) +- [Beolab 28](https://www.bang-olufsen.com/en/dk/speakers/beolab-28) +- [Beosound 2 3rd gen](https://www.bang-olufsen.com/en/dk/speakers/beosound-2) +- [Beosound A5](https://www.bang-olufsen.com/en/dk/speakers/beosound-a5) +- [Beosound A9 5th gen](https://www.bang-olufsen.com/en/dk/speakers/beosound-a9) +- [Beosound Balance](https://www.bang-olufsen.com/en/dk/speakers/beosound-balance) +- [Beosound Emerge](https://www.bang-olufsen.com/en/dk/speakers/beosound-emerge) +- [Beosound Level](https://www.bang-olufsen.com/en/dk/speakers/beosound-level) +- [Beosound Theatre](https://www.bang-olufsen.com/en/dk/soundbars/beosound-theatre) + +API documentation can be found on the [Github page](https://bang-olufsen.github.io/mozart-open-api). + diff --git a/python_client/README.md b/python_client/README.md new file mode 100644 index 0000000..1ee1250 --- /dev/null +++ b/python_client/README.md @@ -0,0 +1,24 @@ +# Mozart platform API + +[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/bang-olufsen/mozart-open-api/blob/main/LICENSE) +[![Version](https://img.shields.io/pypi/v/mozart-api?color=g)](https://pypi.org/project/mozart-api) +[![Downloads](https://img.shields.io/pypi/dm/mozart-api)](https://pypi.org/project/mozart-api) +![Python version](https://img.shields.io/pypi/pyversions/mozart-api) + +[![Balance stereo](https://raw.githubusercontent.com/bang-olufsen/mozart-open-api/main/docs/media/balance_stereo.png)](https://www.bang-olufsen.com/en/dk/speakers/beosound-balance-stereo-set?variant=beosound-balance-gva-naturaloak-bundle) + +The Mozart API is an async REST API with WebSocket notification channel for immediate state information from Mozart devices. Currently the API is distributed as a [Python package](https://pypi.org/project/mozart-api) and as an OpenAPI document that can be found in the [Github releases](https://github.com/bang-olufsen/mozart-open-api/releases). + +Supported by: + +- [Beolab 8](https://www.bang-olufsen.com/en/dk/speakers/beolab-8) +- [Beolab 28](https://www.bang-olufsen.com/en/dk/speakers/beolab-28) +- [Beosound 2 3rd gen](https://www.bang-olufsen.com/en/dk/speakers/beosound-2) +- [Beosound A5](https://www.bang-olufsen.com/en/dk/speakers/beosound-a5) +- [Beosound A9 5th gen](https://www.bang-olufsen.com/en/dk/speakers/beosound-a9) +- [Beosound Balance](https://www.bang-olufsen.com/en/dk/speakers/beosound-balance) +- [Beosound Emerge](https://www.bang-olufsen.com/en/dk/speakers/beosound-emerge) +- [Beosound Level](https://www.bang-olufsen.com/en/dk/speakers/beosound-level) +- [Beosound Theatre](https://www.bang-olufsen.com/en/dk/soundbars/beosound-theatre) + +API documentation can be found on the [Github page](https://bang-olufsen.github.io/mozart-open-api). diff --git a/python_client/mozart_api/__init__.py b/python_client/mozart_api/__init__.py new file mode 100644 index 0000000..379eb47 --- /dev/null +++ b/python_client/mozart_api/__init__.py @@ -0,0 +1,293 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "3.2.1.150.6" + +# import apis into sdk package +from mozart_api.api.beolink_api import BeolinkApi +from mozart_api.api.bluetooth_api import BluetoothApi +from mozart_api.api.content_api import ContentApi +from mozart_api.api.deezer_api import DeezerApi +from mozart_api.api.overlay_api import OverlayApi +from mozart_api.api.playback_api import PlaybackApi +from mozart_api.api.power_api import PowerApi +from mozart_api.api.product_api import ProductApi +from mozart_api.api.remote_api import RemoteApi +from mozart_api.api.scenes_api import ScenesApi +from mozart_api.api.settings_api import SettingsApi +from mozart_api.api.software_update_api import SoftwareUpdateApi +from mozart_api.api.sound_api import SoundApi +from mozart_api.api.speaker_group_api import SpeakerGroupApi +from mozart_api.api.mozart_api import MozartApi + +# import ApiClient +from mozart_api.api_response import ApiResponse +from mozart_api.api_client import ApiClient +from mozart_api.configuration import Configuration +from mozart_api.exceptions import OpenApiException +from mozart_api.exceptions import ApiTypeError +from mozart_api.exceptions import ApiValueError +from mozart_api.exceptions import ApiKeyError +from mozart_api.exceptions import ApiAttributeError +from mozart_api.exceptions import ApiException + +# import models into sdk package +from mozart_api.models.action import Action +from mozart_api.models.alarm_timer_event_data import AlarmTimerEventData +from mozart_api.models.alarm_triggered_info import AlarmTriggeredInfo +from mozart_api.models.ambience import Ambience +from mozart_api.models.ambience_feature import AmbienceFeature +from mozart_api.models.ambience_range import AmbienceRange +from mozart_api.models.art import Art +from mozart_api.models.balance import Balance +from mozart_api.models.balance_feature import BalanceFeature +from mozart_api.models.balance_range import BalanceRange +from mozart_api.models.bass import Bass +from mozart_api.models.bass_feature import BassFeature +from mozart_api.models.bass_management import BassManagement +from mozart_api.models.bass_management_feature import BassManagementFeature +from mozart_api.models.bass_management_range import BassManagementRange +from mozart_api.models.bass_range import BassRange +from mozart_api.models.battery_state import BatteryState +from mozart_api.models.beo_remote_button import BeoRemoteButton +from mozart_api.models.beolink_available_listener import BeolinkAvailableListener +from mozart_api.models.beolink_experience import BeolinkExperience +from mozart_api.models.beolink_experiences_request import BeolinkExperiencesRequest +from mozart_api.models.beolink_experiences_result import BeolinkExperiencesResult +from mozart_api.models.beolink_join_request import BeolinkJoinRequest +from mozart_api.models.beolink_join_result import BeolinkJoinResult +from mozart_api.models.beolink_leader import BeolinkLeader +from mozart_api.models.beolink_listener import BeolinkListener +from mozart_api.models.beolink_peer import BeolinkPeer +from mozart_api.models.bluetooth_device import BluetoothDevice +from mozart_api.models.bluetooth_device_list import BluetoothDeviceList +from mozart_api.models.button_event import ButtonEvent +from mozart_api.models.compression import Compression +from mozart_api.models.compression_feature import CompressionFeature +from mozart_api.models.compression_range import CompressionRange +from mozart_api.models.content_item import ContentItem +from mozart_api.models.directivity import Directivity +from mozart_api.models.directivity_feature import DirectivityFeature +from mozart_api.models.directivity_range import DirectivityRange +from mozart_api.models.error_model import ErrorModel +from mozart_api.models.fader import Fader +from mozart_api.models.fader_feature import FaderFeature +from mozart_api.models.fader_range import FaderRange +from mozart_api.models.hdmi_input import HdmiInput +from mozart_api.models.hdmi_video_format import HdmiVideoFormat +from mozart_api.models.home_control_uri import HomeControlUri +from mozart_api.models.install_record_id_state import InstallRecordIdState +from mozart_api.models.latency_profile import LatencyProfile +from mozart_api.models.lge_tv_sound_settings import LgeTvSoundSettings +from mozart_api.models.listening_mode import ListeningMode +from mozart_api.models.listening_mode_features import ListeningModeFeatures +from mozart_api.models.listening_mode_props import ListeningModeProps +from mozart_api.models.listening_mode_ref import ListeningModeRef +from mozart_api.models.listening_mode_trigger import ListeningModeTrigger +from mozart_api.models.loudness import Loudness +from mozart_api.models.microphone_state import MicrophoneState +from mozart_api.models.microphones_state import MicrophonesState +from mozart_api.models.overlay_play_request import OverlayPlayRequest +from mozart_api.models.overlay_play_request_common import OverlayPlayRequestCommon +from mozart_api.models.overlay_play_request_from_usb import OverlayPlayRequestFromUsb +from mozart_api.models.overlay_play_request_from_usb_from_usb import ( + OverlayPlayRequestFromUsbFromUsb, +) +from mozart_api.models.overlay_play_request_text_to_speech import ( + OverlayPlayRequestTextToSpeech, +) +from mozart_api.models.overlay_play_request_text_to_speech_text_to_speech import ( + OverlayPlayRequestTextToSpeechTextToSpeech, +) +from mozart_api.models.overlay_play_request_uri import OverlayPlayRequestUri +from mozart_api.models.paired_remote import PairedRemote +from mozart_api.models.paired_remote_response import PairedRemoteResponse +from mozart_api.models.play_queue_item import PlayQueueItem +from mozart_api.models.play_queue_item_type import PlayQueueItemType +from mozart_api.models.play_queue_settings import PlayQueueSettings +from mozart_api.models.playback_content_metadata import PlaybackContentMetadata +from mozart_api.models.playback_error import PlaybackError +from mozart_api.models.playback_progress import PlaybackProgress +from mozart_api.models.playback_state import PlaybackState +from mozart_api.models.power_link_trigger import PowerLinkTrigger +from mozart_api.models.power_state_enum import PowerStateEnum +from mozart_api.models.preset import Preset +from mozart_api.models.product_curtain_status import ProductCurtainStatus +from mozart_api.models.product_friendly_name import ProductFriendlyName +from mozart_api.models.product_state import ProductState +from mozart_api.models.remote_menu_item import RemoteMenuItem +from mozart_api.models.remote_menu_item_properties import RemoteMenuItemProperties +from mozart_api.models.remote_ui_key_state import RemoteUIKeyState +from mozart_api.models.rendering_state import RenderingState +from mozart_api.models.room_compensation import RoomCompensation +from mozart_api.models.room_compensation_current_measurement import ( + RoomCompensationCurrentMeasurement, +) +from mozart_api.models.room_compensation_debug import RoomCompensationDebug +from mozart_api.models.room_compensation_enabled import RoomCompensationEnabled +from mozart_api.models.room_compensation_error_details import ( + RoomCompensationErrorDetails, +) +from mozart_api.models.room_compensation_feature import RoomCompensationFeature +from mozart_api.models.room_compensation_info import RoomCompensationInfo +from mozart_api.models.room_compensation_measurement_error import ( + RoomCompensationMeasurementError, +) +from mozart_api.models.room_compensation_properties import RoomCompensationProperties +from mozart_api.models.room_compensation_range import RoomCompensationRange +from mozart_api.models.room_compensation_response import RoomCompensationResponse +from mozart_api.models.room_compensation_result import RoomCompensationResult +from mozart_api.models.room_compensation_state import RoomCompensationState +from mozart_api.models.room_compensation_state_value import RoomCompensationStateValue +from mozart_api.models.room_compensation_type import RoomCompensationType +from mozart_api.models.room_compensation_version import RoomCompensationVersion +from mozart_api.models.scene import Scene +from mozart_api.models.scene_classification import SceneClassification +from mozart_api.models.scene_match import SceneMatch +from mozart_api.models.scene_properties import SceneProperties +from mozart_api.models.scene_trigger_base_properties import SceneTriggerBaseProperties +from mozart_api.models.software_update_state import SoftwareUpdateState +from mozart_api.models.software_update_status import SoftwareUpdateStatus +from mozart_api.models.sound_adjustments import SoundAdjustments +from mozart_api.models.sound_feature_set import SoundFeatureSet +from mozart_api.models.sound_settings import SoundSettings +from mozart_api.models.sound_tone_touch import SoundToneTouch +from mozart_api.models.source import Source +from mozart_api.models.source_array import SourceArray +from mozart_api.models.source_type_enum import SourceTypeEnum +from mozart_api.models.spatial_envelopment import SpatialEnvelopment +from mozart_api.models.spatial_envelopment_feature import SpatialEnvelopmentFeature +from mozart_api.models.spatial_envelopment_range import SpatialEnvelopmentRange +from mozart_api.models.spatial_height import SpatialHeight +from mozart_api.models.spatial_height_feature import SpatialHeightFeature +from mozart_api.models.spatial_height_range import SpatialHeightRange +from mozart_api.models.spatial_processing import SpatialProcessing +from mozart_api.models.spatial_processing_feature import SpatialProcessingFeature +from mozart_api.models.spatial_processing_range import SpatialProcessingRange +from mozart_api.models.spatial_surround import SpatialSurround +from mozart_api.models.spatial_surround_feature import SpatialSurroundFeature +from mozart_api.models.spatial_surround_range import SpatialSurroundRange +from mozart_api.models.spatial_width import SpatialWidth +from mozart_api.models.spatial_width_feature import SpatialWidthFeature +from mozart_api.models.spatial_width_range import SpatialWidthRange +from mozart_api.models.speaker_group import SpeakerGroup +from mozart_api.models.speaker_group_member import SpeakerGroupMember +from mozart_api.models.speaker_group_member_location import SpeakerGroupMemberLocation +from mozart_api.models.speaker_group_overview import SpeakerGroupOverview +from mozart_api.models.speaker_role_enum import SpeakerRoleEnum +from mozart_api.models.speech_enhance import SpeechEnhance +from mozart_api.models.speech_enhance_feature import SpeechEnhanceFeature +from mozart_api.models.speech_enhance_range import SpeechEnhanceRange +from mozart_api.models.stand_connected import StandConnected +from mozart_api.models.stand_position import StandPosition +from mozart_api.models.tone_touch import ToneTouch +from mozart_api.models.tone_touch_type import ToneTouchType +from mozart_api.models.tone_touch_type_range import ToneTouchTypeRange +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 import Treble +from mozart_api.models.treble_feature import TrebleFeature +from mozart_api.models.treble_range import TrebleRange +from mozart_api.models.tv_info_event_data import TvInfoEventData +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 mozart_api.models.tv_state import TvState +from mozart_api.models.uri import Uri +from mozart_api.models.user_flow import UserFlow +from mozart_api.models.video_pixel_format import VideoPixelFormat +from mozart_api.models.video_timings import VideoTimings +from mozart_api.models.volume_level import VolumeLevel +from mozart_api.models.volume_mute import VolumeMute +from mozart_api.models.volume_settings import VolumeSettings +from mozart_api.models.volume_state import VolumeState +from mozart_api.models.web_socket_event_active_hdmi_input_signal import ( + WebSocketEventActiveHdmiInputSignal, +) +from mozart_api.models.web_socket_event_active_listening_mode import ( + WebSocketEventActiveListeningMode, +) +from mozart_api.models.web_socket_event_active_speaker_group import ( + WebSocketEventActiveSpeakerGroup, +) +from mozart_api.models.web_socket_event_alarm_timer import WebSocketEventAlarmTimer +from mozart_api.models.web_socket_event_alarm_triggered import ( + WebSocketEventAlarmTriggered, +) +from mozart_api.models.web_socket_event_battery import WebSocketEventBattery +from mozart_api.models.web_socket_event_beo_remote_button import ( + WebSocketEventBeoRemoteButton, +) +from mozart_api.models.web_socket_event_beolink_experiences_result import ( + WebSocketEventBeolinkExperiencesResult, +) +from mozart_api.models.web_socket_event_beolink_join_result import ( + WebSocketEventBeolinkJoinResult, +) +from mozart_api.models.web_socket_event_button import WebSocketEventButton +from mozart_api.models.web_socket_event_curtains import WebSocketEventCurtains +from mozart_api.models.web_socket_event_hdmi_video_format_signal import ( + WebSocketEventHdmiVideoFormatSignal, +) +from mozart_api.models.web_socket_event_notification import WebSocketEventNotification +from mozart_api.models.web_socket_event_playback_error import ( + WebSocketEventPlaybackError, +) +from mozart_api.models.web_socket_event_playback_metadata import ( + WebSocketEventPlaybackMetadata, +) +from mozart_api.models.web_socket_event_playback_progress import ( + WebSocketEventPlaybackProgress, +) +from mozart_api.models.web_socket_event_playback_source import ( + WebSocketEventPlaybackSource, +) +from mozart_api.models.web_socket_event_playback_state import ( + WebSocketEventPlaybackState, +) +from mozart_api.models.web_socket_event_power_state import WebSocketEventPowerState +from mozart_api.models.web_socket_event_puc_install_remote_id_status import ( + WebSocketEventPucInstallRemoteIdStatus, +) +from mozart_api.models.web_socket_event_role import WebSocketEventRole +from mozart_api.models.web_socket_event_room_compensation_current_measurement_event import ( + WebSocketEventRoomCompensationCurrentMeasurementEvent, +) +from mozart_api.models.web_socket_event_room_compensation_state import ( + WebSocketEventRoomCompensationState, +) +from mozart_api.models.web_socket_event_software_update_state import ( + WebSocketEventSoftwareUpdateState, +) +from mozart_api.models.web_socket_event_sound_settings import ( + WebSocketEventSoundSettings, +) +from mozart_api.models.web_socket_event_source_change import WebSocketEventSourceChange +from mozart_api.models.web_socket_event_speaker_group_changed import ( + WebSocketEventSpeakerGroupChanged, +) +from mozart_api.models.web_socket_event_stand_connected import ( + WebSocketEventStandConnected, +) +from mozart_api.models.web_socket_event_stand_position import ( + WebSocketEventStandPosition, +) +from mozart_api.models.web_socket_event_tv_info import WebSocketEventTvInfo +from mozart_api.models.web_socket_event_volume import WebSocketEventVolume +from mozart_api.models.web_socket_event_wisa_out_state import WebSocketEventWisaOutState +from mozart_api.models.websocket_notification_tag import WebsocketNotificationTag +from mozart_api.models.wisa_out_state import WisaOutState diff --git a/python_client/mozart_api/api/__init__.py b/python_client/mozart_api/api/__init__.py new file mode 100644 index 0000000..4edece7 --- /dev/null +++ b/python_client/mozart_api/api/__init__.py @@ -0,0 +1,18 @@ +# flake8: noqa + +# import apis into api package +from mozart_api.api.beolink_api import BeolinkApi +from mozart_api.api.bluetooth_api import BluetoothApi +from mozart_api.api.content_api import ContentApi +from mozart_api.api.deezer_api import DeezerApi +from mozart_api.api.overlay_api import OverlayApi +from mozart_api.api.playback_api import PlaybackApi +from mozart_api.api.power_api import PowerApi +from mozart_api.api.product_api import ProductApi +from mozart_api.api.remote_api import RemoteApi +from mozart_api.api.scenes_api import ScenesApi +from mozart_api.api.settings_api import SettingsApi +from mozart_api.api.software_update_api import SoftwareUpdateApi +from mozart_api.api.sound_api import SoundApi +from mozart_api.api.speaker_group_api import SpeakerGroupApi +from mozart_api.api.mozart_api import MozartApi diff --git a/python_client/mozart_api/api/beolink_api.py b/python_client/mozart_api/api/beolink_api.py new file mode 100644 index 0000000..9fb5ac0 --- /dev/null +++ b/python_client/mozart_api/api/beolink_api.py @@ -0,0 +1,1458 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class BeolinkApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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. + :param _request_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: 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 = {} + + # 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[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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def get_beolink_join_result( + self, + 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 + + 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. + :param _request_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: 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 = {} + + # 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 + _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, + } + + 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_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 _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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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 = {} + + # 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[BeolinkPeer]", + "400": "ErrorModel", + } + + 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_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. + :param _request_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: 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 + _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": "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, + _request_auth=_params.get("_request_auth"), + ) + + @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, + 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 + ) -> 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. + :param _request_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: 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 = {} + + # 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 _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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 + + + :param _request_timeout: timeout setting 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. + :param _request_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 = [] + _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 = {} + + # 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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def post_beolink_expand( + self, + jid: Annotated[ + StrictStr, + Field( + ..., description="Jabber id of peer to expand the active experience to" + ), + ], + **kwargs + ) -> None: # noqa: E501 + """Expand the current active experience # noqa: E501 + + 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. + :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, + jid: Annotated[ + StrictStr, + Field( + ..., description="Jabber id of peer to expand the active experience to" + ), + ], + **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 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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :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. + :param _request_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 = [] + _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 = [] # 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_arguments + async def post_beolink_unexpand( + self, + 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. # 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. + :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. + :param _request_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 = ["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 + _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 = [] # 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, + _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 new file mode 100644 index 0000000..17b42c0 --- /dev/null +++ b/python_client/mozart_api/api/bluetooth_api.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class BluetoothApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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 + + + :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. + :param _request_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: 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", + ] + ) + + # 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 = {} + + # 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": "BluetoothDeviceList", + "400": "ErrorModel", + } + + 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"), + ) diff --git a/python_client/mozart_api/api/content_api.py b/python_client/mozart_api/api/content_api.py new file mode 100644 index 0000000..1072aa0 --- /dev/null +++ b/python_client/mozart_api/api/content_api.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class ContentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + 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, + **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. + :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. + :param _request_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: 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", + ] + ) + + # 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"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # 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 = [] # noqa: E501 + + _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, + _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 new file mode 100644 index 0000000..9b9489f --- /dev/null +++ b/python_client/mozart_api/api/deezer_api.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 mozart_api.models.user_flow import UserFlow + +from mozart_api.api_client import ApiClient +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class DeezerApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + async def start_deezer_flow( + self, + user_flow: Annotated[ + Optional[UserFlow], Field(description="Select user") + ] = None, + **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. + :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, + **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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _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 new file mode 100644 index 0000000..e7e3b1a --- /dev/null +++ b/python_client/mozart_api/api/mozart_api.py @@ -0,0 +1,7490 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +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.models.bluetooth_device_list import BluetoothDeviceList +from mozart_api.models.content_item import ContentItem +from mozart_api.models.directivity import Directivity +from mozart_api.models.home_control_uri import HomeControlUri +from mozart_api.models.listening_mode import ListeningMode +from mozart_api.models.listening_mode_ref import ListeningModeRef +from mozart_api.models.loudness import Loudness +from mozart_api.models.overlay_play_request import OverlayPlayRequest +from mozart_api.models.paired_remote_response import PairedRemoteResponse +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 +from mozart_api.models.power_state_enum import PowerStateEnum +from mozart_api.models.preset import Preset +from mozart_api.models.product_friendly_name import ProductFriendlyName +from mozart_api.models.product_state import ProductState +from mozart_api.models.remote_menu_item import RemoteMenuItem +from mozart_api.models.remote_ui_key_state import RemoteUIKeyState +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.models.software_update_status import SoftwareUpdateStatus +from mozart_api.models.sound_feature_set import SoundFeatureSet +from mozart_api.models.source_array import SourceArray +from mozart_api.models.speaker_group_overview import SpeakerGroupOverview +from mozart_api.models.treble import Treble +from mozart_api.models.uri import Uri +from mozart_api.models.user_flow import UserFlow +from mozart_api.models.volume_level import VolumeLevel +from mozart_api.models.volume_mute import VolumeMute +from mozart_api.models.volume_settings import VolumeSettings +from mozart_api.models.volume_state import VolumeState + +from mozart_api.api_client import ApiClient +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class MozartApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + async def activate_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. + :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: 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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def activate_preset( + self, + id: Annotated[ + StrictInt, + Field(..., description="the id of the preset you want to trigger"), + ], + **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. + :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"), + ], + **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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def add_to_queue( + self, + play_queue_item: Annotated[ + PlayQueueItem, Field(..., description="the queue element you want to add") + ], + **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. + :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") + ], + **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. + :param _request_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 = ["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 + _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"]), + ) + 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_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 _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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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, + target_remote: Annotated[ + Optional[StrictBool], Field(description="filter sources for remote control") + ] = None, + **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. + :param _request_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: 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 = { + "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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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", + ] + ) + + # 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 = {} + + # 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": "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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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 = {} + + # 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[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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def get_beolink_join_result( + self, + 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 + + 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. + :param _request_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: 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 = {} + + # 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 + _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, + } + + 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_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 _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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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 = {} + + # 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[BeolinkPeer]", + "400": "ErrorModel", + } + + 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_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. + :param _request_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: 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 + _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": "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, + _request_auth=_params.get("_request_auth"), + ) + + @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 + + + :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. + :param _request_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: 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", + ] + ) + + # 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 = {} + + # 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": "BluetoothDeviceList", + "400": "ErrorModel", + } + + 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_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 + + + :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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + 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, + **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. + :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. + :param _request_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: 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", + ] + ) + + # 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"] + + _collection_formats = {} + + # process the path parameters + _path_params = {} + + # 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 = [] # noqa: E501 + + _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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def get_listening_mode_set( + self, **kwargs + ) -> List[ListeningMode]: # noqa: E501 + """Get available listening modes 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: 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 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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def get_playback_state(self, **kwargs) -> PlaybackState: # noqa: E501 + """Get the current playback 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. + :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. + :param _request_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: 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 + _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", + } + + 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_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 + + + :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. + :param _request_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: 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", + ] + ) + + # 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 = {} + + # 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": "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, + _request_auth=_params.get("_request_auth"), + ) + + @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 + + @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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 + + + :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. + :param _request_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: 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", + ] + ) + + # 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 = {} + + # 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": "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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def get_remote_home_control_uri( + self, **kwargs + ) -> HomeControlUri: # noqa: E501 + """Get the HomeControl dashboard URI # 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 the HomeControl dashboard URI # 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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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, + descendants_to: Annotated[ + Optional[StrictStr], Field(description="Get all descendants to this item") + ] = None, + **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. + :param _request_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: 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 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 = {} + + # 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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 = {} + + # 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", + } + + 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_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. + :param _request_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: 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", + ] + ) + + # 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", + } + + 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_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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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", + ] + ) + + # 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", + } + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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, + 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 + ) -> 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. + :param _request_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: 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 = {} + + # 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 _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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 + + + :param _request_timeout: timeout setting 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. + :param _request_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 = [] + _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 = {} + + # 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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def post_beolink_expand( + self, + jid: Annotated[ + StrictStr, + Field( + ..., description="Jabber id of peer to expand the active experience to" + ), + ], + **kwargs + ) -> None: # noqa: E501 + """Expand the current active experience # noqa: E501 + + 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. + :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, + jid: Annotated[ + StrictStr, + Field( + ..., description="Jabber id of peer to expand the active experience to" + ), + ], + **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 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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :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. + :param _request_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 = [] + _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 = [] # 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_arguments + async def post_beolink_unexpand( + self, + 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. # 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. + :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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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 = [] + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def post_overlay_play( + self, + overlay_play_request: Annotated[ + OverlayPlayRequest, + Field(..., description="settings to use for the 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. # 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. + :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. + :param _request_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 = ["overlay_play_request"] + _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_overlay_play" % _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["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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def post_playback_command( + self, + 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. + :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. + :param _request_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 = ["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 + _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 = [] # 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_arguments + async def post_remote_key_trigger( + self, + id: Annotated[StrictStr, Field(..., description="Key identifier")], + remote_ui_key_state: RemoteUIKeyState, + **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. + :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. + :param _request_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 = ["id", "remote_ui_key_state"] + _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_key_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _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 + _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` + _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 = {} + + 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_arguments + async def post_remote_trigger( + self, + 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. + :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. + :param _request_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 = ["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_remote_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _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 + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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_arguments + async def post_scene_trigger( + self, + 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. + :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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :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. + :param _request_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 = [] + _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_standby" % _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 = {} + + 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_arguments + async def post_uri_source( + self, + uri: Annotated[ + Uri, Field(..., description="the desired uri from which to stream data") + ], + **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. + :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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def run_provided_scene( + self, + scene_properties: Annotated[ + SceneProperties, Field(..., description="The scene you want to run") + ], + **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. + :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. + :param _request_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 = ["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 + _body_params = None + if _params["scene_properties"] is not None: + _body_params = _params["scene_properties"] + + # 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 = {} + + 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_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, + position_ms: Annotated[ + StrictInt, Field(..., description="position in milliseconds") + ], + **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. + :param _request_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 = ["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 + _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 + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_active_source( + self, + source_id: Annotated[ + StrictStr, Field(..., description="the id of the source to activate") + ], + **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. + :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. + :param _request_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 = ["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 + _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 = [] # 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_arguments + async def set_current_volume_level( + self, + volume_level: Annotated[ + VolumeLevel, Field(..., description="The volume level to apply") + ], + **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. + :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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_product_friendly_name( + self, + product_friendly_name: Annotated[ + ProductFriendlyName, + Field(..., description="the friendly name for the product"), + ], + **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. + :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. + :param _request_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 = ["product_friendly_name"] + _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_product_friendly_name" % _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["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` + _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 = {} + + 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_arguments + async def set_remote_home_control_uri( + self, + home_control_uri: Annotated[ + HomeControlUri, Field(..., description="the new HomeControl dashboard uri") + ], + **kwargs + ) -> None: # noqa: E501 + """Set the HomeControl dashboard URI # noqa: E501 + + + :param home_control_uri: the new HomeControl dashboard uri (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 HomeControl dashboard uri") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the HomeControl dashboard URI # noqa: E501 + + + :param home_control_uri: the new HomeControl dashboard uri (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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_settings_queue( + self, + play_queue_settings: Annotated[ + PlayQueueSettings, Field(..., description="the desired 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. + :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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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_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 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. + :param _request_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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_sound_settings_adjustments_directivity( + self, + 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. + :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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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_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, + 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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_sound_settings_adjustments_treble( + self, + 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. + :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. + :param _request_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 = ["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 + _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"]), + ) + 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, + 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_arguments + async def set_volume_mute( + self, + volume_mute: Annotated[ + VolumeMute, Field(..., description="The mute state to apply") + ], + **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. + :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") + ], + **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. + :param _request_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 = ["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 + _body_params = None + if _params["volume_mute"] is not None: + _body_params = _params["volume_mute"] + + # 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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_volume_settings( + self, + volume_settings: Annotated[ + VolumeSettings, Field(..., description="The settings to apply") + ], + **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. + :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") + ], + **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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def start_deezer_flow( + self, + user_flow: Annotated[ + Optional[UserFlow], Field(description="Select user") + ] = None, + **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. + :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, + **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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _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 new file mode 100644 index 0000000..0115aca --- /dev/null +++ b/python_client/mozart_api/api/overlay_api.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class OverlayApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + async def post_overlay_play( + self, + overlay_play_request: Annotated[ + OverlayPlayRequest, + Field(..., description="settings to use for the 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. # 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. + :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. + :param _request_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 = ["overlay_play_request"] + _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_overlay_play" % _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["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 = [] # 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, + _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 new file mode 100644 index 0000000..8e768cb --- /dev/null +++ b/python_client/mozart_api/api/playback_api.py @@ -0,0 +1,1649 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.models.source_array import SourceArray +from mozart_api.models.uri import Uri +from mozart_api.models.user_flow import UserFlow + +from mozart_api.api_client import ApiClient +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class PlaybackApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + async def activate_preset( + self, + id: Annotated[ + StrictInt, + Field(..., description="the id of the preset you want to trigger"), + ], + **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. + :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"), + ], + **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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def add_to_queue( + self, + play_queue_item: Annotated[ + PlayQueueItem, Field(..., description="the queue element you want to add") + ], + **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. + :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") + ], + **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. + :param _request_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 = ["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 + _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"]), + ) + 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_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, + target_remote: Annotated[ + Optional[StrictBool], Field(description="filter sources for remote control") + ] = None, + **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. + :param _request_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: 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 = { + "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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def get_playback_state(self, **kwargs) -> PlaybackState: # noqa: E501 + """Get the current playback 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. + :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. + :param _request_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: 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 + _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", + } + + 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_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. + :param _request_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: 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 = {} + + # 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", + } + + 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_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. + :param _request_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 = [] + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def post_playback_command( + self, + 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. + :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. + :param _request_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 = ["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 + _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 = [] # 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_arguments + async def post_uri_source( + self, + uri: Annotated[ + Uri, Field(..., description="the desired uri from which to stream data") + ], + **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. + :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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @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, + position_ms: Annotated[ + StrictInt, Field(..., description="position in milliseconds") + ], + **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. + :param _request_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 = ["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 + _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 + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_active_source( + self, + source_id: Annotated[ + StrictStr, Field(..., description="the id of the source to activate") + ], + **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. + :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. + :param _request_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 = ["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 + _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 = [] # 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_arguments + async def set_settings_queue( + self, + play_queue_settings: Annotated[ + PlayQueueSettings, Field(..., description="the desired 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. + :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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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_arguments + async def start_deezer_flow( + self, + user_flow: Annotated[ + Optional[UserFlow], Field(description="Select user") + ] = None, + **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. + :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, + **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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _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 new file mode 100644 index 0000000..ee71eb1 --- /dev/null +++ b/python_client/mozart_api/api/power_api.py @@ -0,0 +1,391 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class PowerApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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. + :param _request_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: 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", + ] + ) + + # 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 = {} + + # 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": "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, + _request_auth=_params.get("_request_auth"), + ) + + @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 + + + :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. + :param _request_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: 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", + ] + ) + + # 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 = {} + + # 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": "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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :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. + :param _request_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 = [] + _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_standby" % _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 = {} + + 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"), + ) diff --git a/python_client/mozart_api/api/product_api.py b/python_client/mozart_api/api/product_api.py new file mode 100644 index 0000000..0356437 --- /dev/null +++ b/python_client/mozart_api/api/product_api.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class ProductApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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 + + + :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. + :param _request_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: 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", + ] + ) + + # 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 = {} + + # 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": "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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_product_friendly_name( + self, + product_friendly_name: Annotated[ + ProductFriendlyName, + Field(..., description="the friendly name for the product"), + ], + **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. + :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. + :param _request_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 = ["product_friendly_name"] + _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_product_friendly_name" % _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["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` + _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 = {} + + 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"), + ) diff --git a/python_client/mozart_api/api/remote_api.py b/python_client/mozart_api/api/remote_api.py new file mode 100644 index 0000000..3dcdc06 --- /dev/null +++ b/python_client/mozart_api/api/remote_api.py @@ -0,0 +1,458 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class RemoteApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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, + descendants_to: Annotated[ + Optional[StrictStr], Field(description="Get all descendants to this item") + ] = None, + **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. + :param _request_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: 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 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 = {} + + # 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def post_remote_key_trigger( + self, + id: Annotated[StrictStr, Field(..., description="Key identifier")], + remote_ui_key_state: RemoteUIKeyState, + **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. + :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. + :param _request_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 = ["id", "remote_ui_key_state"] + _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_key_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _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 + _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` + _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 = {} + + 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_arguments + async def post_remote_trigger( + self, + 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. + :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. + :param _request_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 = ["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_remote_trigger" % _key + ) + _params[_key] = _val + del _params["kwargs"] + + _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 + _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 = {} + + 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, + _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 new file mode 100644 index 0000000..d4007fc --- /dev/null +++ b/python_client/mozart_api/api/scenes_api.py @@ -0,0 +1,566 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class ScenesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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_arguments + async def post_scene_trigger( + self, + 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. + :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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def run_provided_scene( + self, + scene_properties: Annotated[ + SceneProperties, Field(..., description="The scene you want to run") + ], + **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. + :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. + :param _request_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 = ["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 + _body_params = None + if _params["scene_properties"] is not None: + _body_params = _params["scene_properties"] + + # 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 = {} + + 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"), + ) diff --git a/python_client/mozart_api/api/settings_api.py b/python_client/mozart_api/api/settings_api.py new file mode 100644 index 0000000..9f2fa73 --- /dev/null +++ b/python_client/mozart_api/api/settings_api.py @@ -0,0 +1,550 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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_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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class SettingsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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 + + + :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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 + + @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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def get_remote_home_control_uri( + self, **kwargs + ) -> HomeControlUri: # noqa: E501 + """Get the HomeControl dashboard URI # 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 the HomeControl dashboard URI # 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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_remote_home_control_uri( + self, + home_control_uri: Annotated[ + HomeControlUri, Field(..., description="the new HomeControl dashboard uri") + ], + **kwargs + ) -> None: # noqa: E501 + """Set the HomeControl dashboard URI # noqa: E501 + + + :param home_control_uri: the new HomeControl dashboard uri (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 HomeControl dashboard uri") + ], + **kwargs + ) -> ApiResponse: # noqa: E501 + """Set the HomeControl dashboard URI # noqa: E501 + + + :param home_control_uri: the new HomeControl dashboard uri (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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _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 new file mode 100644 index 0000000..2d20a8f --- /dev/null +++ b/python_client/mozart_api/api/software_update_api.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class SoftwareUpdateApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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. + :param _request_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: 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", + ] + ) + + # 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", + } + + 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"), + ) diff --git a/python_client/mozart_api/api/sound_api.py b/python_client/mozart_api/api/sound_api.py new file mode 100644 index 0000000..d731b7c --- /dev/null +++ b/python_client/mozart_api/api/sound_api.py @@ -0,0 +1,1752 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.models.listening_mode_ref import ListeningModeRef +from mozart_api.models.loudness import Loudness +from mozart_api.models.sound_feature_set import SoundFeatureSet +from mozart_api.models.treble import Treble +from mozart_api.models.volume_level import VolumeLevel +from mozart_api.models.volume_mute import VolumeMute +from mozart_api.models.volume_settings import VolumeSettings +from mozart_api.models.volume_state import VolumeState + +from mozart_api.api_client import ApiClient +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class SoundApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_arguments + async def activate_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. + :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: 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. + :param _request_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 = ["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 + _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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 _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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def get_listening_mode_set( + self, **kwargs + ) -> List[ListeningMode]: # noqa: E501 + """Get available listening modes 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: 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 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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @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. + :param _request_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: 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 = [] # 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_current_volume_level( + self, + volume_level: Annotated[ + VolumeLevel, Field(..., description="The volume level to apply") + ], + **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. + :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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @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 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. + :param _request_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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_sound_settings_adjustments_directivity( + self, + 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. + :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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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_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, + 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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_sound_settings_adjustments_treble( + self, + 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. + :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. + :param _request_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 = ["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 + _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"]), + ) + 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, + 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_arguments + async def set_volume_mute( + self, + volume_mute: Annotated[ + VolumeMute, Field(..., description="The mute state to apply") + ], + **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. + :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") + ], + **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. + :param _request_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 = ["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 + _body_params = None + if _params["volume_mute"] is not None: + _body_params = _params["volume_mute"] + + # 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 = {} + + 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, + _request_auth=_params.get("_request_auth"), + ) + + @validate_arguments + async def set_volume_settings( + self, + volume_settings: Annotated[ + VolumeSettings, Field(..., description="The settings to apply") + ], + **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. + :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") + ], + **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. + :param _request_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 = ["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 + _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` + _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 = {} + + 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, + _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 new file mode 100644 index 0000000..3f82869 --- /dev/null +++ b/python_client/mozart_api/api/speaker_group_api.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import re # noqa: F401 +import io +import warnings + +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 +from mozart_api.api_response import ApiResponse +from mozart_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class SpeakerGroupApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @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. + :param _request_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: 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", + ] + ) + + # 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", + } + + 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, + _request_auth=_params.get("_request_auth"), + ) diff --git a/python_client/mozart_api/api_client.py b/python_client/mozart_api/api_client.py new file mode 100644 index 0000000..5d3774f --- /dev/null +++ b/python_client/mozart_api/api_client.py @@ -0,0 +1,793 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import atexit +import datetime +from dateutil.parser import parse +import json +import mimetypes +import os +import re +import tempfile + +from urllib.parse import quote + +from mozart_api.configuration import Configuration +from mozart_api.api_response import ApiResponse +import mozart_api.models +from mozart_api import rest +from mozart_api.exceptions import ApiValueError, ApiException + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + "int": int, + "long": int, # TODO remove as only py3 is supported? + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "object": object, + } + _pool = None + + def __init__( + self, configuration=None, header_name=None, header_value=None, cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = "OpenAPI-Generator/3.2.1.150.6/python" + self.client_side_validation = configuration.client_side_validation + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self): + await self.rest_client.close() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers["User-Agent"] + + @user_agent.setter + def user_agent(self, value): + self.default_headers["User-Agent"] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + 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, + ): + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params["Cookie"] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params, collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth, + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query(query_params, collection_formats) + url += "?" + url_query + + try: + # perform request and return response + response_data = await self.request( + method, + url, + query_params=query_params, + headers=header_params, + 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 + + 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 + ) + + if response_type == "bytearray": + 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_data.data = response_data.data.decode(encoding) + + # 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. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = obj.to_dict() + + return { + key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() + } + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :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.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith("List["): + 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["): + 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 + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(mozart_api.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + 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. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + 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": + new_params.extend((k, value) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + 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)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, value) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(item) for item in new_params]) + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in files.items(): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, "rb") as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = ( + mimetypes.guess_type(filename)[0] + or "application/octet-stream" + ) + params.append(tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + 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 + + for accept in accepts: + if re.search("json", accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search("json", content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None, + ): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, queries, resource_path, method, body, request_auth + ) + 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 + ): + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + if auth_setting["type"] != "http-signature": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + queries.append((auth_setting["key"], auth_setting["value"])) + else: + raise ApiValueError("Authentication token must be in `query` or `header`") + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + 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: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=("Failed to parse `{0}` as datetime object".format(string)), + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/python_client/mozart_api/api_response.py b/python_client/mozart_api/api_response.py new file mode 100644 index 0000000..bb7e400 --- /dev/null +++ b/python_client/mozart_api/api_response.py @@ -0,0 +1,28 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Any, Dict, Optional +from pydantic import Field, StrictInt, StrictStr + + +class ApiResponse: + """ + API response object + """ + + 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)") + + 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 new file mode 100644 index 0000000..7c9f837 --- /dev/null +++ b/python_client/mozart_api/configuration.py @@ -0,0 +1,451 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import logging +import sys +import urllib3 + +import http.client as httplib + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", +} + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + """ + + _default = None + + def __init__( + self, + host=None, + api_key=None, + api_key_prefix=None, + username=None, + password=None, + access_token=None, + server_index=None, + server_variables=None, + server_operation_index=None, + server_operation_variables=None, + ssl_ca_cert=None, + ) -> None: + """Constructor""" + self._base_path = "http://localhost" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("mozart_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = "%(asctime)s %(levelname)s %(message)s" + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = "" + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ("logger", "logger_file_handler"): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get( + identifier, self.api_key.get(alias) if alias is not None else None + ) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers(basic_auth=username + ":" + password).get( + "authorization" + ) + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return ( + "Python SDK Debug Report:\n" + "OS: {env}\n" + "Python Version: {pyversion}\n" + "Version of the API: 0.2.0\n" + "SDK Package Version: 3.2.1.150.6".format( + env=sys.platform, pyversion=sys.version + ) + ) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + "url": "", + "description": "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers)) + ) + + url = server["url"] + + # go through variables and replace placeholders + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) + + if "enum_values" in variable and used_value not in variable["enum_values"]: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], variable["enum_values"] + ) + ) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings( + self.server_index, variables=self.server_variables + ) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/python_client/mozart_api/exceptions.py b/python_client/mozart_api/exceptions.py new file mode 100644 index 0000000..264ee63 --- /dev/null +++ b/python_client/mozart_api/exceptions.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__( + self, msg, path_to_item=None, valid_classes=None, key_type=None + ) -> None: + """Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + def __init__(self, status=None, reason=None, http_resp=None) -> None: + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format(self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +class BadRequestException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(BadRequestException, self).__init__(status, reason, http_resp) + + +class NotFoundException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(NotFoundException, self).__init__(status, reason, http_resp) + + +class UnauthorizedException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(UnauthorizedException, self).__init__(status, reason, http_resp) + + +class ForbiddenException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super(ForbiddenException, self).__init__(status, reason, http_resp) + + +class ServiceException(ApiException): + 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): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/python_client/mozart_api/models/__init__.py b/python_client/mozart_api/models/__init__.py new file mode 100644 index 0000000..231e3ad --- /dev/null +++ b/python_client/mozart_api/models/__init__.py @@ -0,0 +1,262 @@ +# coding: utf-8 + +# flake8: noqa +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from mozart_api.models.action import Action +from mozart_api.models.alarm_timer_event_data import AlarmTimerEventData +from mozart_api.models.alarm_triggered_info import AlarmTriggeredInfo +from mozart_api.models.ambience import Ambience +from mozart_api.models.ambience_feature import AmbienceFeature +from mozart_api.models.ambience_range import AmbienceRange +from mozart_api.models.art import Art +from mozart_api.models.balance import Balance +from mozart_api.models.balance_feature import BalanceFeature +from mozart_api.models.balance_range import BalanceRange +from mozart_api.models.bass import Bass +from mozart_api.models.bass_feature import BassFeature +from mozart_api.models.bass_management import BassManagement +from mozart_api.models.bass_management_feature import BassManagementFeature +from mozart_api.models.bass_management_range import BassManagementRange +from mozart_api.models.bass_range import BassRange +from mozart_api.models.battery_state import BatteryState +from mozart_api.models.beo_remote_button import BeoRemoteButton +from mozart_api.models.beolink_available_listener import BeolinkAvailableListener +from mozart_api.models.beolink_experience import BeolinkExperience +from mozart_api.models.beolink_experiences_request import BeolinkExperiencesRequest +from mozart_api.models.beolink_experiences_result import BeolinkExperiencesResult +from mozart_api.models.beolink_join_request import BeolinkJoinRequest +from mozart_api.models.beolink_join_result import BeolinkJoinResult +from mozart_api.models.beolink_leader import BeolinkLeader +from mozart_api.models.beolink_listener import BeolinkListener +from mozart_api.models.beolink_peer import BeolinkPeer +from mozart_api.models.bluetooth_device import BluetoothDevice +from mozart_api.models.bluetooth_device_list import BluetoothDeviceList +from mozart_api.models.button_event import ButtonEvent +from mozart_api.models.compression import Compression +from mozart_api.models.compression_feature import CompressionFeature +from mozart_api.models.compression_range import CompressionRange +from mozart_api.models.content_item import ContentItem +from mozart_api.models.directivity import Directivity +from mozart_api.models.directivity_feature import DirectivityFeature +from mozart_api.models.directivity_range import DirectivityRange +from mozart_api.models.error_model import ErrorModel +from mozart_api.models.fader import Fader +from mozart_api.models.fader_feature import FaderFeature +from mozart_api.models.fader_range import FaderRange +from mozart_api.models.hdmi_input import HdmiInput +from mozart_api.models.hdmi_video_format import HdmiVideoFormat +from mozart_api.models.home_control_uri import HomeControlUri +from mozart_api.models.install_record_id_state import InstallRecordIdState +from mozart_api.models.latency_profile import LatencyProfile +from mozart_api.models.lge_tv_sound_settings import LgeTvSoundSettings +from mozart_api.models.listening_mode import ListeningMode +from mozart_api.models.listening_mode_features import ListeningModeFeatures +from mozart_api.models.listening_mode_props import ListeningModeProps +from mozart_api.models.listening_mode_ref import ListeningModeRef +from mozart_api.models.listening_mode_trigger import ListeningModeTrigger +from mozart_api.models.loudness import Loudness +from mozart_api.models.microphone_state import MicrophoneState +from mozart_api.models.microphones_state import MicrophonesState +from mozart_api.models.overlay_play_request import OverlayPlayRequest +from mozart_api.models.overlay_play_request_common import OverlayPlayRequestCommon +from mozart_api.models.overlay_play_request_from_usb import OverlayPlayRequestFromUsb +from mozart_api.models.overlay_play_request_from_usb_from_usb import ( + OverlayPlayRequestFromUsbFromUsb, +) +from mozart_api.models.overlay_play_request_text_to_speech import ( + OverlayPlayRequestTextToSpeech, +) +from mozart_api.models.overlay_play_request_text_to_speech_text_to_speech import ( + OverlayPlayRequestTextToSpeechTextToSpeech, +) +from mozart_api.models.overlay_play_request_uri import OverlayPlayRequestUri +from mozart_api.models.paired_remote import PairedRemote +from mozart_api.models.paired_remote_response import PairedRemoteResponse +from mozart_api.models.play_queue_item import PlayQueueItem +from mozart_api.models.play_queue_item_type import PlayQueueItemType +from mozart_api.models.play_queue_settings import PlayQueueSettings +from mozart_api.models.playback_content_metadata import PlaybackContentMetadata +from mozart_api.models.playback_error import PlaybackError +from mozart_api.models.playback_progress import PlaybackProgress +from mozart_api.models.playback_state import PlaybackState +from mozart_api.models.power_link_trigger import PowerLinkTrigger +from mozart_api.models.power_state_enum import PowerStateEnum +from mozart_api.models.preset import Preset +from mozart_api.models.product_curtain_status import ProductCurtainStatus +from mozart_api.models.product_friendly_name import ProductFriendlyName +from mozart_api.models.product_state import ProductState +from mozart_api.models.remote_menu_item import RemoteMenuItem +from mozart_api.models.remote_menu_item_properties import RemoteMenuItemProperties +from mozart_api.models.remote_ui_key_state import RemoteUIKeyState +from mozart_api.models.rendering_state import RenderingState +from mozart_api.models.room_compensation import RoomCompensation +from mozart_api.models.room_compensation_current_measurement import ( + RoomCompensationCurrentMeasurement, +) +from mozart_api.models.room_compensation_debug import RoomCompensationDebug +from mozart_api.models.room_compensation_enabled import RoomCompensationEnabled +from mozart_api.models.room_compensation_error_details import ( + RoomCompensationErrorDetails, +) +from mozart_api.models.room_compensation_feature import RoomCompensationFeature +from mozart_api.models.room_compensation_info import RoomCompensationInfo +from mozart_api.models.room_compensation_measurement_error import ( + RoomCompensationMeasurementError, +) +from mozart_api.models.room_compensation_properties import RoomCompensationProperties +from mozart_api.models.room_compensation_range import RoomCompensationRange +from mozart_api.models.room_compensation_response import RoomCompensationResponse +from mozart_api.models.room_compensation_result import RoomCompensationResult +from mozart_api.models.room_compensation_state import RoomCompensationState +from mozart_api.models.room_compensation_state_value import RoomCompensationStateValue +from mozart_api.models.room_compensation_type import RoomCompensationType +from mozart_api.models.room_compensation_version import RoomCompensationVersion +from mozart_api.models.scene import Scene +from mozart_api.models.scene_classification import SceneClassification +from mozart_api.models.scene_match import SceneMatch +from mozart_api.models.scene_properties import SceneProperties +from mozart_api.models.scene_trigger_base_properties import SceneTriggerBaseProperties +from mozart_api.models.software_update_state import SoftwareUpdateState +from mozart_api.models.software_update_status import SoftwareUpdateStatus +from mozart_api.models.sound_adjustments import SoundAdjustments +from mozart_api.models.sound_feature_set import SoundFeatureSet +from mozart_api.models.sound_settings import SoundSettings +from mozart_api.models.sound_tone_touch import SoundToneTouch +from mozart_api.models.source import Source +from mozart_api.models.source_array import SourceArray +from mozart_api.models.source_type_enum import SourceTypeEnum +from mozart_api.models.spatial_envelopment import SpatialEnvelopment +from mozart_api.models.spatial_envelopment_feature import SpatialEnvelopmentFeature +from mozart_api.models.spatial_envelopment_range import SpatialEnvelopmentRange +from mozart_api.models.spatial_height import SpatialHeight +from mozart_api.models.spatial_height_feature import SpatialHeightFeature +from mozart_api.models.spatial_height_range import SpatialHeightRange +from mozart_api.models.spatial_processing import SpatialProcessing +from mozart_api.models.spatial_processing_feature import SpatialProcessingFeature +from mozart_api.models.spatial_processing_range import SpatialProcessingRange +from mozart_api.models.spatial_surround import SpatialSurround +from mozart_api.models.spatial_surround_feature import SpatialSurroundFeature +from mozart_api.models.spatial_surround_range import SpatialSurroundRange +from mozart_api.models.spatial_width import SpatialWidth +from mozart_api.models.spatial_width_feature import SpatialWidthFeature +from mozart_api.models.spatial_width_range import SpatialWidthRange +from mozart_api.models.speaker_group import SpeakerGroup +from mozart_api.models.speaker_group_member import SpeakerGroupMember +from mozart_api.models.speaker_group_member_location import SpeakerGroupMemberLocation +from mozart_api.models.speaker_group_overview import SpeakerGroupOverview +from mozart_api.models.speaker_role_enum import SpeakerRoleEnum +from mozart_api.models.speech_enhance import SpeechEnhance +from mozart_api.models.speech_enhance_feature import SpeechEnhanceFeature +from mozart_api.models.speech_enhance_range import SpeechEnhanceRange +from mozart_api.models.stand_connected import StandConnected +from mozart_api.models.stand_position import StandPosition +from mozart_api.models.tone_touch import ToneTouch +from mozart_api.models.tone_touch_type import ToneTouchType +from mozart_api.models.tone_touch_type_range import ToneTouchTypeRange +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 import Treble +from mozart_api.models.treble_feature import TrebleFeature +from mozart_api.models.treble_range import TrebleRange +from mozart_api.models.tv_info_event_data import TvInfoEventData +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 mozart_api.models.tv_state import TvState +from mozart_api.models.uri import Uri +from mozart_api.models.user_flow import UserFlow +from mozart_api.models.video_pixel_format import VideoPixelFormat +from mozart_api.models.video_timings import VideoTimings +from mozart_api.models.volume_level import VolumeLevel +from mozart_api.models.volume_mute import VolumeMute +from mozart_api.models.volume_settings import VolumeSettings +from mozart_api.models.volume_state import VolumeState +from mozart_api.models.web_socket_event_active_hdmi_input_signal import ( + WebSocketEventActiveHdmiInputSignal, +) +from mozart_api.models.web_socket_event_active_listening_mode import ( + WebSocketEventActiveListeningMode, +) +from mozart_api.models.web_socket_event_active_speaker_group import ( + WebSocketEventActiveSpeakerGroup, +) +from mozart_api.models.web_socket_event_alarm_timer import WebSocketEventAlarmTimer +from mozart_api.models.web_socket_event_alarm_triggered import ( + WebSocketEventAlarmTriggered, +) +from mozart_api.models.web_socket_event_battery import WebSocketEventBattery +from mozart_api.models.web_socket_event_beo_remote_button import ( + WebSocketEventBeoRemoteButton, +) +from mozart_api.models.web_socket_event_beolink_experiences_result import ( + WebSocketEventBeolinkExperiencesResult, +) +from mozart_api.models.web_socket_event_beolink_join_result import ( + WebSocketEventBeolinkJoinResult, +) +from mozart_api.models.web_socket_event_button import WebSocketEventButton +from mozart_api.models.web_socket_event_curtains import WebSocketEventCurtains +from mozart_api.models.web_socket_event_hdmi_video_format_signal import ( + WebSocketEventHdmiVideoFormatSignal, +) +from mozart_api.models.web_socket_event_notification import WebSocketEventNotification +from mozart_api.models.web_socket_event_playback_error import ( + WebSocketEventPlaybackError, +) +from mozart_api.models.web_socket_event_playback_metadata import ( + WebSocketEventPlaybackMetadata, +) +from mozart_api.models.web_socket_event_playback_progress import ( + WebSocketEventPlaybackProgress, +) +from mozart_api.models.web_socket_event_playback_source import ( + WebSocketEventPlaybackSource, +) +from mozart_api.models.web_socket_event_playback_state import ( + WebSocketEventPlaybackState, +) +from mozart_api.models.web_socket_event_power_state import WebSocketEventPowerState +from mozart_api.models.web_socket_event_puc_install_remote_id_status import ( + WebSocketEventPucInstallRemoteIdStatus, +) +from mozart_api.models.web_socket_event_role import WebSocketEventRole +from mozart_api.models.web_socket_event_room_compensation_current_measurement_event import ( + WebSocketEventRoomCompensationCurrentMeasurementEvent, +) +from mozart_api.models.web_socket_event_room_compensation_state import ( + WebSocketEventRoomCompensationState, +) +from mozart_api.models.web_socket_event_software_update_state import ( + WebSocketEventSoftwareUpdateState, +) +from mozart_api.models.web_socket_event_sound_settings import ( + WebSocketEventSoundSettings, +) +from mozart_api.models.web_socket_event_source_change import WebSocketEventSourceChange +from mozart_api.models.web_socket_event_speaker_group_changed import ( + WebSocketEventSpeakerGroupChanged, +) +from mozart_api.models.web_socket_event_stand_connected import ( + WebSocketEventStandConnected, +) +from mozart_api.models.web_socket_event_stand_position import ( + WebSocketEventStandPosition, +) +from mozart_api.models.web_socket_event_tv_info import WebSocketEventTvInfo +from mozart_api.models.web_socket_event_volume import WebSocketEventVolume +from mozart_api.models.web_socket_event_wisa_out_state import WebSocketEventWisaOutState +from mozart_api.models.websocket_notification_tag import WebsocketNotificationTag +from mozart_api.models.wisa_out_state import WisaOutState diff --git a/python_client/mozart_api/models/action.py b/python_client/mozart_api/models/action.py new file mode 100644 index 0000000..ceeb947 --- /dev/null +++ b/python_client/mozart_api/models/action.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, 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 + + +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 } } ``` # noqa: E501 + """ + + button_name: Optional[StrictStr] = Field( + None, + alias="buttonName", + description="Name of the Button used for button-press types ('buttonShortPress')", + ) + content_id: Optional[StrictStr] = Field( + None, + alias="contentId", + description="Id of content only used for 'type=triggerContent'", + ) + deezer_user_id: Optional[StrictStr] = Field( + None, + alias="deezerUserId", + description="Id of user only used for 'type=deezerFlow' and is optional", + ) + listening_mode_id: Optional[conint(strict=True, ge=0)] = Field( + None, alias="listeningModeId" + ) + preset_key: Optional[StrictStr] = Field( + 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( + None, + alias="radioStationId", + description="Id of RadioStation only used for 'type=radio'", + ) + source: Optional[SourceTypeEnum] = None + 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( + None, alias="toneName", description="Name of the tone only used for 'type=tone'" + ) + 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 = [ + "buttonName", + "contentId", + "deezerUserId", + "listeningModeId", + "presetKey", + "queueItem", + "queueSettings", + "radioStationId", + "source", + "speakerGroupId", + "standPosition", + "stopDuration", + "toneName", + "type", + "volumeLevel", + ] + + @validator("button_name") + def button_name_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("preset1", "preset2", "preset3", "preset4"): + raise ValueError( + "must be one of enum values ('preset1', 'preset2', 'preset3', 'preset4')" + ) + return value + + @validator("tone_name") + def tone_name_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("alarm_1", "alarm_2"): + raise ValueError("must be one of enum values ('alarm_1', 'alarm_2')") + return value + + @validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in ( + "standby", + "tone", + "radio", + "sourcePreset", + "deezerFlow", + "activateSource", + "playQueue", + "buttonShortPress", + "allStandby", + "touchToJoin", + "fallback", + "volume", + "stop", + "triggerContent", + "speakerGroup", + "listeningMode", + "stand", + ): + 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')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of queue_settings + if self.queue_settings: + _dict["queueSettings"] = self.queue_settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict["source"] = self.source.to_dict() + # override the default output from pydantic by calling `to_dict()` of stand_position + if self.stand_position: + _dict["standPosition"] = self.stand_position.to_dict() + # set to None if button_name (nullable) is None + # 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 __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 __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 __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 __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 __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 __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 __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: dict) -> Action: + """Create an instance of Action from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Action.parse_obj(obj) + + _obj = Action.parse_obj( + { + "button_name": obj.get("buttonName"), + "content_id": obj.get("contentId"), + "deezer_user_id": obj.get("deezerUserId"), + "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, + "queue_settings": PlayQueueSettings.from_dict(obj.get("queueSettings")) + if obj.get("queueSettings") is not None + else None, + "radio_station_id": obj.get("radioStationId"), + "source": SourceTypeEnum.from_dict(obj.get("source")) + if obj.get("source") is not None + else None, + "speaker_group_id": obj.get("speakerGroupId"), + "stand_position": StandPosition.from_dict(obj.get("standPosition")) + if obj.get("standPosition") is not None + else None, + "stop_duration": obj.get("stopDuration"), + "tone_name": obj.get("toneName"), + "type": obj.get("type"), + "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 new file mode 100644 index 0000000..c69d569 --- /dev/null +++ b/python_client/mozart_api/models/alarm_timer_event_data.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class AlarmTimerEventData(BaseModel): + """ + AlarmTimerEventData + """ + + event: Optional[StrictStr] = None + id: Optional[StrictStr] = None + type: Optional[StrictStr] = None + __properties = ["event", "id", "type"] + + @validator("event") + def event_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("add", "update", "delete"): + raise ValueError("must be one of enum values ('add', 'update', 'delete')") + return value + + @validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("alarm", "timer"): + raise ValueError("must be one of enum values ('alarm', 'timer')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> AlarmTimerEventData: + """Create an instance of AlarmTimerEventData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return AlarmTimerEventData.parse_obj(obj) + + _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 new file mode 100644 index 0000000..edb007e --- /dev/null +++ b/python_client/mozart_api/models/alarm_triggered_info.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, constr + + +class AlarmTriggeredInfo(BaseModel): + """ + AlarmTriggeredInfo + """ + + id: Optional[StrictStr] = None + label: Optional[constr(strict=True, max_length=128)] = Field( + None, description="Label for an alarm" + ) + __properties = ["id", "label"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> AlarmTriggeredInfo: + """Create an instance of AlarmTriggeredInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return AlarmTriggeredInfo.parse_obj(obj) + + _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 new file mode 100644 index 0000000..70ccf97 --- /dev/null +++ b/python_client/mozart_api/models/ambience.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class Ambience(BaseModel): + """ + Ambience + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Ambience: + """Create an instance of Ambience from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Ambience.parse_obj(obj) + + _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 new file mode 100644 index 0000000..dc923fd --- /dev/null +++ b/python_client/mozart_api/models/ambience_feature.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.ambience import Ambience + + +class AmbienceFeature(BaseModel): + """ + AmbienceFeature + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected ambience value" + ) + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 AmbienceFeature.parse_obj(obj) + + _obj = AmbienceFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/ambience_range.py b/python_client/mozart_api/models/ambience_range.py new file mode 100644 index 0000000..9c59315 --- /dev/null +++ b/python_client/mozart_api/models/ambience_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.ambience import Ambience + + +class AmbienceRange(BaseModel): + """ + AmbienceRange + """ + + default: Ambience = Field(...) + range: conlist(Ambience, unique_items=True) = Field( + ..., description="Product and role specific ambience 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 AmbienceRange.parse_obj(obj) + + _obj = AmbienceRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/art.py b/python_client/mozart_api/models/art.py new file mode 100644 index 0000000..d429fb5 --- /dev/null +++ b/python_client/mozart_api/models/art.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr + + +class Art(BaseModel): + """ + Art + """ + + 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 = ["hasLocalImage", "key", "size", "type", "url"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Art: + """Create an instance of Art from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Art.parse_obj(obj) + + _obj = Art.parse_obj( + { + "has_local_image": obj.get("hasLocalImage"), + "key": obj.get("key"), + "size": obj.get("size"), + "type": obj.get("type"), + "url": obj.get("url"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/balance.py b/python_client/mozart_api/models/balance.py new file mode 100644 index 0000000..a22556b --- /dev/null +++ b/python_client/mozart_api/models/balance.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class Balance(BaseModel): + """ + Balance + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Balance: + """Create an instance of Balance from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Balance.parse_obj(obj) + + _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 new file mode 100644 index 0000000..95b649c --- /dev/null +++ b/python_client/mozart_api/models/balance_feature.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.balance import Balance + + +class BalanceFeature(BaseModel): + """ + BalanceFeature + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 BalanceFeature.parse_obj(obj) + + _obj = BalanceFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/balance_range.py b/python_client/mozart_api/models/balance_range.py new file mode 100644 index 0000000..b2e2caf --- /dev/null +++ b/python_client/mozart_api/models/balance_range.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.balance import Balance + + +class BalanceRange(BaseModel): + """ + BalanceRange + """ + + default: Balance = Field(...) + range: conlist(Balance, unique_items=True) = Field(..., description="balance 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 BalanceRange.parse_obj(obj) + + _obj = BalanceRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/bass.py b/python_client/mozart_api/models/bass.py new file mode 100644 index 0000000..ca8f949 --- /dev/null +++ b/python_client/mozart_api/models/bass.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictInt + + +class Bass(BaseModel): + """ + Bass + """ + + value: StrictInt = Field(..., description="Selected bass 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Bass: + """Create an instance of Bass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Bass.parse_obj(obj) + + _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 new file mode 100644 index 0000000..edad0bb --- /dev/null +++ b/python_client/mozart_api/models/bass_feature.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, StrictInt, conlist +from mozart_api.models.bass import Bass + + +class BassFeature(BaseModel): + """ + BassFeature + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 BassFeature.parse_obj(obj) + + _obj = BassFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/bass_management.py b/python_client/mozart_api/models/bass_management.py new file mode 100644 index 0000000..c6db048 --- /dev/null +++ b/python_client/mozart_api/models/bass_management.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr, validator + + +class BassManagement(BaseModel): + """ + BassManagement + """ + + value: StrictStr = Field(..., description="Selected bass-management value") + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value not in ("on", "off"): + raise ValueError("must be one of enum values ('on', 'off')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BassManagement: + """Create an instance of BassManagement from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BassManagement.parse_obj(obj) + + _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 new file mode 100644 index 0000000..aba59e6 --- /dev/null +++ b/python_client/mozart_api/models/bass_management_feature.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator +from mozart_api.models.bass_management import BassManagement + + +class BassManagementFeature(BaseModel): + """ + BassManagementFeature + """ + + 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"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value not in ("on", "off"): + raise ValueError("must be one of enum values ('on', 'off')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 BassManagementFeature.parse_obj(obj) + + _obj = BassManagementFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/bass_management_range.py b/python_client/mozart_api/models/bass_management_range.py new file mode 100644 index 0000000..7a538d3 --- /dev/null +++ b/python_client/mozart_api/models/bass_management_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.bass_management import BassManagement + + +class BassManagementRange(BaseModel): + """ + BassManagementRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 BassManagementRange.parse_obj(obj) + + _obj = BassManagementRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/bass_range.py b/python_client/mozart_api/models/bass_range.py new file mode 100644 index 0000000..42569aa --- /dev/null +++ b/python_client/mozart_api/models/bass_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.bass import Bass + + +class BassRange(BaseModel): + """ + BassRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 BassRange.parse_obj(obj) + + _obj = BassRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/battery_state.py b/python_client/mozart_api/models/battery_state.py new file mode 100644 index 0000000..3217799 --- /dev/null +++ b/python_client/mozart_api/models/battery_state.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictInt + + +class BatteryState(BaseModel): + """ + BatteryState + """ + + battery_level: Optional[StrictInt] = Field( + None, alias="batteryLevel", description="Batterylevel in percent " + ) + is_charging: Optional[StrictBool] = Field(None, alias="isCharging") + remaining_charging_time_minutes: Optional[StrictInt] = Field( + None, + alias="remainingChargingTimeMinutes", + description="Remaining charging time in minutes", + ) + remaining_playing_time_minutes: Optional[StrictInt] = Field( + None, + alias="remainingPlayingTimeMinutes", + description="Remaining playing time in minutes", + ) + __properties = [ + "batteryLevel", + "isCharging", + "remainingChargingTimeMinutes", + "remainingPlayingTimeMinutes", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BatteryState: + """Create an instance of BatteryState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BatteryState.parse_obj(obj) + + _obj = BatteryState.parse_obj( + { + "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 new file mode 100644 index 0000000..7cd87a9 --- /dev/null +++ b/python_client/mozart_api/models/beo_remote_button.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator + + +class BeoRemoteButton(BaseModel): + """ + BeoRemoteButton + """ + + key: Optional[StrictStr] = Field(None, alias="Key") + type: Optional[StrictStr] = Field(None, alias="Type") + __properties = ["Key", "Type"] + + @validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("KeyPress", "KeyRelease"): + raise ValueError("must be one of enum values ('KeyPress', 'KeyRelease')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BeoRemoteButton: + """Create an instance of BeoRemoteButton from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeoRemoteButton.parse_obj(obj) + + _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 new file mode 100644 index 0000000..39fb649 --- /dev/null +++ b/python_client/mozart_api/models/beolink_available_listener.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr + + +class BeolinkAvailableListener(BaseModel): + """ + BeolinkAvailableListener + """ + + jid: StrictStr = Field(..., description="Beolink peer ID") + __properties = ["jid"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BeolinkAvailableListener: + """Create an instance of BeolinkAvailableListener from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkAvailableListener.parse_obj(obj) + + _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 new file mode 100644 index 0000000..ba0cb1a --- /dev/null +++ b/python_client/mozart_api/models/beolink_experience.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, validator + + +class BeolinkExperience(BaseModel): + """ + BeolinkExperience + """ + + 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"' + ) + name: StrictStr = Field( + ..., description='Experience name, e.g. "Bluetooth" or "B&O Radio"' + ) + product_friendly_name: Optional[StrictStr] = Field( + None, alias="productFriendlyName", description="Optional product friendly name" + ) + source_friendly_name: Optional[StrictStr] = Field( + 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", + ) + unique_source_id: StrictStr = Field( + ..., + alias="uniqueSourceId", + description="The actual device jabber id that the experience comes from", + ) + __properties = [ + "category", + "id", + "linkable", + "name", + "productFriendlyName", + "sourceFriendlyName", + "type", + "uniqueSourceId", + ] + + @validator("category") + def category_validate_enum(cls, value): + """Validates the enum""" + if value not in ("TV", "RADIO", "MUSIC", "MEDIA", "UNKNOWN"): + raise ValueError( + "must be one of enum values ('TV', 'RADIO', 'MUSIC', 'MEDIA', 'UNKNOWN')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BeolinkExperience: + """Create an instance of BeolinkExperience from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkExperience.parse_obj(obj) + + _obj = BeolinkExperience.parse_obj( + { + "category": obj.get("category"), + "id": obj.get("id"), + "linkable": obj.get("linkable"), + "name": obj.get("name"), + "product_friendly_name": obj.get("productFriendlyName"), + "source_friendly_name": obj.get("sourceFriendlyName"), + "type": obj.get("type"), + "unique_source_id": obj.get("uniqueSourceId"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/beolink_experiences_request.py b/python_client/mozart_api/models/beolink_experiences_request.py new file mode 100644 index 0000000..b26b0a8 --- /dev/null +++ b/python_client/mozart_api/models/beolink_experiences_request.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr + + +class BeolinkExperiencesRequest(BaseModel): + """ + BeolinkExperiencesRequest + """ + + request_id: StrictStr = Field( + ..., alias="requestID", description="Beolink request ID" + ) + __properties = ["requestID"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> BeolinkExperiencesRequest: + """Create an instance of BeolinkExperiencesRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + 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: dict) -> BeolinkExperiencesRequest: + """Create an instance of BeolinkExperiencesRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkExperiencesRequest.parse_obj(obj) + + _obj = BeolinkExperiencesRequest.parse_obj({"request_id": obj.get("requestID")}) + return _obj diff --git a/python_client/mozart_api/models/beolink_experiences_result.py b/python_client/mozart_api/models/beolink_experiences_result.py new file mode 100644 index 0000000..2550dc9 --- /dev/null +++ b/python_client/mozart_api/models/beolink_experiences_result.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator +from mozart_api.models.beolink_experience import BeolinkExperience + + +class BeolinkExperiencesResult(BaseModel): + """ + BeolinkExperiencesResult + """ + + 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 ", + ) + __properties = ["experiences", "requestID", "status"] + + @validator("status") + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in ("ok", "busy", "timeout"): + raise ValueError("must be one of enum values ('ok', 'busy', 'timeout')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.experiences: + if _item: + _items.append(_item.to_dict()) + _dict["experiences"] = _items + return _dict + + @classmethod + 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 BeolinkExperiencesResult.parse_obj(obj) + + _obj = BeolinkExperiencesResult.parse_obj( + { + "experiences": [ + BeolinkExperience.from_dict(_item) + for _item in obj.get("experiences") + ] + if obj.get("experiences") is not None + else None, + "request_id": obj.get("requestID"), + "status": obj.get("status"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/beolink_join_request.py b/python_client/mozart_api/models/beolink_join_request.py new file mode 100644 index 0000000..91a38bf --- /dev/null +++ b/python_client/mozart_api/models/beolink_join_request.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + + +class BeolinkJoinRequest(BaseModel): + """ + BeolinkJoinRequest + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BeolinkJoinRequest: + """Create an instance of BeolinkJoinRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkJoinRequest.parse_obj(obj) + + _obj = BeolinkJoinRequest.parse_obj( + { + "jid": obj.get("jid"), + "request_id": obj.get("requestID"), + "result": obj.get("result"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/beolink_join_result.py b/python_client/mozart_api/models/beolink_join_result.py new file mode 100644 index 0000000..5d00e2c --- /dev/null +++ b/python_client/mozart_api/models/beolink_join_result.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator + + +class BeolinkJoinResult(BaseModel): + """ + BeolinkJoinResult + """ + + 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"] + + @validator("error") + def error_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + @validator("status") + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in ("idle", "joined", "failed"): + raise ValueError("must be one of enum values ('idle', 'joined', 'failed')") + return value + + @validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in ("join", "joinRequested", "expand", "expandRequested"): + raise ValueError( + "must be one of enum values ('join', 'joinRequested', 'expand', 'expandRequested')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BeolinkJoinResult: + """Create an instance of BeolinkJoinResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkJoinResult.parse_obj(obj) + + _obj = BeolinkJoinResult.parse_obj( + { + "error": obj.get("error"), + "jid": obj.get("jid"), + "request_id": obj.get("requestID"), + "status": obj.get("status"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/beolink_leader.py b/python_client/mozart_api/models/beolink_leader.py new file mode 100644 index 0000000..1ca4d49 --- /dev/null +++ b/python_client/mozart_api/models/beolink_leader.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr + + +class BeolinkLeader(BaseModel): + """ + BeolinkLeader + """ + + friendly_name: StrictStr = Field(..., alias="friendlyName") + jid: StrictStr = Field(..., description="Beolink peer ID") + __properties = ["friendlyName", "jid"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BeolinkLeader: + """Create an instance of BeolinkLeader from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkLeader.parse_obj(obj) + + _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 new file mode 100644 index 0000000..9266bfb --- /dev/null +++ b/python_client/mozart_api/models/beolink_listener.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr + + +class BeolinkListener(BaseModel): + """ + BeolinkListener + """ + + jid: StrictStr = Field(..., description="Beolink peer ID") + __properties = ["jid"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BeolinkListener: + """Create an instance of BeolinkListener from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkListener.parse_obj(obj) + + _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 new file mode 100644 index 0000000..dcb8fd5 --- /dev/null +++ b/python_client/mozart_api/models/beolink_peer.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr + + +class BeolinkPeer(BaseModel): + """ + BeolinkPeer + """ + + friendly_name: StrictStr = Field(..., alias="friendlyName") + jid: StrictStr = Field(..., description="Beolink peer ID") + __properties = ["friendlyName", "jid"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BeolinkPeer: + """Create an instance of BeolinkPeer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BeolinkPeer.parse_obj(obj) + + _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 new file mode 100644 index 0000000..cd9c9f6 --- /dev/null +++ b/python_client/mozart_api/models/bluetooth_device.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictBool, StrictStr + + +class BluetoothDevice(BaseModel): + """ + BluetoothDevice + """ + + address: Optional[StrictStr] = None + connected: Optional[StrictBool] = None + name: Optional[StrictStr] = None + __properties = ["address", "connected", "name"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> BluetoothDevice: + """Create an instance of BluetoothDevice from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return BluetoothDevice.parse_obj(obj) + + _obj = BluetoothDevice.parse_obj( + { + "address": obj.get("address"), + "connected": obj.get("connected"), + "name": obj.get("name"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/bluetooth_device_list.py b/python_client/mozart_api/models/bluetooth_device_list.py new file mode 100644 index 0000000..301ce65 --- /dev/null +++ b/python_client/mozart_api/models/bluetooth_device_list.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, conlist +from mozart_api.models.bluetooth_device import BluetoothDevice + + +class BluetoothDeviceList(BaseModel): + """ + BluetoothDeviceList + """ + + items: Optional[conlist(BluetoothDevice)] = None + __properties = ["items"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + 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 BluetoothDeviceList.parse_obj(obj) + + _obj = BluetoothDeviceList.parse_obj( + { + "items": [ + BluetoothDevice.from_dict(_item) for _item in obj.get("items") + ] + if obj.get("items") is not None + else None + } + ) + return _obj diff --git a/python_client/mozart_api/models/button_event.py b/python_client/mozart_api/models/button_event.py new file mode 100644 index 0000000..796d500 --- /dev/null +++ b/python_client/mozart_api/models/button_event.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + + +class ButtonEvent(BaseModel): + """ + ButtonEvent + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> ButtonEvent: + """Create an instance of ButtonEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ButtonEvent.parse_obj(obj) + + _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 new file mode 100644 index 0000000..9d61858 --- /dev/null +++ b/python_client/mozart_api/models/compression.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr, validator + + +class Compression(BaseModel): + """ + Compression + """ + + value: StrictStr = Field(..., description="Selected compression value") + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value not in ("off", "medium", "maximum"): + raise ValueError("must be one of enum values ('off', 'medium', 'maximum')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Compression: + """Create an instance of Compression from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Compression.parse_obj(obj) + + _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 new file mode 100644 index 0000000..93eac62 --- /dev/null +++ b/python_client/mozart_api/models/compression_feature.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator +from mozart_api.models.compression import Compression + + +class CompressionFeature(BaseModel): + """ + CompressionFeature + """ + + value: StrictStr = Field(..., description="Selected compression value") + default: Compression = Field(...) + range: conlist(Compression, unique_items=True) = Field( + ..., description="compression range" + ) + __properties = ["value", "default", "range"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value not in ("off", "medium", "maximum"): + raise ValueError("must be one of enum values ('off', 'medium', 'maximum')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 CompressionFeature.parse_obj(obj) + + _obj = CompressionFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/compression_range.py b/python_client/mozart_api/models/compression_range.py new file mode 100644 index 0000000..ce3acf5 --- /dev/null +++ b/python_client/mozart_api/models/compression_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.compression import Compression + + +class CompressionRange(BaseModel): + """ + CompressionRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 CompressionRange.parse_obj(obj) + + _obj = CompressionRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/content_item.py b/python_client/mozart_api/models/content_item.py new file mode 100644 index 0000000..de364de --- /dev/null +++ b/python_client/mozart_api/models/content_item.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist, validator +from mozart_api.models.source_type_enum import SourceTypeEnum + + +class ContentItem(BaseModel): + """ + ContentItem + """ + + categories: Optional[conlist(StrictStr)] = None + content_uri: StrictStr = Field(..., alias="contentUri") + label: Optional[StrictStr] = None + source: SourceTypeEnum = Field(...) + __properties = ["categories", "contentUri", "label", "source"] + + @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 ("music", "movie", "tv", "hdmi", "app"): + raise ValueError( + "each list item must be one of ('music', 'movie', 'tv', 'hdmi', 'app')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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: dict) -> ContentItem: + """Create an instance of ContentItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ContentItem.parse_obj(obj) + + _obj = ContentItem.parse_obj( + { + "categories": obj.get("categories"), + "content_uri": obj.get("contentUri"), + "label": obj.get("label"), + "source": SourceTypeEnum.from_dict(obj.get("source")) + if obj.get("source") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/directivity.py b/python_client/mozart_api/models/directivity.py new file mode 100644 index 0000000..544eb3d --- /dev/null +++ b/python_client/mozart_api/models/directivity.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr, validator + + +class Directivity(BaseModel): + """ + Directivity + """ + + value: StrictStr = Field(...) + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Directivity: + """Create an instance of Directivity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Directivity.parse_obj(obj) + + _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 new file mode 100644 index 0000000..c7b742d --- /dev/null +++ b/python_client/mozart_api/models/directivity_feature.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator +from mozart_api.models.directivity import Directivity + + +class DirectivityFeature(BaseModel): + """ + DirectivityFeature + """ + + value: StrictStr = Field(...) + default: Directivity = Field(...) + range: conlist(Directivity, unique_items=True) = Field( + ..., description="Product and role specific list of directivities" + ) + __properties = ["value", "default", "range"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 DirectivityFeature.parse_obj(obj) + + _obj = DirectivityFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/directivity_range.py b/python_client/mozart_api/models/directivity_range.py new file mode 100644 index 0000000..d5a4aea --- /dev/null +++ b/python_client/mozart_api/models/directivity_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.directivity import Directivity + + +class DirectivityRange(BaseModel): + """ + DirectivityRange + """ + + default: Directivity = Field(...) + range: conlist(Directivity, unique_items=True) = Field( + ..., description="Product and role specific list of directivities" + ) + __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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 DirectivityRange.parse_obj(obj) + + _obj = DirectivityRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/error_model.py b/python_client/mozart_api/models/error_model.py new file mode 100644 index 0000000..0a896c1 --- /dev/null +++ b/python_client/mozart_api/models/error_model.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + + +class ErrorModel(BaseModel): + """ + the general error model # noqa: E501 + """ + + error_code: Optional[StrictStr] = Field( + None, + alias="errorCode", + description="A wellknown code that signal the error, can be used by callers ", + ) + error_id: Optional[StrictStr] = Field( + None, + alias="errorId", + description="A unique identifier used to e.g. quick find in logs ", + ) + error_message: Optional[StrictStr] = Field( + None, + alias="errorMessage", + description="A textual representation, human readable and suitable for logs ", + ) + __properties = ["errorCode", "errorId", "errorMessage"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> ErrorModel: + """Create an instance of ErrorModel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ErrorModel.parse_obj(obj) + + _obj = ErrorModel.parse_obj( + { + "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 new file mode 100644 index 0000000..19b3145 --- /dev/null +++ b/python_client/mozart_api/models/fader.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class Fader(BaseModel): + """ + Fader + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Fader: + """Create an instance of Fader from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Fader.parse_obj(obj) + + _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 new file mode 100644 index 0000000..3271623 --- /dev/null +++ b/python_client/mozart_api/models/fader_feature.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.fader import Fader + + +class FaderFeature(BaseModel): + """ + FaderFeature + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 FaderFeature.parse_obj(obj) + + _obj = FaderFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/fader_range.py b/python_client/mozart_api/models/fader_range.py new file mode 100644 index 0000000..2b64881 --- /dev/null +++ b/python_client/mozart_api/models/fader_range.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.fader import Fader + + +class FaderRange(BaseModel): + """ + FaderRange + """ + + default: Fader = Field(...) + range: conlist(Fader, unique_items=True) = Field(..., description="fader 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 FaderRange.parse_obj(obj) + + _obj = FaderRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/hdmi_input.py b/python_client/mozart_api/models/hdmi_input.py new file mode 100644 index 0000000..9b76c6b --- /dev/null +++ b/python_client/mozart_api/models/hdmi_input.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + + +class HdmiInput(BaseModel): + """ + HdmiInput + """ + + content_uri: Optional[StrictStr] = Field( + None, + alias="contentUri", + description="This points to the editable content trigger for this specific hdmi input", + ) + input: Optional[StrictStr] = None + __properties = ["contentUri", "input"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> HdmiInput: + """Create an instance of HdmiInput from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return HdmiInput.parse_obj(obj) + + _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 new file mode 100644 index 0000000..65cbf05 --- /dev/null +++ b/python_client/mozart_api/models/hdmi_video_format.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class HdmiVideoFormat(BaseModel): + """ + HdmiVideoFormat + """ + + 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"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of video_timings + if self.video_timings: + _dict["videoTimings"] = self.video_timings.to_dict() + return _dict + + @classmethod + 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 HdmiVideoFormat.parse_obj(obj) + + _obj = HdmiVideoFormat.parse_obj( + { + "pixel_format": VideoPixelFormat.from_dict(obj.get("pixelFormat")) + if obj.get("pixelFormat") is not None + else None, + "v_ic": obj.get("vIC"), + "video_timings": VideoTimings.from_dict(obj.get("videoTimings")) + if obj.get("videoTimings") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/home_control_uri.py b/python_client/mozart_api/models/home_control_uri.py new file mode 100644 index 0000000..f905cac --- /dev/null +++ b/python_client/mozart_api/models/home_control_uri.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr + + +class HomeControlUri(BaseModel): + """ + HomeControlUri + """ + + uri: Optional[StrictStr] = None + __properties = ["uri"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> HomeControlUri: + """Create an instance of HomeControlUri from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return HomeControlUri.parse_obj(obj) + + _obj = HomeControlUri.parse_obj({"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 new file mode 100644 index 0000000..896745a --- /dev/null +++ b/python_client/mozart_api/models/install_record_id_state.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class InstallRecordIdState(BaseModel): + """ + InstallRecordIdState + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> InstallRecordIdState: + """Create an instance of InstallRecordIdState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return InstallRecordIdState.parse_obj(obj) + + _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 new file mode 100644 index 0000000..5c60254 --- /dev/null +++ b/python_client/mozart_api/models/latency_profile.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("performance", "quality"): + raise ValueError("must be one of enum values ('performance', 'quality')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> LatencyProfile: + """Create an instance of LatencyProfile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return LatencyProfile.parse_obj(obj) + + _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 new file mode 100644 index 0000000..18d3ce8 --- /dev/null +++ b/python_client/mozart_api/models/lge_tv_sound_settings.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, validator + + +class LgeTvSoundSettings(BaseModel): + """ + LgeTvSoundSettings + """ + + digital_output: Optional[StrictStr] = Field(None, alias="digitalOutput") + e_arc: Optional[StrictBool] = Field(None, alias="eArc") + output: Optional[StrictStr] = None + __properties = ["digitalOutput", "eArc", "output"] + + @validator("digital_output") + def digital_output_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("auto", "passThrough", "pcm", "unknown"): + raise ValueError( + "must be one of enum values ('auto', 'passThrough', 'pcm', 'unknown')" + ) + return value + + @validator("output") + def output_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> LgeTvSoundSettings: + """Create an instance of LgeTvSoundSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return LgeTvSoundSettings.parse_obj(obj) + + _obj = LgeTvSoundSettings.parse_obj( + { + "digital_output": obj.get("digitalOutput"), + "e_arc": obj.get("eArc"), + "output": obj.get("output"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/listening_mode.py b/python_client/mozart_api/models/listening_mode.py new file mode 100644 index 0000000..4f998ef --- /dev/null +++ b/python_client/mozart_api/models/listening_mode.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class ListeningMode(BaseModel): + """ + ListeningMode + """ + + 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 = Field(...) + id: conint(strict=True, ge=0) = Field(...) + name: StrictStr = Field(..., description="Friendly name") + origin: Optional[StrictStr] = Field( + None, description="User created, default or an edited default listening mode" + ) + role: StrictStr = Field(..., description="Role a listening mode applies to") + 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 ("user", "default", "edited"): + raise ValueError("must be one of enum values ('user', 'default', 'edited')") + return value + + @validator("role") + def role_validate_enum(cls, value): + """Validates the enum""" + if value not in ("standalone", "multichannel"): + raise ValueError( + "must be one of enum values ('standalone', 'multichannel')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in triggers (list) + _items = [] + if self.triggers: + for _item in self.triggers: + if _item: + _items.append(_item.to_dict()) + _dict["triggers"] = _items + # set to None if client_ctx (nullable) is None + # and __fields_set__ contains the field + if self.client_ctx is None and "client_ctx" in self.__fields_set__: + _dict["clientCtx"] = None + + return _dict + + @classmethod + 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 ListeningMode.parse_obj(obj) + + _obj = ListeningMode.parse_obj( + { + "client_ctx": obj.get("clientCtx"), + "features": ListeningModeFeatures.from_dict(obj.get("features")) + if obj.get("features") is not None + else None, + "id": obj.get("id"), + "name": obj.get("name"), + "origin": obj.get("origin"), + "role": obj.get("role"), + "triggers": [ + ListeningModeTrigger.from_dict(_item) + for _item in obj.get("triggers") + ] + if obj.get("triggers") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/listening_mode_features.py b/python_client/mozart_api/models/listening_mode_features.py new file mode 100644 index 0000000..e78ad96 --- /dev/null +++ b/python_client/mozart_api/models/listening_mode_features.py @@ -0,0 +1,211 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 +from mozart_api.models.compression import Compression +from mozart_api.models.directivity import Directivity +from mozart_api.models.fader import Fader +from mozart_api.models.room_compensation import RoomCompensation +from mozart_api.models.spatial_envelopment import SpatialEnvelopment +from mozart_api.models.spatial_height import SpatialHeight +from mozart_api.models.spatial_processing import SpatialProcessing +from mozart_api.models.spatial_surround import SpatialSurround +from mozart_api.models.spatial_width import SpatialWidth +from mozart_api.models.speech_enhance import SpeechEnhance +from mozart_api.models.tone_touch import ToneTouch + + +class ListeningModeFeatures(BaseModel): + """ + Sound features to apply # noqa: E501 + """ + + ambience: Optional[Ambience] = None + balance: Optional[Balance] = None + 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( + None, alias="roomCompensation" + ) + spatial_envelopment: Optional[SpatialEnvelopment] = Field( + None, alias="spatialEnvelopment" + ) + spatial_height: Optional[SpatialHeight] = Field(None, alias="spatialHeight") + spatial_processing: Optional[SpatialProcessing] = Field( + None, alias="spatialProcessing" + ) + 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", + "compression", + "directivity", + "fader", + "roomCompensation", + "spatialEnvelopment", + "spatialHeight", + "spatialProcessing", + "spatialSurround", + "spatialWidth", + "speechEnhance", + "toneTouch", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of balance + if self.balance: + _dict["balance"] = self.balance.to_dict() + # override the default output from pydantic by calling `to_dict()` of bass_management + if self.bass_management: + _dict["bassManagement"] = self.bass_management.to_dict() + # override the default output from pydantic by calling `to_dict()` of compression + if self.compression: + _dict["compression"] = self.compression.to_dict() + # override the default output from pydantic by calling `to_dict()` of directivity + if self.directivity: + _dict["directivity"] = self.directivity.to_dict() + # override the default output from pydantic by calling `to_dict()` of fader + if self.fader: + _dict["fader"] = self.fader.to_dict() + # override the default output from pydantic by calling `to_dict()` of room_compensation + if self.room_compensation: + _dict["roomCompensation"] = self.room_compensation.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_envelopment + if self.spatial_envelopment: + _dict["spatialEnvelopment"] = self.spatial_envelopment.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_height + if self.spatial_height: + _dict["spatialHeight"] = self.spatial_height.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_processing + if self.spatial_processing: + _dict["spatialProcessing"] = self.spatial_processing.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_surround + if self.spatial_surround: + _dict["spatialSurround"] = self.spatial_surround.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_width + if self.spatial_width: + _dict["spatialWidth"] = self.spatial_width.to_dict() + # override the default output from pydantic by calling `to_dict()` of speech_enhance + if self.speech_enhance: + _dict["speechEnhance"] = self.speech_enhance.to_dict() + # override the default output from pydantic by calling `to_dict()` of tone_touch + if self.tone_touch: + _dict["toneTouch"] = self.tone_touch.to_dict() + return _dict + + @classmethod + 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 ListeningModeFeatures.parse_obj(obj) + + _obj = ListeningModeFeatures.parse_obj( + { + "ambience": Ambience.from_dict(obj.get("ambience")) + if obj.get("ambience") is not None + else None, + "balance": Balance.from_dict(obj.get("balance")) + if obj.get("balance") is not None + else None, + "bass_management": BassManagement.from_dict(obj.get("bassManagement")) + if obj.get("bassManagement") is not None + else None, + "compression": Compression.from_dict(obj.get("compression")) + if obj.get("compression") is not None + else None, + "directivity": Directivity.from_dict(obj.get("directivity")) + if obj.get("directivity") is not None + else None, + "fader": Fader.from_dict(obj.get("fader")) + if obj.get("fader") is not None + else None, + "room_compensation": RoomCompensation.from_dict( + obj.get("roomCompensation") + ) + if obj.get("roomCompensation") is not None + else None, + "spatial_envelopment": SpatialEnvelopment.from_dict( + obj.get("spatialEnvelopment") + ) + if obj.get("spatialEnvelopment") is not None + else None, + "spatial_height": SpatialHeight.from_dict(obj.get("spatialHeight")) + if obj.get("spatialHeight") is not None + else None, + "spatial_processing": SpatialProcessing.from_dict( + obj.get("spatialProcessing") + ) + if obj.get("spatialProcessing") is not None + else None, + "spatial_surround": SpatialSurround.from_dict( + obj.get("spatialSurround") + ) + if obj.get("spatialSurround") is not None + else None, + "spatial_width": SpatialWidth.from_dict(obj.get("spatialWidth")) + if obj.get("spatialWidth") is not None + else None, + "speech_enhance": SpeechEnhance.from_dict(obj.get("speechEnhance")) + if obj.get("speechEnhance") is not None + else None, + "tone_touch": ToneTouch.from_dict(obj.get("toneTouch")) + if obj.get("toneTouch") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/listening_mode_props.py b/python_client/mozart_api/models/listening_mode_props.py new file mode 100644 index 0000000..e301af1 --- /dev/null +++ b/python_client/mozart_api/models/listening_mode_props.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class ListeningModeProps(BaseModel): + """ + ListeningModeProps + """ + + 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[conint(strict=True, ge=0)] = None + name: Optional[StrictStr] = Field(None, description="Friendly name") + origin: Optional[StrictStr] = Field( + None, description="User created, default or an edited default listening mode" + ) + role: Optional[StrictStr] = Field( + None, description="Role a listening mode applies to" + ) + 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 ("user", "default", "edited"): + raise ValueError("must be one of enum values ('user', 'default', 'edited')") + return value + + @validator("role") + def role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("standalone", "multichannel"): + raise ValueError( + "must be one of enum values ('standalone', 'multichannel')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in triggers (list) + _items = [] + if self.triggers: + for _item in self.triggers: + if _item: + _items.append(_item.to_dict()) + _dict["triggers"] = _items + # set to None if client_ctx (nullable) is None + # and __fields_set__ contains the field + if self.client_ctx is None and "client_ctx" in self.__fields_set__: + _dict["clientCtx"] = None + + return _dict + + @classmethod + 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 ListeningModeProps.parse_obj(obj) + + _obj = ListeningModeProps.parse_obj( + { + "client_ctx": obj.get("clientCtx"), + "features": ListeningModeFeatures.from_dict(obj.get("features")) + if obj.get("features") is not None + else None, + "id": obj.get("id"), + "name": obj.get("name"), + "origin": obj.get("origin"), + "role": obj.get("role"), + "triggers": [ + ListeningModeTrigger.from_dict(_item) + for _item in obj.get("triggers") + ] + if obj.get("triggers") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/listening_mode_ref.py b/python_client/mozart_api/models/listening_mode_ref.py new file mode 100644 index 0000000..5b3f170 --- /dev/null +++ b/python_client/mozart_api/models/listening_mode_ref.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, conint + + +class ListeningModeRef(BaseModel): + """ + 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. ", + ) + 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 = ["href", "id"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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 __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: dict) -> ListeningModeRef: + """Create an instance of ListeningModeRef from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ListeningModeRef.parse_obj(obj) + + _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 new file mode 100644 index 0000000..5271b5d --- /dev/null +++ b/python_client/mozart_api/models/listening_mode_trigger.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +from inspect import getfullargspec +import json +import pprint +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 + +LISTENINGMODETRIGGER_ONE_OF_SCHEMAS = ["PowerLinkTrigger"] + + +class ListeningModeTrigger(BaseModel): + """ + ListeningModeTrigger + """ + + # data type: PowerLinkTrigger + oneof_schema_1_validator: Optional[PowerLinkTrigger] = None + if TYPE_CHECKING: + actual_instance: Union[PowerLinkTrigger] + else: + actual_instance: Any + one_of_schemas: List[str] = Field(LISTENINGMODETRIGGER_ONE_OF_SCHEMAS, const=True) + + class Config: + validate_assignment = True + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError( + "If a position argument is used, only 1 is allowed to set `actual_instance`" + ) + if kwargs: + raise ValueError( + "If a position argument is used, keyword arguments cannot be used." + ) + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + instance = ListeningModeTrigger.construct() + error_messages = [] + match = 0 + # validate data type: PowerLinkTrigger + if not isinstance(v, PowerLinkTrigger): + error_messages.append( + f"Error! Input type `{type(v)}` is not `PowerLinkTrigger`" + ) + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when setting `actual_instance` in ListeningModeTrigger with oneOf schemas: PowerLinkTrigger. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in ListeningModeTrigger with oneOf schemas: PowerLinkTrigger. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: dict) -> ListeningModeTrigger: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> ListeningModeTrigger: + """Returns the object represented by the json string""" + instance = ListeningModeTrigger.construct() + error_messages = [] + match = 0 + + # deserialize data into PowerLinkTrigger + try: + instance.actual_instance = PowerLinkTrigger.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into ListeningModeTrigger with oneOf schemas: PowerLinkTrigger. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into ListeningModeTrigger with oneOf schemas: PowerLinkTrigger. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + 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) -> dict: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + to_dict = getattr(self.actual_instance, "to_dict", None) + if callable(to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.dict()) diff --git a/python_client/mozart_api/models/loudness.py b/python_client/mozart_api/models/loudness.py new file mode 100644 index 0000000..6c68a3d --- /dev/null +++ b/python_client/mozart_api/models/loudness.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictBool + + +class Loudness(BaseModel): + """ + Loudness + """ + + value: Optional[StrictBool] = None + __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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Loudness: + """Create an instance of Loudness from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Loudness.parse_obj(obj) + + _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 new file mode 100644 index 0000000..4c35b37 --- /dev/null +++ b/python_client/mozart_api/models/microphone_state.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class MicrophoneState(BaseModel): + """ + MicrophoneState + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("on", "off"): + raise ValueError("must be one of enum values ('on', 'off')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> MicrophoneState: + """Create an instance of MicrophoneState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return MicrophoneState.parse_obj(obj) + + _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 new file mode 100644 index 0000000..0e45138 --- /dev/null +++ b/python_client/mozart_api/models/microphones_state.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field +from mozart_api.models.microphone_state import MicrophoneState + + +class MicrophonesState(BaseModel): + """ + state of microphones, both physical switches and software state # noqa: E501 + """ + + microphone_state: Optional[MicrophoneState] = Field(None, alias="microphoneState") + microphone_switch_state: Optional[MicrophoneState] = Field( + None, alias="microphoneSwitchState" + ) + __properties = ["microphoneState", "microphoneSwitchState"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of microphone_switch_state + if self.microphone_switch_state: + _dict["microphoneSwitchState"] = self.microphone_switch_state.to_dict() + return _dict + + @classmethod + 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 MicrophonesState.parse_obj(obj) + + _obj = MicrophonesState.parse_obj( + { + "microphone_state": MicrophoneState.from_dict( + obj.get("microphoneState") + ) + if obj.get("microphoneState") is not None + else None, + "microphone_switch_state": MicrophoneState.from_dict( + obj.get("microphoneSwitchState") + ) + if obj.get("microphoneSwitchState") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/overlay_play_request.py b/python_client/mozart_api/models/overlay_play_request.py new file mode 100644 index 0000000..ba55302 --- /dev/null +++ b/python_client/mozart_api/models/overlay_play_request.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, conint +from mozart_api.models.overlay_play_request_from_usb_from_usb import ( + OverlayPlayRequestFromUsbFromUsb, +) +from mozart_api.models.overlay_play_request_text_to_speech_text_to_speech import ( + OverlayPlayRequestTextToSpeechTextToSpeech, +) +from mozart_api.models.uri import Uri + + +class OverlayPlayRequest(BaseModel): + """ + OverlayPlayRequest + """ + + 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( + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # 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() + # override the default output from pydantic by calling `to_dict()` of from_usb + if self.from_usb: + _dict["fromUsb"] = self.from_usb.to_dict() + # set to None if volume_absolute (nullable) is None + # 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: dict) -> OverlayPlayRequest: + """Create an instance of OverlayPlayRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return OverlayPlayRequest.parse_obj(obj) + + _obj = OverlayPlayRequest.parse_obj( + { + "volume_absolute": obj.get("volumeAbsolute"), + "uri": Uri.from_dict(obj.get("uri")) + if obj.get("uri") is not None + else None, + "text_to_speech": OverlayPlayRequestTextToSpeechTextToSpeech.from_dict( + obj.get("textToSpeech") + ) + if obj.get("textToSpeech") is not None + else None, + "from_usb": OverlayPlayRequestFromUsbFromUsb.from_dict( + obj.get("fromUsb") + ) + if obj.get("fromUsb") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/overlay_play_request_common.py b/python_client/mozart_api/models/overlay_play_request_common.py new file mode 100644 index 0000000..181de15 --- /dev/null +++ b/python_client/mozart_api/models/overlay_play_request_common.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, conint + + +class OverlayPlayRequestCommon(BaseModel): + """ + OverlayPlayRequestCommon + """ + + 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 = ["volumeAbsolute"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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: dict) -> OverlayPlayRequestCommon: + """Create an instance of OverlayPlayRequestCommon from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return OverlayPlayRequestCommon.parse_obj(obj) + + _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 new file mode 100644 index 0000000..908854a --- /dev/null +++ b/python_client/mozart_api/models/overlay_play_request_from_usb.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field +from mozart_api.models.overlay_play_request_from_usb_from_usb import ( + OverlayPlayRequestFromUsbFromUsb, +) + + +class OverlayPlayRequestFromUsb(BaseModel): + """ + OverlayPlayRequestFromUsb + """ + + from_usb: Optional[OverlayPlayRequestFromUsbFromUsb] = Field(None, alias="fromUsb") + __properties = ["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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> OverlayPlayRequestFromUsb: + """Create an instance of OverlayPlayRequestFromUsb from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return OverlayPlayRequestFromUsb.parse_obj(obj) + + _obj = OverlayPlayRequestFromUsb.parse_obj( + { + "from_usb": OverlayPlayRequestFromUsbFromUsb.from_dict( + obj.get("fromUsb") + ) + if obj.get("fromUsb") is not None + else None + } + ) + return _obj 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 new file mode 100644 index 0000000..dde987b --- /dev/null +++ b/python_client/mozart_api/models/overlay_play_request_from_usb_from_usb.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, constr + + +class OverlayPlayRequestFromUsbFromUsb(BaseModel): + """ + OverlayPlayRequestFromUsbFromUsb + """ + + 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 = ["fileLocation"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> OverlayPlayRequestFromUsbFromUsb: + """Create an instance of OverlayPlayRequestFromUsbFromUsb from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return OverlayPlayRequestFromUsbFromUsb.parse_obj(obj) + + _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 new file mode 100644 index 0000000..1c8603a --- /dev/null +++ b/python_client/mozart_api/models/overlay_play_request_text_to_speech.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field +from mozart_api.models.overlay_play_request_text_to_speech_text_to_speech import ( + OverlayPlayRequestTextToSpeechTextToSpeech, +) + + +class OverlayPlayRequestTextToSpeech(BaseModel): + """ + OverlayPlayRequestTextToSpeech + """ + + text_to_speech: Optional[OverlayPlayRequestTextToSpeechTextToSpeech] = Field( + None, alias="textToSpeech" + ) + __properties = ["textToSpeech"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> OverlayPlayRequestTextToSpeech: + """Create an instance of OverlayPlayRequestTextToSpeech from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return OverlayPlayRequestTextToSpeech.parse_obj(obj) + + _obj = OverlayPlayRequestTextToSpeech.parse_obj( + { + "text_to_speech": OverlayPlayRequestTextToSpeechTextToSpeech.from_dict( + obj.get("textToSpeech") + ) + if obj.get("textToSpeech") is not None + else None + } + ) + return _obj 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 new file mode 100644 index 0000000..a5ab8d9 --- /dev/null +++ b/python_client/mozart_api/models/overlay_play_request_text_to_speech_text_to_speech.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + """ + + lang: Optional[StrictStr] = Field( + 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: 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 = ["lang", "text"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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: dict) -> OverlayPlayRequestTextToSpeechTextToSpeech: + """Create an instance of OverlayPlayRequestTextToSpeechTextToSpeech from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return OverlayPlayRequestTextToSpeechTextToSpeech.parse_obj(obj) + + _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 new file mode 100644 index 0000000..8e16238 --- /dev/null +++ b/python_client/mozart_api/models/overlay_play_request_uri.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from mozart_api.models.uri import Uri + + +class OverlayPlayRequestUri(BaseModel): + """ + OverlayPlayRequestUri + """ + + uri: Optional[Uri] = None + __properties = ["uri"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> OverlayPlayRequestUri: + """Create an instance of OverlayPlayRequestUri from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + 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 new file mode 100644 index 0000000..71e69c8 --- /dev/null +++ b/python_client/mozart_api/models/paired_remote.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conint, conlist, validator + + +class PairedRemote(BaseModel): + """ + PairedRemote + """ + + 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(None, alias="dbVersion") + name: StrictStr = Field(...) + serial_number: Optional[StrictStr] = Field(None, alias="serialNumber") + updated: Optional[conlist(StrictStr)] = None + __properties = [ + "address", + "appVersion", + "batteryLevel", + "dbVersion", + "name", + "serialNumber", + "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 ("app", "db"): + raise ValueError("each list item must be one of ('app', 'db')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> PairedRemote: + """Create an instance of PairedRemote from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PairedRemote.parse_obj(obj) + + _obj = PairedRemote.parse_obj( + { + "address": obj.get("address"), + "app_version": obj.get("appVersion"), + "battery_level": obj.get("batteryLevel"), + "db_version": obj.get("dbVersion"), + "name": obj.get("name"), + "serial_number": obj.get("serialNumber"), + "updated": obj.get("updated"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/paired_remote_response.py b/python_client/mozart_api/models/paired_remote_response.py new file mode 100644 index 0000000..c62b0b4 --- /dev/null +++ b/python_client/mozart_api/models/paired_remote_response.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, conlist +from mozart_api.models.paired_remote import PairedRemote + + +class PairedRemoteResponse(BaseModel): + """ + PairedRemoteResponse + """ + + items: Optional[conlist(PairedRemote)] = None + __properties = ["items"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + 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 PairedRemoteResponse.parse_obj(obj) + + _obj = PairedRemoteResponse.parse_obj( + { + "items": [PairedRemote.from_dict(_item) for _item in obj.get("items")] + if obj.get("items") is not None + else None + } + ) + return _obj diff --git a/python_client/mozart_api/models/play_queue_item.py b/python_client/mozart_api/models/play_queue_item.py new file mode 100644 index 0000000..64ccf85 --- /dev/null +++ b/python_client/mozart_api/models/play_queue_item.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class PlayQueueItem(BaseModel): + """ + PlayQueueItem + """ + + index: Optional[StrictInt] = None + metadata: Optional[PlaybackContentMetadata] = None + provider: PlayQueueItemType = Field(...) + start_now_from_position: Optional[StrictInt] = Field( + 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 = Field(...) + uri: StrictStr = Field( + ..., description="This can be url, track id, playlist id, radio id and suchlike" + ) + __properties = [ + "index", + "metadata", + "provider", + "startNowFromPosition", + "type", + "uri", + ] + + @validator("type") + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in ("track", "playlist"): + raise ValueError("must be one of enum values ('track', 'playlist')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of provider + if self.provider: + _dict["provider"] = self.provider.to_dict() + # set to None if start_now_from_position (nullable) is None + # and __fields_set__ contains the field + if ( + self.start_now_from_position is None + and "start_now_from_position" in self.__fields_set__ + ): + _dict["startNowFromPosition"] = None + + return _dict + + @classmethod + 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 PlayQueueItem.parse_obj(obj) + + _obj = PlayQueueItem.parse_obj( + { + "index": obj.get("index"), + "metadata": PlaybackContentMetadata.from_dict(obj.get("metadata")) + if obj.get("metadata") is not None + else None, + "provider": PlayQueueItemType.from_dict(obj.get("provider")) + if obj.get("provider") is not None + else None, + "start_now_from_position": obj.get("startNowFromPosition"), + "type": obj.get("type"), + "uri": obj.get("uri"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/play_queue_item_type.py b/python_client/mozart_api/models/play_queue_item_type.py new file mode 100644 index 0000000..b855811 --- /dev/null +++ b/python_client/mozart_api/models/play_queue_item_type.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr, validator + + +class PlayQueueItemType(BaseModel): + """ + PlayQueueItemType + """ + + value: StrictStr = Field(...) + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value not in ("uri", "dlna", "radio", "deezer", "beoCloud"): + raise ValueError( + "must be one of enum values ('uri', 'dlna', 'radio', 'deezer', 'beoCloud')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> PlayQueueItemType: + """Create an instance of PlayQueueItemType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PlayQueueItemType.parse_obj(obj) + + _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 new file mode 100644 index 0000000..215c155 --- /dev/null +++ b/python_client/mozart_api/models/play_queue_settings.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictBool, StrictStr, validator + + +class PlayQueueSettings(BaseModel): + """ + PlayQueueSettings + """ + + consume: Optional[StrictBool] = None + gapless: Optional[StrictBool] = None + repeat: Optional[StrictStr] = None + shuffle: Optional[StrictBool] = None + __properties = ["consume", "gapless", "repeat", "shuffle"] + + @validator("repeat") + def repeat_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("all", "track", "none"): + raise ValueError("must be one of enum values ('all', 'track', 'none')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> PlayQueueSettings: + """Create an instance of PlayQueueSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PlayQueueSettings.parse_obj(obj) + + _obj = PlayQueueSettings.parse_obj( + { + "consume": obj.get("consume"), + "gapless": obj.get("gapless"), + "repeat": obj.get("repeat"), + "shuffle": obj.get("shuffle"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/playback_content_metadata.py b/python_client/mozart_api/models/playback_content_metadata.py new file mode 100644 index 0000000..40536e1 --- /dev/null +++ b/python_client/mozart_api/models/playback_content_metadata.py @@ -0,0 +1,278 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class PlaybackContentMetadata(BaseModel): + """ + PlaybackContentMetadata + """ + + 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(None, alias="containerName") + encoding: Optional[StrictStr] = None + genre: Optional[StrictStr] = None + id: Optional[StrictInt] = None + input_channel_processing: Optional[StrictStr] = Field( + 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( + None, alias="inputChannels", description="e.g. 5.1" + ) + organization: Optional[StrictStr] = Field( + 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( + None, alias="outputChannelProcessing", description="e.g. downmix" + ) + output_channels: Optional[StrictStr] = Field( + None, alias="outputChannels", description="e.g. 7.1" + ) + 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(None, alias="sourceInternalId") + title: Optional[StrictStr] = None + total_duration: Optional[StrictInt] = Field( + None, + alias="totalDuration", + description="to be removed once all devices and apps are updated", + ) + total_duration_seconds: Optional[StrictInt] = Field( + None, alias="totalDurationSeconds" + ) + track: Optional[StrictInt] = None + track_count: Optional[StrictInt] = Field(None, alias="trackCount") + uri: Optional[StrictStr] = None + __properties = [ + "albumName", + "art", + "artistName", + "bitdepth", + "bitrate", + "containerName", + "encoding", + "genre", + "id", + "inputChannelProcessing", + "inputChannels", + "organization", + "outputChannelProcessing", + "outputChannels", + "queueId", + "remoteLeader", + "remoteSource", + "samplerate", + "source", + "sourceInternalId", + "title", + "totalDuration", + "totalDurationSeconds", + "track", + "trackCount", + "uri", + ] + + @validator("encoding") + def encoding_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + @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 ("dolbySurround", "dolbyAtmos"): + raise ValueError( + "must be one of enum values ('dolbySurround', 'dolbyAtmos')" + ) + return value + + @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 ("Direct", "Downmix", "TrueImage"): + raise ValueError( + "must be one of enum values ('Direct', 'Downmix', 'TrueImage')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.art: + if _item: + _items.append(_item.to_dict()) + _dict["art"] = _items + # override the default output from pydantic by calling `to_dict()` of remote_leader + if self.remote_leader: + _dict["remoteLeader"] = self.remote_leader.to_dict() + # set to None if input_channel_processing (nullable) is None + # and __fields_set__ contains the field + if ( + self.input_channel_processing is None + and "input_channel_processing" in self.__fields_set__ + ): + _dict["inputChannelProcessing"] = None + + # set to None if input_channels (nullable) is None + # 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 __fields_set__ contains the field + if ( + self.output_channel_processing is None + and "output_channel_processing" in self.__fields_set__ + ): + _dict["outputChannelProcessing"] = None + + # set to None if output_channels (nullable) is None + # 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 __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 __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 __fields_set__ contains the field + if ( + self.total_duration_seconds is None + and "total_duration_seconds" in self.__fields_set__ + ): + _dict["totalDurationSeconds"] = None + + return _dict + + @classmethod + 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 PlaybackContentMetadata.parse_obj(obj) + + _obj = PlaybackContentMetadata.parse_obj( + { + "album_name": obj.get("albumName"), + "art": [Art.from_dict(_item) for _item in obj.get("art")] + if obj.get("art") is not None + else None, + "artist_name": obj.get("artistName"), + "bitdepth": obj.get("bitdepth"), + "bitrate": obj.get("bitrate"), + "container_name": obj.get("containerName"), + "encoding": obj.get("encoding"), + "genre": obj.get("genre"), + "id": obj.get("id"), + "input_channel_processing": obj.get("inputChannelProcessing"), + "input_channels": obj.get("inputChannels"), + "organization": obj.get("organization"), + "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, + "remote_source": obj.get("remoteSource"), + "samplerate": obj.get("samplerate"), + "source": obj.get("source"), + "source_internal_id": obj.get("sourceInternalId"), + "title": obj.get("title"), + "total_duration": obj.get("totalDuration"), + "total_duration_seconds": obj.get("totalDurationSeconds"), + "track": obj.get("track"), + "track_count": obj.get("trackCount"), + "uri": obj.get("uri"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/playback_error.py b/python_client/mozart_api/models/playback_error.py new file mode 100644 index 0000000..024ad80 --- /dev/null +++ b/python_client/mozart_api/models/playback_error.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr +from mozart_api.models.playback_content_metadata import PlaybackContentMetadata + + +class PlaybackError(BaseModel): + """ + PlaybackError + """ + + error: Optional[StrictStr] = None + item: Optional[PlaybackContentMetadata] = None + __properties = ["error", "item"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> PlaybackError: + """Create an instance of PlaybackError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PlaybackError.parse_obj(obj) + + _obj = PlaybackError.parse_obj( + { + "error": obj.get("error"), + "item": PlaybackContentMetadata.from_dict(obj.get("item")) + if obj.get("item") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/playback_progress.py b/python_client/mozart_api/models/playback_progress.py new file mode 100644 index 0000000..a252634 --- /dev/null +++ b/python_client/mozart_api/models/playback_progress.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr + + +class PlaybackProgress(BaseModel): + """ + PlaybackProgress + """ + + id: Optional[StrictStr] = None + progress: Optional[StrictInt] = None + total_duration: Optional[StrictInt] = Field(None, alias="totalDuration") + __properties = ["id", "progress", "totalDuration"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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: dict) -> PlaybackProgress: + """Create an instance of PlaybackProgress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PlaybackProgress.parse_obj(obj) + + _obj = PlaybackProgress.parse_obj( + { + "id": obj.get("id"), + "progress": obj.get("progress"), + "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 new file mode 100644 index 0000000..e549efb --- /dev/null +++ b/python_client/mozart_api/models/playback_state.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class PlaybackState(BaseModel): + """ + PlaybackState + """ + + metadata: Optional[PlaybackContentMetadata] = None + progress: Optional[PlaybackProgress] = None + source: Optional[Source] = None + state: Optional[RenderingState] = None + __properties = ["metadata", "progress", "source", "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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of progress + if self.progress: + _dict["progress"] = self.progress.to_dict() + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict["source"] = self.source.to_dict() + # 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: dict) -> PlaybackState: + """Create an instance of PlaybackState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PlaybackState.parse_obj(obj) + + _obj = PlaybackState.parse_obj( + { + "metadata": PlaybackContentMetadata.from_dict(obj.get("metadata")) + if obj.get("metadata") is not None + else None, + "progress": PlaybackProgress.from_dict(obj.get("progress")) + if obj.get("progress") is not None + else None, + "source": Source.from_dict(obj.get("source")) + if obj.get("source") is not None + else None, + "state": RenderingState.from_dict(obj.get("state")) + if obj.get("state") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/power_link_trigger.py b/python_client/mozart_api/models/power_link_trigger.py new file mode 100644 index 0000000..b33cacb --- /dev/null +++ b/python_client/mozart_api/models/power_link_trigger.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt + + +class PowerLinkTrigger(BaseModel): + """ + PowerLinkTrigger + """ + + power_link_preset: Optional[StrictInt] = Field( + None, alias="powerLinkPreset", description="PowerLink preset" + ) + __properties = ["powerLinkPreset"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> PowerLinkTrigger: + """Create an instance of PowerLinkTrigger from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PowerLinkTrigger.parse_obj(obj) + + _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 new file mode 100644 index 0000000..e524d10 --- /dev/null +++ b/python_client/mozart_api/models/power_state_enum.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class PowerStateEnum(BaseModel): + """ + PowerStateEnum + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("networkStandby", "on", "standby", "shutdown", "storage"): + raise ValueError( + "must be one of enum values ('networkStandby', 'on', 'standby', 'shutdown', 'storage')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> PowerStateEnum: + """Create an instance of PowerStateEnum from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return PowerStateEnum.parse_obj(obj) + + _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 new file mode 100644 index 0000000..827acd3 --- /dev/null +++ b/python_client/mozart_api/models/preset.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class Preset(BaseModel): + """ + Preset + """ + + action_list: Optional[conlist(Action)] = Field( + None, + alias="actionList", + description="An ordered list of Actions to run on the product", + ) + 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 = [ + "actionList", + "sceneList", + "content", + "id", + "name", + "source", + "title", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.action_list: + if _item: + _items.append(_item.to_dict()) + _dict["actionList"] = _items + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict["content"] = self.content.to_dict() + # 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 name (nullable) is None + # 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: dict) -> Preset: + """Create an instance of Preset from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Preset.parse_obj(obj) + + _obj = Preset.parse_obj( + { + "action_list": [ + Action.from_dict(_item) for _item in obj.get("actionList") + ] + if obj.get("actionList") is not None + else None, + "scene_list": obj.get("sceneList"), + "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.get("source")) + if obj.get("source") is not None + else None, + "title": obj.get("title"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/product_curtain_status.py b/python_client/mozart_api/models/product_curtain_status.py new file mode 100644 index 0000000..7082a35 --- /dev/null +++ b/python_client/mozart_api/models/product_curtain_status.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictBool, StrictStr, validator + + +class ProductCurtainStatus(BaseModel): + """ + ProductCurtainStatus + """ + + moving: Optional[StrictBool] = None + position: Optional[StrictStr] = None + __properties = ["moving", "position"] + + @validator("position") + def position_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("unknown", "closed", "narrow", "wide"): + raise ValueError( + "must be one of enum values ('unknown', 'closed', 'narrow', 'wide')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> ProductCurtainStatus: + """Create an instance of ProductCurtainStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ProductCurtainStatus.parse_obj(obj) + + _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 new file mode 100644 index 0000000..aca474b --- /dev/null +++ b/python_client/mozart_api/models/product_friendly_name.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + + +class ProductFriendlyName(BaseModel): + """ + ProductFriendlyName + """ + + friendly_name: Optional[StrictStr] = Field( + None, + alias="friendlyName", + description="The friendly name of the product, assignable by the end user, e.g. 'Kitchen speaker ", + ) + __properties = ["friendlyName"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> ProductFriendlyName: + """Create an instance of ProductFriendlyName from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ProductFriendlyName.parse_obj(obj) + + _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 new file mode 100644 index 0000000..4190050 --- /dev/null +++ b/python_client/mozart_api/models/product_state.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 +from mozart_api.models.software_update_state import SoftwareUpdateState +from mozart_api.models.sound_settings import SoundSettings +from mozart_api.models.source import Source +from mozart_api.models.tv_state import TvState +from mozart_api.models.volume_state import VolumeState + + +class ProductState(BaseModel): + """ + ProductState + """ + + microphones: Optional[MicrophonesState] = None + playback: Optional[PlaybackState] = None + power_state: Optional[PowerStateEnum] = Field(None, alias="powerState") + software_update_state: Optional[SoftwareUpdateState] = Field( + None, alias="softwareUpdateState" + ) + sound_settings: Optional[SoundSettings] = Field(None, alias="soundSettings") + source: Optional[Source] = None + tv: Optional[TvState] = None + volume: Optional[VolumeState] = None + __properties = [ + "microphones", + "playback", + "powerState", + "softwareUpdateState", + "soundSettings", + "source", + "tv", + "volume", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of playback + if self.playback: + _dict["playback"] = self.playback.to_dict() + # override the default output from pydantic by calling `to_dict()` of power_state + if self.power_state: + _dict["powerState"] = self.power_state.to_dict() + # override the default output from pydantic by calling `to_dict()` of software_update_state + if self.software_update_state: + _dict["softwareUpdateState"] = self.software_update_state.to_dict() + # override the default output from pydantic by calling `to_dict()` of sound_settings + if self.sound_settings: + _dict["soundSettings"] = self.sound_settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict["source"] = self.source.to_dict() + # override the default output from pydantic by calling `to_dict()` of tv + if self.tv: + _dict["tv"] = self.tv.to_dict() + # override the default output from pydantic by calling `to_dict()` of volume + if self.volume: + _dict["volume"] = self.volume.to_dict() + return _dict + + @classmethod + 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 ProductState.parse_obj(obj) + + _obj = ProductState.parse_obj( + { + "microphones": MicrophonesState.from_dict(obj.get("microphones")) + if obj.get("microphones") is not None + else None, + "playback": PlaybackState.from_dict(obj.get("playback")) + if obj.get("playback") is not None + else None, + "power_state": PowerStateEnum.from_dict(obj.get("powerState")) + if obj.get("powerState") is not None + else None, + "software_update_state": SoftwareUpdateState.from_dict( + obj.get("softwareUpdateState") + ) + if obj.get("softwareUpdateState") is not None + else None, + "sound_settings": SoundSettings.from_dict(obj.get("soundSettings")) + if obj.get("soundSettings") is not None + else None, + "source": Source.from_dict(obj.get("source")) + if obj.get("source") is not None + else None, + "tv": TvState.from_dict(obj.get("tv")) + if obj.get("tv") is not None + else None, + "volume": VolumeState.from_dict(obj.get("volume")) + if obj.get("volume") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/remote_menu_item.py b/python_client/mozart_api/models/remote_menu_item.py new file mode 100644 index 0000000..901955d --- /dev/null +++ b/python_client/mozart_api/models/remote_menu_item.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class RemoteMenuItem(BaseModel): + """ + RemoteMenuItem + """ + + action_list: Optional[conlist(Action)] = Field( + None, + alias="actionList", + description="An ordered list of Actions to run on the product", + ) + scene_list: Optional[conlist(StrictStr)] = Field( + None, alias="sceneList", description="A list of scenes" + ) + disabled: Optional[StrictBool] = None + dynamic_list: Optional[StrictStr] = Field( + 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( + None, + alias="firstChildMenuItemId", + description="ID of the first child menu item", + ) + label: Optional[StrictStr] = Field( + None, description="Alternative label, if omitted mozart will try its best" + ) + next_sibling_menu_item_id: Optional[StrictStr] = Field( + None, + alias="nextSiblingMenuItemId", + description="ID of the next sibling menu item", + ) + parent_menu_item_id: Optional[StrictStr] = Field( + 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", + ) + id: StrictStr = Field(..., description="Unique ID for this menu item") + __properties = [ + "actionList", + "sceneList", + "disabled", + "dynamicList", + "firstChildMenuItemId", + "label", + "nextSiblingMenuItemId", + "parentMenuItemId", + "available", + "content", + "fixed", + "id", + ] + + @validator("dynamic_list") + def dynamic_list_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("none", "radioFavorites"): + raise ValueError("must be one of enum values ('none', 'radioFavorites')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.action_list: + if _item: + _items.append(_item.to_dict()) + _dict["actionList"] = _items + # override the default output from pydantic by calling `to_dict()` of content + if self.content: + _dict["content"] = self.content.to_dict() + # set to None if disabled (nullable) is None + # 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 __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 __fields_set__ contains the field + if ( + self.first_child_menu_item_id is None + and "first_child_menu_item_id" in self.__fields_set__ + ): + _dict["firstChildMenuItemId"] = None + + # set to None if label (nullable) is None + # 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 __fields_set__ contains the field + if ( + self.next_sibling_menu_item_id is None + 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 __fields_set__ contains the field + if ( + self.parent_menu_item_id is None + and "parent_menu_item_id" in self.__fields_set__ + ): + _dict["parentMenuItemId"] = None + + # set to None if available (nullable) is None + # 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: dict) -> RemoteMenuItem: + """Create an instance of RemoteMenuItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RemoteMenuItem.parse_obj(obj) + + _obj = RemoteMenuItem.parse_obj( + { + "action_list": [ + Action.from_dict(_item) for _item in obj.get("actionList") + ] + if obj.get("actionList") is not None + else None, + "scene_list": obj.get("sceneList"), + "disabled": obj.get("disabled"), + "dynamic_list": obj.get("dynamicList"), + "first_child_menu_item_id": obj.get("firstChildMenuItemId"), + "label": obj.get("label"), + "next_sibling_menu_item_id": obj.get("nextSiblingMenuItemId"), + "parent_menu_item_id": obj.get("parentMenuItemId"), + "available": obj.get("available"), + "content": ContentItem.from_dict(obj.get("content")) + if obj.get("content") is not None + else None, + "fixed": obj.get("fixed"), + "id": obj.get("id"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/remote_menu_item_properties.py b/python_client/mozart_api/models/remote_menu_item_properties.py new file mode 100644 index 0000000..2dd2c03 --- /dev/null +++ b/python_client/mozart_api/models/remote_menu_item_properties.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, validator +from mozart_api.models.action import Action + + +class RemoteMenuItemProperties(BaseModel): + """ + RemoteMenuItemProperties + """ + + action_list: Optional[conlist(Action)] = Field( + None, + alias="actionList", + description="An ordered list of Actions to run on the product", + ) + scene_list: Optional[conlist(StrictStr)] = Field( + None, alias="sceneList", description="A list of scenes" + ) + disabled: Optional[StrictBool] = None + dynamic_list: Optional[StrictStr] = Field( + 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( + None, + alias="firstChildMenuItemId", + description="ID of the first child menu item", + ) + label: Optional[StrictStr] = Field( + None, description="Alternative label, if omitted mozart will try its best" + ) + next_sibling_menu_item_id: Optional[StrictStr] = Field( + None, + alias="nextSiblingMenuItemId", + description="ID of the next sibling menu item", + ) + parent_menu_item_id: Optional[StrictStr] = Field( + None, alias="parentMenuItemId", description="ID of the parent menu item" + ) + __properties = [ + "actionList", + "sceneList", + "disabled", + "dynamicList", + "firstChildMenuItemId", + "label", + "nextSiblingMenuItemId", + "parentMenuItemId", + ] + + @validator("dynamic_list") + def dynamic_list_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("none", "radioFavorites"): + raise ValueError("must be one of enum values ('none', 'radioFavorites')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.action_list: + if _item: + _items.append(_item.to_dict()) + _dict["actionList"] = _items + # set to None if disabled (nullable) is None + # 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 __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 __fields_set__ contains the field + if ( + self.first_child_menu_item_id is None + and "first_child_menu_item_id" in self.__fields_set__ + ): + _dict["firstChildMenuItemId"] = None + + # set to None if label (nullable) is None + # 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 __fields_set__ contains the field + if ( + self.next_sibling_menu_item_id is None + 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 __fields_set__ contains the field + if ( + self.parent_menu_item_id is None + and "parent_menu_item_id" in self.__fields_set__ + ): + _dict["parentMenuItemId"] = None + + return _dict + + @classmethod + 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 RemoteMenuItemProperties.parse_obj(obj) + + _obj = RemoteMenuItemProperties.parse_obj( + { + "action_list": [ + Action.from_dict(_item) for _item in obj.get("actionList") + ] + if obj.get("actionList") is not None + else None, + "scene_list": obj.get("sceneList"), + "disabled": obj.get("disabled"), + "dynamic_list": obj.get("dynamicList"), + "first_child_menu_item_id": obj.get("firstChildMenuItemId"), + "label": obj.get("label"), + "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 new file mode 100644 index 0000000..91239c9 --- /dev/null +++ b/python_client/mozart_api/models/remote_ui_key_state.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator + + +class RemoteUIKeyState(BaseModel): + """ + RemoteUIKeyState + """ + + state: Optional[StrictStr] = Field( + 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 = ["state"] + + @validator("state") + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("ShortPress", "LongPress", "Down", "Continue", "Release"): + raise ValueError( + "must be one of enum values ('ShortPress', 'LongPress', 'Down', 'Continue', 'Release')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RemoteUIKeyState: + """Create an instance of RemoteUIKeyState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RemoteUIKeyState.parse_obj(obj) + + _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 new file mode 100644 index 0000000..cc10b53 --- /dev/null +++ b/python_client/mozart_api/models/rendering_state.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class RenderingState(BaseModel): + """ + RenderingState + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RenderingState: + """Create an instance of RenderingState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RenderingState.parse_obj(obj) + + _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 new file mode 100644 index 0000000..6421975 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist + + +class RoomCompensation(BaseModel): + """ + RoomCompensation + """ + + 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 = ["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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensation: + """Create an instance of RoomCompensation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensation.parse_obj(obj) + + _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 new file mode 100644 index 0000000..a405d79 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_current_measurement.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + """ + + speaker_id: Optional[StrictStr] = Field(None, alias="speakerId") + state: Optional[StrictStr] = Field( + 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 = ["speakerId", "state"] + + @validator("state") + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("started", "done", "lastDone", "error"): + raise ValueError( + "must be one of enum values ('started', 'done', 'lastDone', 'error')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationCurrentMeasurement: + """Create an instance of RoomCompensationCurrentMeasurement from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationCurrentMeasurement.parse_obj(obj) + + _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 new file mode 100644 index 0000000..1e94710 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_debug.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictBool + + +class RoomCompensationDebug(BaseModel): + """ + RoomCompensationDebug + """ + + value: Optional[StrictBool] = None + __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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationDebug: + """Create an instance of RoomCompensationDebug from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationDebug.parse_obj(obj) + + _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 new file mode 100644 index 0000000..3da4899 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_enabled.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictBool + + +class RoomCompensationEnabled(BaseModel): + """ + RoomCompensationEnabled + """ + + value: Optional[StrictBool] = None + __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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationEnabled: + """Create an instance of RoomCompensationEnabled from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationEnabled.parse_obj(obj) + + _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 new file mode 100644 index 0000000..9700f82 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_error_details.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, conlist +from mozart_api.models.room_compensation_measurement_error import ( + RoomCompensationMeasurementError, +) + + +class RoomCompensationErrorDetails(BaseModel): + """ + RoomCompensationErrorDetails + """ + + error_list: Optional[conlist(RoomCompensationMeasurementError)] = Field( + None, + alias="errorList", + description="List of the speakers where measurement failed, including error type.", + ) + __properties = ["errorList"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.error_list: + if _item: + _items.append(_item.to_dict()) + _dict["errorList"] = _items + return _dict + + @classmethod + 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 RoomCompensationErrorDetails.parse_obj(obj) + + _obj = RoomCompensationErrorDetails.parse_obj( + { + "error_list": [ + RoomCompensationMeasurementError.from_dict(_item) + for _item in obj.get("errorList") + ] + if obj.get("errorList") is not None + else None + } + ) + return _obj diff --git a/python_client/mozart_api/models/room_compensation_feature.py b/python_client/mozart_api/models/room_compensation_feature.py new file mode 100644 index 0000000..b871f5a --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_feature.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conint, conlist + + +class RoomCompensationFeature(BaseModel): + """ + RoomCompensationFeature + """ + + 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: 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[conint(strict=True, le=20, ge=1)] = Field( + None, + alias="maxItems", + description="Maximum number of items in the `value` field", + ) + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationFeature: + """Create an instance of RoomCompensationFeature from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationFeature.parse_obj(obj) + + _obj = RoomCompensationFeature.parse_obj( + { + "value": obj.get("value"), + "default": obj.get("default"), + "max_items": obj.get("maxItems"), + "range": obj.get("range"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/room_compensation_info.py b/python_client/mozart_api/models/room_compensation_info.py new file mode 100644 index 0000000..69e8ff9 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_info.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class RoomCompensationInfo(BaseModel): + """ + RoomCompensationInfo + """ + + debug: Optional[RoomCompensationDebug] = None + enabled: Optional[RoomCompensationEnabled] = None + 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 = ["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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of enabled + if self.enabled: + _dict["enabled"] = self.enabled.to_dict() + # override the default output from pydantic by calling `to_dict()` of last_result + if self.last_result: + _dict["lastResult"] = self.last_result.to_dict() + # override the default output from pydantic by calling `to_dict()` of last_run + if self.last_run: + _dict["lastRun"] = self.last_run.to_dict() + # override the default output from pydantic by calling `to_dict()` of type + if self.type: + _dict["type"] = self.type.to_dict() + # override the default output from pydantic by calling `to_dict()` of version + if self.version: + _dict["version"] = self.version.to_dict() + return _dict + + @classmethod + 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 RoomCompensationInfo.parse_obj(obj) + + _obj = RoomCompensationInfo.parse_obj( + { + "debug": RoomCompensationDebug.from_dict(obj.get("debug")) + if obj.get("debug") is not None + else None, + "enabled": RoomCompensationEnabled.from_dict(obj.get("enabled")) + if obj.get("enabled") is not None + else None, + "last_result": RoomCompensationResult.from_dict(obj.get("lastResult")) + if obj.get("lastResult") is not None + else None, + "last_run": RoomCompensationState.from_dict(obj.get("lastRun")) + if obj.get("lastRun") is not None + else None, + "type": RoomCompensationType.from_dict(obj.get("type")) + if obj.get("type") is not None + else None, + "version": RoomCompensationVersion.from_dict(obj.get("version")) + if obj.get("version") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/room_compensation_measurement_error.py b/python_client/mozart_api/models/room_compensation_measurement_error.py new file mode 100644 index 0000000..f19eabf --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_measurement_error.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator + + +class RoomCompensationMeasurementError(BaseModel): + """ + RoomCompensationMeasurementError + """ + + error: Optional[StrictStr] = Field( + 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(None, alias="speakerId") + __properties = ["error", "speakerId"] + + @validator("error") + def error_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationMeasurementError: + """Create an instance of RoomCompensationMeasurementError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationMeasurementError.parse_obj(obj) + + _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 new file mode 100644 index 0000000..9ab6083 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_properties.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, conint, conlist, validator +from mozart_api.models.latency_profile import LatencyProfile + + +class RoomCompensationProperties(BaseModel): + """ + RoomCompensationProperties + """ + + value: Optional[StrictStr] = Field( + 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( + 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( + 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(None, alias="latencyProfile") + skip_automatic_role_assignment: Optional[StrictBool] = Field( + None, + alias="skipAutomaticRoleAssignment", + description="Skip calculation of automatic role assignment.", + ) + 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[conint(strict=True, le=255, ge=0)] = Field( + None, + alias="speakerPreset", + description="The Powerlink preset to use for the external PL/WPL speakers.", + ) + __properties = [ + "value", + "action", + "continueOnError", + "latencyProfile", + "skipAutomaticRoleAssignment", + "speakerList", + "speakerPreset", + ] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("simple", "advanced"): + raise ValueError("must be one of enum values ('simple', 'advanced')") + return value + + @validator("action") + def action_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("runAll", "continue", "useSpeakerList"): + raise ValueError( + "must be one of enum values ('runAll', 'continue', 'useSpeakerList')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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 __fields_set__ contains the field + if ( + self.continue_on_error is None + and "continue_on_error" in self.__fields_set__ + ): + _dict["continueOnError"] = None + + # set to None if skip_automatic_role_assignment (nullable) is None + # and __fields_set__ contains the field + if ( + self.skip_automatic_role_assignment is None + and "skip_automatic_role_assignment" in self.__fields_set__ + ): + _dict["skipAutomaticRoleAssignment"] = None + + # set to None if speaker_list (nullable) is None + # 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 __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: dict) -> RoomCompensationProperties: + """Create an instance of RoomCompensationProperties from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationProperties.parse_obj(obj) + + _obj = RoomCompensationProperties.parse_obj( + { + "value": obj.get("value"), + "action": obj.get("action"), + "continue_on_error": obj.get("continueOnError"), + "latency_profile": LatencyProfile.from_dict(obj.get("latencyProfile")) + if obj.get("latencyProfile") is not None + else None, + "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 new file mode 100644 index 0000000..81ff8b3 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_range.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conint, conlist + + +class RoomCompensationRange(BaseModel): + """ + RoomCompensationRange + """ + + 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[conint(strict=True, le=20, ge=1)] = Field( + None, + alias="maxItems", + description="Maximum number of items in the `value` field", + ) + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationRange: + """Create an instance of RoomCompensationRange from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationRange.parse_obj(obj) + + _obj = RoomCompensationRange.parse_obj( + { + "default": obj.get("default"), + "max_items": obj.get("maxItems"), + "range": obj.get("range"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/room_compensation_response.py b/python_client/mozart_api/models/room_compensation_response.py new file mode 100644 index 0000000..3461231 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_response.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt + + +class RoomCompensationResponse(BaseModel): + """ + RoomCompensationResponse + """ + + frequency: Optional[StrictInt] = None + gain: Optional[Union[StrictFloat, StrictInt]] = None + __properties = ["frequency", "gain"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationResponse: + """Create an instance of RoomCompensationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationResponse.parse_obj(obj) + + _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 new file mode 100644 index 0000000..28cb12c --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_result.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +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 + + +class RoomCompensationResult(BaseModel): + """ + RoomCompensationResult + """ + + compensation: Optional[conlist(RoomCompensationResponse)] = None + measured_response: Optional[conlist(RoomCompensationResponse)] = Field( + None, alias="measuredResponse" + ) + placement: Optional[StrictStr] = None + reference_response: Optional[conlist(RoomCompensationResponse)] = Field( + None, alias="referenceResponse" + ) + speaker_group_suggestion: Optional[SpeakerGroup] = Field( + None, alias="speakerGroupSuggestion" + ) + time_stamp: Optional[datetime] = Field(None, alias="timeStamp") + __properties = [ + "compensation", + "measuredResponse", + "placement", + "referenceResponse", + "speakerGroupSuggestion", + "timeStamp", + ] + + @validator("placement") + def placement_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("free", "nearWall", "unknown"): + raise ValueError( + "must be one of enum values ('free', 'nearWall', 'unknown')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.compensation: + if _item: + _items.append(_item.to_dict()) + _dict["compensation"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in measured_response (list) + _items = [] + if self.measured_response: + for _item in self.measured_response: + if _item: + _items.append(_item.to_dict()) + _dict["measuredResponse"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in reference_response (list) + _items = [] + if self.reference_response: + for _item in self.reference_response: + if _item: + _items.append(_item.to_dict()) + _dict["referenceResponse"] = _items + # override the default output from pydantic by calling `to_dict()` of speaker_group_suggestion + if self.speaker_group_suggestion: + _dict["speakerGroupSuggestion"] = self.speaker_group_suggestion.to_dict() + return _dict + + @classmethod + 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 RoomCompensationResult.parse_obj(obj) + + _obj = RoomCompensationResult.parse_obj( + { + "compensation": [ + RoomCompensationResponse.from_dict(_item) + for _item in obj.get("compensation") + ] + if obj.get("compensation") is not None + else None, + "measured_response": [ + RoomCompensationResponse.from_dict(_item) + for _item in obj.get("measuredResponse") + ] + if obj.get("measuredResponse") is not None + else None, + "placement": obj.get("placement"), + "reference_response": [ + RoomCompensationResponse.from_dict(_item) + for _item in obj.get("referenceResponse") + ] + if obj.get("referenceResponse") is not None + else None, + "speaker_group_suggestion": SpeakerGroup.from_dict( + obj.get("speakerGroupSuggestion") + ) + if obj.get("speakerGroupSuggestion") is not None + else None, + "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 new file mode 100644 index 0000000..52af9ee --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_state.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +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 + + +class RoomCompensationState(BaseModel): + """ + RoomCompensationState + """ + + state: Optional[StrictStr] = None + error: Optional[StrictStr] = Field( + 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( + None, alias="errorDetails" + ) + last_run_available: Optional[StrictBool] = Field( + 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(None, alias="timeStamp") + __properties = [ + "state", + "error", + "errorDetails", + "lastRunAvailable", + "properties", + "timeStamp", + ] + + @validator("state") + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("notStarted", "running", "done", "error", "stopped"): + raise ValueError( + "must be one of enum values ('notStarted', 'running', 'done', 'error', 'stopped')" + ) + return value + + @validator("error") + def error_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of properties + if self.properties: + _dict["properties"] = self.properties.to_dict() + return _dict + + @classmethod + 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 RoomCompensationState.parse_obj(obj) + + _obj = RoomCompensationState.parse_obj( + { + "state": obj.get("state"), + "error": obj.get("error"), + "error_details": RoomCompensationErrorDetails.from_dict( + obj.get("errorDetails") + ) + if obj.get("errorDetails") is not None + else None, + "last_run_available": obj.get("lastRunAvailable"), + "properties": RoomCompensationProperties.from_dict( + obj.get("properties") + ) + if obj.get("properties") is not None + else None, + "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 new file mode 100644 index 0000000..839d989 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_state_value.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class RoomCompensationStateValue(BaseModel): + """ + RoomCompensationStateValue + """ + + state: Optional[StrictStr] = None + __properties = ["state"] + + @validator("state") + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("notStarted", "running", "done", "error", "stopped"): + raise ValueError( + "must be one of enum values ('notStarted', 'running', 'done', 'error', 'stopped')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationStateValue: + """Create an instance of RoomCompensationStateValue from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationStateValue.parse_obj(obj) + + _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 new file mode 100644 index 0000000..e2787f0 --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_type.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator + + +class RoomCompensationType(BaseModel): + """ + RoomCompensationType + """ + + value: Optional[StrictStr] = Field( + 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 = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("simple", "advanced"): + raise ValueError("must be one of enum values ('simple', 'advanced')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationType: + """Create an instance of RoomCompensationType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationType.parse_obj(obj) + + _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 new file mode 100644 index 0000000..c66583e --- /dev/null +++ b/python_client/mozart_api/models/room_compensation_version.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, conint + + +class RoomCompensationVersion(BaseModel): + """ + RoomCompensationVersion + """ + + algorithm: Optional[conint(strict=True, ge=0)] = None + coefficients: Optional[conint(strict=True, ge=0)] = None + __properties = ["algorithm", "coefficients"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> RoomCompensationVersion: + """Create an instance of RoomCompensationVersion from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return RoomCompensationVersion.parse_obj(obj) + + _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 new file mode 100644 index 0000000..30393e4 --- /dev/null +++ b/python_client/mozart_api/models/scene.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist, constr, validator +from mozart_api.models.action import Action + + +class Scene(BaseModel): + """ + Scene + """ + + action_list: conlist(Action) = Field( + ..., + alias="actionList", + description="An ordered list of Actions to run on the product", + ) + 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[conlist(StrictStr)] = Field( + None, + description="A list of user defined tags. This allows a client to create virtual lists", + ) + classification: Optional[StrictStr] = Field( + None, description="The classification of Scene" + ) + __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 ("system", "userDefined"): + raise ValueError("must be one of enum values ('system', 'userDefined')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.action_list: + if _item: + _items.append(_item.to_dict()) + _dict["actionList"] = _items + # set to None if client_context (nullable) is None + # 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 __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 __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: dict) -> Scene: + """Create an instance of Scene from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Scene.parse_obj(obj) + + _obj = Scene.parse_obj( + { + "action_list": [ + Action.from_dict(_item) for _item in obj.get("actionList") + ] + if obj.get("actionList") is not None + else None, + "client_context": obj.get("clientContext"), + "label": obj.get("label"), + "tags": obj.get("tags"), + "classification": obj.get("classification"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/scene_classification.py b/python_client/mozart_api/models/scene_classification.py new file mode 100644 index 0000000..c59917c --- /dev/null +++ b/python_client/mozart_api/models/scene_classification.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr, validator + + +class SceneClassification(BaseModel): + """ + SceneClassification + """ + + classification: Optional[StrictStr] = Field( + None, description="The classification of Scene" + ) + __properties = ["classification"] + + @validator("classification") + def classification_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("system", "userDefined"): + raise ValueError("must be one of enum values ('system', 'userDefined')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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: dict) -> SceneClassification: + """Create an instance of SceneClassification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SceneClassification.parse_obj(obj) + + _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 new file mode 100644 index 0000000..a507813 --- /dev/null +++ b/python_client/mozart_api/models/scene_match.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist + + +class SceneMatch(BaseModel): + """ + SceneMatch + """ + + label: Optional[StrictStr] = None + tags: Optional[conlist(StrictStr)] = Field( + None, + description="A list of user defined tags. This allows a client to create virtual lists", + ) + __properties = ["label", "tags"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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: dict) -> SceneMatch: + """Create an instance of SceneMatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SceneMatch.parse_obj(obj) + + _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 new file mode 100644 index 0000000..ca0b598 --- /dev/null +++ b/python_client/mozart_api/models/scene_properties.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist, constr +from mozart_api.models.action import Action + + +class SceneProperties(BaseModel): + """ + SceneProperties + """ + + action_list: conlist(Action) = Field( + ..., + alias="actionList", + description="An ordered list of Actions to run on the product", + ) + 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[conlist(StrictStr)] = Field( + None, + description="A list of user defined tags. This allows a client to create virtual lists", + ) + __properties = ["actionList", "clientContext", "label", "tags"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.action_list: + if _item: + _items.append(_item.to_dict()) + _dict["actionList"] = _items + # set to None if client_context (nullable) is None + # 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 __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: dict) -> SceneProperties: + """Create an instance of SceneProperties from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SceneProperties.parse_obj(obj) + + _obj = SceneProperties.parse_obj( + { + "action_list": [ + Action.from_dict(_item) for _item in obj.get("actionList") + ] + if obj.get("actionList") is not None + else None, + "client_context": obj.get("clientContext"), + "label": obj.get("label"), + "tags": obj.get("tags"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/scene_trigger_base_properties.py b/python_client/mozart_api/models/scene_trigger_base_properties.py new file mode 100644 index 0000000..489b2eb --- /dev/null +++ b/python_client/mozart_api/models/scene_trigger_base_properties.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, Field, StrictStr, conlist +from mozart_api.models.action import Action + + +class SceneTriggerBaseProperties(BaseModel): + """ + Base properties for a scene trigger # noqa: E501 + """ + + action_list: Optional[conlist(Action)] = Field( + None, + alias="actionList", + description="An ordered list of Actions to run on the product", + ) + scene_list: Optional[conlist(StrictStr)] = Field( + None, alias="sceneList", description="A list of scenes" + ) + __properties = ["actionList", "sceneList"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.action_list: + if _item: + _items.append(_item.to_dict()) + _dict["actionList"] = _items + return _dict + + @classmethod + 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 SceneTriggerBaseProperties.parse_obj(obj) + + _obj = SceneTriggerBaseProperties.parse_obj( + { + "action_list": [ + Action.from_dict(_item) for _item in obj.get("actionList") + ] + if obj.get("actionList") is not None + else None, + "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 new file mode 100644 index 0000000..56ed0c2 --- /dev/null +++ b/python_client/mozart_api/models/software_update_state.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr, validator + + +class SoftwareUpdateState(BaseModel): + """ + SoftwareUpdateState + """ + + seconds_remaining: Optional[StrictInt] = Field(None, alias="secondsRemaining") + value: Optional[StrictStr] = None + __properties = ["secondsRemaining", "value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ( + "idle", + "checking", + "updateCheckFailed", + "noUpdatesAvailable", + "updateAvailable", + "downloadingUpdate", + "updateDownloaded", + "downloadFailed", + "installingUpdate", + "installationFailed", + "installationDonePendingReboot", + "schedulerFailed", + "rebooting", + ): + raise ValueError( + "must be one of enum values ('idle', 'checking', 'updateCheckFailed', 'noUpdatesAvailable', 'updateAvailable', 'downloadingUpdate', 'updateDownloaded', 'downloadFailed', 'installingUpdate', 'installationFailed', 'installationDonePendingReboot', 'schedulerFailed', 'rebooting')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SoftwareUpdateState: + """Create an instance of SoftwareUpdateState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SoftwareUpdateState.parse_obj(obj) + + _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 new file mode 100644 index 0000000..f202311 --- /dev/null +++ b/python_client/mozart_api/models/software_update_status.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr +from mozart_api.models.software_update_state import SoftwareUpdateState + + +class SoftwareUpdateStatus(BaseModel): + """ + SoftwareUpdateStatus + """ + + 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") + __properties = [ + "availableUpdate", + "lastCheck", + "lastUpdate", + "softwareVersion", + "state", + "updateProgress", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SoftwareUpdateStatus: + """Create an instance of SoftwareUpdateStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SoftwareUpdateStatus.parse_obj(obj) + + _obj = SoftwareUpdateStatus.parse_obj( + { + "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.get("state")) + if obj.get("state") is not None + else None, + "update_progress": obj.get("updateProgress"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/sound_adjustments.py b/python_client/mozart_api/models/sound_adjustments.py new file mode 100644 index 0000000..16cd0a1 --- /dev/null +++ b/python_client/mozart_api/models/sound_adjustments.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional, Union +from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr + + +class SoundAdjustments(BaseModel): + """ + SoundAdjustments + """ + + ambience: Optional[Union[StrictFloat, StrictInt]] = None + bass: Optional[StrictInt] = None + directivity: Optional[StrictStr] = None + eco_mode: Optional[StrictBool] = Field(None, alias="ecoMode") + fadein: Optional[StrictBool] = None + loudness: Optional[StrictBool] = None + treble: Optional[StrictInt] = None + __properties = [ + "ambience", + "bass", + "directivity", + "ecoMode", + "fadein", + "loudness", + "treble", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SoundAdjustments: + """Create an instance of SoundAdjustments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SoundAdjustments.parse_obj(obj) + + _obj = SoundAdjustments.parse_obj( + { + "ambience": obj.get("ambience"), + "bass": obj.get("bass"), + "directivity": obj.get("directivity"), + "eco_mode": obj.get("ecoMode"), + "fadein": obj.get("fadein"), + "loudness": obj.get("loudness"), + "treble": obj.get("treble"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/sound_feature_set.py b/python_client/mozart_api/models/sound_feature_set.py new file mode 100644 index 0000000..07b72d5 --- /dev/null +++ b/python_client/mozart_api/models/sound_feature_set.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 +from mozart_api.models.bass_management_feature import BassManagementFeature +from mozart_api.models.compression_feature import CompressionFeature +from mozart_api.models.directivity_feature import DirectivityFeature +from mozart_api.models.fader_feature import FaderFeature +from mozart_api.models.room_compensation_feature import RoomCompensationFeature +from mozart_api.models.spatial_envelopment_feature import SpatialEnvelopmentFeature +from mozart_api.models.spatial_height_feature import SpatialHeightFeature +from mozart_api.models.spatial_processing_feature import SpatialProcessingFeature +from mozart_api.models.spatial_surround_feature import SpatialSurroundFeature +from mozart_api.models.spatial_width_feature import SpatialWidthFeature +from mozart_api.models.speech_enhance_feature import SpeechEnhanceFeature +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 + + +class SoundFeatureSet(BaseModel): + """ + SoundFeatureSet + """ + + ambience: Optional[AmbienceFeature] = None + balance: Optional[BalanceFeature] = None + bass: Optional[BassFeature] = None + bass_management: Optional[BassManagementFeature] = Field( + None, alias="bass-management" + ) + compression: Optional[CompressionFeature] = None + directivity: Optional[DirectivityFeature] = None + fader: Optional[FaderFeature] = None + room_compensation: Optional[RoomCompensationFeature] = Field( + None, alias="roomCompensation" + ) + spatial_envelopment: Optional[SpatialEnvelopmentFeature] = Field( + None, alias="spatial-envelopment" + ) + spatial_height: Optional[SpatialHeightFeature] = Field(None, alias="spatial-height") + spatial_processing: Optional[SpatialProcessingFeature] = Field( + None, alias="spatial-processing" + ) + spatial_surround: Optional[SpatialSurroundFeature] = Field( + None, alias="spatial-surround" + ) + 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 = [ + "ambience", + "balance", + "bass", + "bass-management", + "compression", + "directivity", + "fader", + "roomCompensation", + "spatial-envelopment", + "spatial-height", + "spatial-processing", + "spatial-surround", + "spatial-width", + "speech-enhance", + "toneTouchX", + "toneTouchY", + "treble", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of balance + if self.balance: + _dict["balance"] = self.balance.to_dict() + # override the default output from pydantic by calling `to_dict()` of bass + if self.bass: + _dict["bass"] = self.bass.to_dict() + # override the default output from pydantic by calling `to_dict()` of bass_management + if self.bass_management: + _dict["bass-management"] = self.bass_management.to_dict() + # override the default output from pydantic by calling `to_dict()` of compression + if self.compression: + _dict["compression"] = self.compression.to_dict() + # override the default output from pydantic by calling `to_dict()` of directivity + if self.directivity: + _dict["directivity"] = self.directivity.to_dict() + # override the default output from pydantic by calling `to_dict()` of fader + if self.fader: + _dict["fader"] = self.fader.to_dict() + # override the default output from pydantic by calling `to_dict()` of room_compensation + if self.room_compensation: + _dict["roomCompensation"] = self.room_compensation.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_envelopment + if self.spatial_envelopment: + _dict["spatial-envelopment"] = self.spatial_envelopment.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_height + if self.spatial_height: + _dict["spatial-height"] = self.spatial_height.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_processing + if self.spatial_processing: + _dict["spatial-processing"] = self.spatial_processing.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_surround + if self.spatial_surround: + _dict["spatial-surround"] = self.spatial_surround.to_dict() + # override the default output from pydantic by calling `to_dict()` of spatial_width + if self.spatial_width: + _dict["spatial-width"] = self.spatial_width.to_dict() + # override the default output from pydantic by calling `to_dict()` of speech_enhance + if self.speech_enhance: + _dict["speech-enhance"] = self.speech_enhance.to_dict() + # override the default output from pydantic by calling `to_dict()` of tone_touch_x + if self.tone_touch_x: + _dict["toneTouchX"] = self.tone_touch_x.to_dict() + # override the default output from pydantic by calling `to_dict()` of tone_touch_y + if self.tone_touch_y: + _dict["toneTouchY"] = self.tone_touch_y.to_dict() + # override the default output from pydantic by calling `to_dict()` of treble + if self.treble: + _dict["treble"] = self.treble.to_dict() + return _dict + + @classmethod + 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 SoundFeatureSet.parse_obj(obj) + + _obj = SoundFeatureSet.parse_obj( + { + "ambience": AmbienceFeature.from_dict(obj.get("ambience")) + if obj.get("ambience") is not None + else None, + "balance": BalanceFeature.from_dict(obj.get("balance")) + if obj.get("balance") is not None + else None, + "bass": BassFeature.from_dict(obj.get("bass")) + if obj.get("bass") is not None + else None, + "bass_management": BassManagementFeature.from_dict( + obj.get("bass-management") + ) + if obj.get("bass-management") is not None + else None, + "compression": CompressionFeature.from_dict(obj.get("compression")) + if obj.get("compression") is not None + else None, + "directivity": DirectivityFeature.from_dict(obj.get("directivity")) + if obj.get("directivity") is not None + else None, + "fader": FaderFeature.from_dict(obj.get("fader")) + if obj.get("fader") is not None + else None, + "room_compensation": RoomCompensationFeature.from_dict( + obj.get("roomCompensation") + ) + if obj.get("roomCompensation") is not None + else None, + "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.get("spatial-height") + ) + if obj.get("spatial-height") is not None + else None, + "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.get("spatial-surround") + ) + if obj.get("spatial-surround") is not None + else None, + "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.get("speech-enhance") + ) + if obj.get("speech-enhance") is not None + else None, + "tone_touch_x": ToneTouchXFeature.from_dict(obj.get("toneTouchX")) + if obj.get("toneTouchX") is not None + else None, + "tone_touch_y": ToneTouchYFeature.from_dict(obj.get("toneTouchY")) + if obj.get("toneTouchY") is not None + else None, + "treble": TrebleFeature.from_dict(obj.get("treble")) + if obj.get("treble") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/sound_settings.py b/python_client/mozart_api/models/sound_settings.py new file mode 100644 index 0000000..516c788 --- /dev/null +++ b/python_client/mozart_api/models/sound_settings.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class SoundSettings(BaseModel): + """ + SoundSettings + """ + + adjustments: Optional[SoundAdjustments] = None + room_compensation: Optional[RoomCompensationInfo] = Field( + None, alias="roomCompensation" + ) + tone_touch: Optional[SoundToneTouch] = Field(None, alias="toneTouch") + __properties = ["adjustments", "roomCompensation", "toneTouch"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of room_compensation + if self.room_compensation: + _dict["roomCompensation"] = self.room_compensation.to_dict() + # override the default output from pydantic by calling `to_dict()` of tone_touch + if self.tone_touch: + _dict["toneTouch"] = self.tone_touch.to_dict() + return _dict + + @classmethod + 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 SoundSettings.parse_obj(obj) + + _obj = SoundSettings.parse_obj( + { + "adjustments": SoundAdjustments.from_dict(obj.get("adjustments")) + if obj.get("adjustments") is not None + else None, + "room_compensation": RoomCompensationInfo.from_dict( + obj.get("roomCompensation") + ) + if obj.get("roomCompensation") is not None + else None, + "tone_touch": SoundToneTouch.from_dict(obj.get("toneTouch")) + if obj.get("toneTouch") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/sound_tone_touch.py b/python_client/mozart_api/models/sound_tone_touch.py new file mode 100644 index 0000000..5e7f8bc --- /dev/null +++ b/python_client/mozart_api/models/sound_tone_touch.py @@ -0,0 +1,72 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt + + +class SoundToneTouch(BaseModel): + """ + SoundToneTouch + """ + + x: Optional[Union[StrictFloat, StrictInt]] = None + y: Optional[Union[StrictFloat, StrictInt]] = None + z: Optional[Union[StrictFloat, StrictInt]] = None + __properties = ["x", "y", "z"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SoundToneTouch: + """Create an instance of SoundToneTouch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SoundToneTouch.parse_obj(obj) + + _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 new file mode 100644 index 0000000..c1fa113 --- /dev/null +++ b/python_client/mozart_api/models/source.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr +from mozart_api.models.source_type_enum import SourceTypeEnum + + +class Source(BaseModel): + """ + Source + """ + + id: Optional[StrictStr] = None + is_enabled: Optional[StrictBool] = Field( + None, + alias="isEnabled", + description="some sources require an explicit activation or accept of terms before being enabled", + ) + is_playable: Optional[StrictBool] = Field(None, alias="isPlayable") + name: Optional[StrictStr] = None + type: Optional[SourceTypeEnum] = None + __properties = ["id", "isEnabled", "isPlayable", "name", "type"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Source: + """Create an instance of Source from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Source.parse_obj(obj) + + _obj = Source.parse_obj( + { + "id": obj.get("id"), + "is_enabled": obj.get("isEnabled"), + "is_playable": obj.get("isPlayable"), + "name": obj.get("name"), + "type": SourceTypeEnum.from_dict(obj.get("type")) + if obj.get("type") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/source_array.py b/python_client/mozart_api/models/source_array.py new file mode 100644 index 0000000..4d0fe00 --- /dev/null +++ b/python_client/mozart_api/models/source_array.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, conlist +from mozart_api.models.source import Source + + +class SourceArray(BaseModel): + """ + SourceArray + """ + + items: Optional[conlist(Source)] = None + __properties = ["items"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + 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 SourceArray.parse_obj(obj) + + _obj = SourceArray.parse_obj( + { + "items": [Source.from_dict(_item) for _item in obj.get("items")] + if obj.get("items") is not None + else None + } + ) + return _obj diff --git a/python_client/mozart_api/models/source_type_enum.py b/python_client/mozart_api/models/source_type_enum.py new file mode 100644 index 0000000..5b9e234 --- /dev/null +++ b/python_client/mozart_api/models/source_type_enum.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + + +class SourceTypeEnum(BaseModel): + """ + SourceTypeEnum + """ + + value: Optional[StrictStr] = Field( + None, + description="- beolink - bluetooth - dlna - qplay - airPlay - lineIn - chromeCast - uriStreamer - netRadio - local - generator - spotify - spdif - pl - wpl - tv - deezer - usbIn - tidalConnect - unknown", + ) + __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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SourceTypeEnum: + """Create an instance of SourceTypeEnum from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SourceTypeEnum.parse_obj(obj) + + _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 new file mode 100644 index 0000000..beff13d --- /dev/null +++ b/python_client/mozart_api/models/spatial_envelopment.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class SpatialEnvelopment(BaseModel): + """ + SpatialEnvelopment + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected spatial-envelopment 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpatialEnvelopment: + """Create an instance of SpatialEnvelopment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpatialEnvelopment.parse_obj(obj) + + _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 new file mode 100644 index 0000000..c3c9126 --- /dev/null +++ b/python_client/mozart_api/models/spatial_envelopment_feature.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.spatial_envelopment import SpatialEnvelopment + + +class SpatialEnvelopmentFeature(BaseModel): + """ + SpatialEnvelopmentFeature + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected spatial-envelopment value" + ) + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialEnvelopmentFeature.parse_obj(obj) + + _obj = SpatialEnvelopmentFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range") + ] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_envelopment_range.py b/python_client/mozart_api/models/spatial_envelopment_range.py new file mode 100644 index 0000000..b5e87e6 --- /dev/null +++ b/python_client/mozart_api/models/spatial_envelopment_range.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.spatial_envelopment import SpatialEnvelopment + + +class SpatialEnvelopmentRange(BaseModel): + """ + SpatialEnvelopmentRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialEnvelopmentRange.parse_obj(obj) + + _obj = SpatialEnvelopmentRange.parse_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.get("range") + ] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_height.py b/python_client/mozart_api/models/spatial_height.py new file mode 100644 index 0000000..be6afd7 --- /dev/null +++ b/python_client/mozart_api/models/spatial_height.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class SpatialHeight(BaseModel): + """ + SpatialHeight + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected spatial-height 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpatialHeight: + """Create an instance of SpatialHeight from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpatialHeight.parse_obj(obj) + + _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 new file mode 100644 index 0000000..1186a41 --- /dev/null +++ b/python_client/mozart_api/models/spatial_height_feature.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.spatial_height import SpatialHeight + + +class SpatialHeightFeature(BaseModel): + """ + SpatialHeightFeature + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected spatial-height value" + ) + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialHeightFeature.parse_obj(obj) + + _obj = SpatialHeightFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_height_range.py b/python_client/mozart_api/models/spatial_height_range.py new file mode 100644 index 0000000..840684c --- /dev/null +++ b/python_client/mozart_api/models/spatial_height_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.spatial_height import SpatialHeight + + +class SpatialHeightRange(BaseModel): + """ + SpatialHeightRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialHeightRange.parse_obj(obj) + + _obj = SpatialHeightRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_processing.py b/python_client/mozart_api/models/spatial_processing.py new file mode 100644 index 0000000..d10e7d4 --- /dev/null +++ b/python_client/mozart_api/models/spatial_processing.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr, validator + + +class SpatialProcessing(BaseModel): + """ + SpatialProcessing + """ + + value: StrictStr = Field(..., description="Selected spatial-processing value") + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value not in ("direct", "trueimage", "downmix"): + raise ValueError( + "must be one of enum values ('direct', 'trueimage', 'downmix')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpatialProcessing: + """Create an instance of SpatialProcessing from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpatialProcessing.parse_obj(obj) + + _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 new file mode 100644 index 0000000..4e17f2e --- /dev/null +++ b/python_client/mozart_api/models/spatial_processing_feature.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, StrictStr, conlist, validator +from mozart_api.models.spatial_processing import SpatialProcessing + + +class SpatialProcessingFeature(BaseModel): + """ + SpatialProcessingFeature + """ + + 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"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value not in ("direct", "trueimage", "downmix"): + raise ValueError( + "must be one of enum values ('direct', 'trueimage', 'downmix')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialProcessingFeature.parse_obj(obj) + + _obj = SpatialProcessingFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range") + ] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_processing_range.py b/python_client/mozart_api/models/spatial_processing_range.py new file mode 100644 index 0000000..8b08084 --- /dev/null +++ b/python_client/mozart_api/models/spatial_processing_range.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.spatial_processing import SpatialProcessing + + +class SpatialProcessingRange(BaseModel): + """ + SpatialProcessingRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialProcessingRange.parse_obj(obj) + + _obj = SpatialProcessingRange.parse_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.get("range") + ] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_surround.py b/python_client/mozart_api/models/spatial_surround.py new file mode 100644 index 0000000..df402bd --- /dev/null +++ b/python_client/mozart_api/models/spatial_surround.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class SpatialSurround(BaseModel): + """ + SpatialSurround + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected spatial-surround 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpatialSurround: + """Create an instance of SpatialSurround from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpatialSurround.parse_obj(obj) + + _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 new file mode 100644 index 0000000..b6aff51 --- /dev/null +++ b/python_client/mozart_api/models/spatial_surround_feature.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.spatial_surround import SpatialSurround + + +class SpatialSurroundFeature(BaseModel): + """ + SpatialSurroundFeature + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected spatial-surround value" + ) + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialSurroundFeature.parse_obj(obj) + + _obj = SpatialSurroundFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range") + ] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_surround_range.py b/python_client/mozart_api/models/spatial_surround_range.py new file mode 100644 index 0000000..b6e6e8b --- /dev/null +++ b/python_client/mozart_api/models/spatial_surround_range.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.spatial_surround import SpatialSurround + + +class SpatialSurroundRange(BaseModel): + """ + SpatialSurroundRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialSurroundRange.parse_obj(obj) + + _obj = SpatialSurroundRange.parse_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.get("range") + ] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_width.py b/python_client/mozart_api/models/spatial_width.py new file mode 100644 index 0000000..b205d56 --- /dev/null +++ b/python_client/mozart_api/models/spatial_width.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class SpatialWidth(BaseModel): + """ + SpatialWidth + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected spatial-width 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpatialWidth: + """Create an instance of SpatialWidth from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpatialWidth.parse_obj(obj) + + _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 new file mode 100644 index 0000000..39e88fe --- /dev/null +++ b/python_client/mozart_api/models/spatial_width_feature.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.spatial_width import SpatialWidth + + +class SpatialWidthFeature(BaseModel): + """ + SpatialWidthFeature + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected spatial-width value" + ) + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialWidthFeature.parse_obj(obj) + + _obj = SpatialWidthFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/spatial_width_range.py b/python_client/mozart_api/models/spatial_width_range.py new file mode 100644 index 0000000..558bee7 --- /dev/null +++ b/python_client/mozart_api/models/spatial_width_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.spatial_width import SpatialWidth + + +class SpatialWidthRange(BaseModel): + """ + SpatialWidthRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpatialWidthRange.parse_obj(obj) + + _obj = SpatialWidthRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/speaker_group.py b/python_client/mozart_api/models/speaker_group.py new file mode 100644 index 0000000..560e261 --- /dev/null +++ b/python_client/mozart_api/models/speaker_group.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class SpeakerGroup(BaseModel): + """ + SpeakerGroup + """ + + 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( + None, + alias="enablePhaseCompensation", + description="Enable phase compensation in bass management.", + ) + friendly_name: Optional[StrictStr] = Field( + None, + alias="friendlyName", + description="Friendly name of the SpeakerGroup. Required when creating a new group ", + ) + id: Optional[StrictStr] = None + 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( + 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[conint(strict=True, le=99, ge=0)] = Field( + None, + alias="speakerPreset", + description="Speaker preset / listening mode eg. BL28 curtain position etc.", + ) + __properties = [ + "crossoverFrequency", + "enablePhaseCompensation", + "friendlyName", + "id", + "isDeleteable", + "items", + "latencyProfile", + "roomCompensationId", + "speakerPreset", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + # 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 crossover_frequency (nullable) is None + # and __fields_set__ contains the field + if ( + self.crossover_frequency is None + and "crossover_frequency" in self.__fields_set__ + ): + _dict["crossoverFrequency"] = None + + # set to None if enable_phase_compensation (nullable) is None + # and __fields_set__ contains the field + if ( + self.enable_phase_compensation is None + and "enable_phase_compensation" in self.__fields_set__ + ): + _dict["enablePhaseCompensation"] = None + + # set to None if friendly_name (nullable) is None + # 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 __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 __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 __fields_set__ contains the field + if ( + self.room_compensation_id is None + and "room_compensation_id" in self.__fields_set__ + ): + _dict["roomCompensationId"] = None + + # set to None if speaker_preset (nullable) is None + # 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: dict) -> SpeakerGroup: + """Create an instance of SpeakerGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpeakerGroup.parse_obj(obj) + + _obj = SpeakerGroup.parse_obj( + { + "crossover_frequency": obj.get("crossoverFrequency"), + "enable_phase_compensation": obj.get("enablePhaseCompensation"), + "friendly_name": obj.get("friendlyName"), + "id": obj.get("id"), + "is_deleteable": obj.get("isDeleteable"), + "items": [ + SpeakerGroupMember.from_dict(_item) for _item in obj.get("items") + ] + if obj.get("items") is not None + else None, + "latency_profile": LatencyProfile.from_dict(obj.get("latencyProfile")) + if obj.get("latencyProfile") is not None + else None, + "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 new file mode 100644 index 0000000..c48b373 --- /dev/null +++ b/python_client/mozart_api/models/speaker_group_member.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional, Union +from pydantic import BaseModel, Field, StrictStr, confloat, conint +from mozart_api.models.speaker_group_member_location import SpeakerGroupMemberLocation + + +class SpeakerGroupMember(BaseModel): + """ + SpeakerGroupMember + """ + + distance: Optional[conint(strict=True, le=1500, ge=0)] = Field( + None, description="Distance from listening position in cm" + ) + friendly_name: Optional[StrictStr] = Field(None, alias="friendlyName") + gain: Optional[ + 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[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 = [ + "distance", + "friendlyName", + "gain", + "id", + "location", + "redirectionLevel", + "role", + "type", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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 __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 __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 __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 __fields_set__ contains the field + if ( + self.redirection_level is None + and "redirection_level" in self.__fields_set__ + ): + _dict["redirectionLevel"] = None + + # set to None if role (nullable) is None + # 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 __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: dict) -> SpeakerGroupMember: + """Create an instance of SpeakerGroupMember from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpeakerGroupMember.parse_obj(obj) + + _obj = SpeakerGroupMember.parse_obj( + { + "distance": obj.get("distance"), + "friendly_name": obj.get("friendlyName"), + "gain": obj.get("gain"), + "id": obj.get("id"), + "location": SpeakerGroupMemberLocation.from_dict(obj.get("location")) + if obj.get("location") is not None + else None, + "redirection_level": obj.get("redirectionLevel"), + "role": obj.get("role"), + "type": obj.get("type"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/speaker_group_member_location.py b/python_client/mozart_api/models/speaker_group_member_location.py new file mode 100644 index 0000000..d27b630 --- /dev/null +++ b/python_client/mozart_api/models/speaker_group_member_location.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + """ + + x: StrictInt = Field(...) + y: StrictInt = Field(...) + z: StrictInt = Field(...) + __properties = ["x", "y", "z"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpeakerGroupMemberLocation: + """Create an instance of SpeakerGroupMemberLocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpeakerGroupMemberLocation.parse_obj(obj) + + _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 new file mode 100644 index 0000000..2e727da --- /dev/null +++ b/python_client/mozart_api/models/speaker_group_overview.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictBool, StrictStr + + +class SpeakerGroupOverview(BaseModel): + """ + SpeakerGroupOverview + """ + + friendly_name: StrictStr = Field(..., alias="friendlyName") + id: StrictStr = Field(...) + is_deleteable: StrictBool = Field(..., alias="isDeleteable") + __properties = ["friendlyName", "id", "isDeleteable"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpeakerGroupOverview: + """Create an instance of SpeakerGroupOverview from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpeakerGroupOverview.parse_obj(obj) + + _obj = SpeakerGroupOverview.parse_obj( + { + "friendly_name": obj.get("friendlyName"), + "id": obj.get("id"), + "is_deleteable": obj.get("isDeleteable"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/speaker_role_enum.py b/python_client/mozart_api/models/speaker_role_enum.py new file mode 100644 index 0000000..5b8113c --- /dev/null +++ b/python_client/mozart_api/models/speaker_role_enum.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class SpeakerRoleEnum(BaseModel): + """ + SpeakerRoleEnum + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("standalone", "multichannel"): + raise ValueError( + "must be one of enum values ('standalone', 'multichannel')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpeakerRoleEnum: + """Create an instance of SpeakerRoleEnum from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpeakerRoleEnum.parse_obj(obj) + + _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 new file mode 100644 index 0000000..e8c995e --- /dev/null +++ b/python_client/mozart_api/models/speech_enhance.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class SpeechEnhance(BaseModel): + """ + SpeechEnhance + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected speech-enhance 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> SpeechEnhance: + """Create an instance of SpeechEnhance from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SpeechEnhance.parse_obj(obj) + + _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 new file mode 100644 index 0000000..68615bb --- /dev/null +++ b/python_client/mozart_api/models/speech_enhance_feature.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.speech_enhance import SpeechEnhance + + +class SpeechEnhanceFeature(BaseModel): + """ + SpeechEnhanceFeature + """ + + value: Union[StrictFloat, StrictInt] = Field( + ..., description="Selected speech-enhance value" + ) + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpeechEnhanceFeature.parse_obj(obj) + + _obj = SpeechEnhanceFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/speech_enhance_range.py b/python_client/mozart_api/models/speech_enhance_range.py new file mode 100644 index 0000000..730b440 --- /dev/null +++ b/python_client/mozart_api/models/speech_enhance_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.speech_enhance import SpeechEnhance + + +class SpeechEnhanceRange(BaseModel): + """ + SpeechEnhanceRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 SpeechEnhanceRange.parse_obj(obj) + + _obj = SpeechEnhanceRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/stand_connected.py b/python_client/mozart_api/models/stand_connected.py new file mode 100644 index 0000000..3b1fbf7 --- /dev/null +++ b/python_client/mozart_api/models/stand_connected.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictBool + + +class StandConnected(BaseModel): + """ + StandConnected + """ + + connected: Optional[StrictBool] = None + __properties = ["connected"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> StandConnected: + """Create an instance of StandConnected from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return StandConnected.parse_obj(obj) + + _obj = StandConnected.parse_obj({"connected": obj.get("connected")}) + return _obj diff --git a/python_client/mozart_api/models/stand_position.py b/python_client/mozart_api/models/stand_position.py new file mode 100644 index 0000000..036ec1e --- /dev/null +++ b/python_client/mozart_api/models/stand_position.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt + + +class StandPosition(BaseModel): + """ + StandPosition + """ + + angle: Optional[Union[StrictFloat, StrictInt]] = None + __properties = ["angle"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> StandPosition: + """Create an instance of StandPosition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return StandPosition.parse_obj(obj) + + _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 new file mode 100644 index 0000000..0f0852e --- /dev/null +++ b/python_client/mozart_api/models/tone_touch.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from mozart_api.models.tone_touch_type import ToneTouchType + + +class ToneTouch(BaseModel): + """ + ToneTouch + """ + + x: Optional[ToneTouchType] = None + y: Optional[ToneTouchType] = None + __properties = ["x", "y"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of y + if self.y: + _dict["y"] = self.y.to_dict() + return _dict + + @classmethod + 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 ToneTouch.parse_obj(obj) + + _obj = ToneTouch.parse_obj( + { + "x": ToneTouchType.from_dict(obj.get("x")) + if obj.get("x") is not None + else None, + "y": ToneTouchType.from_dict(obj.get("y")) + if obj.get("y") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/tone_touch_type.py b/python_client/mozart_api/models/tone_touch_type.py new file mode 100644 index 0000000..364c36b --- /dev/null +++ b/python_client/mozart_api/models/tone_touch_type.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt + + +class ToneTouchType(BaseModel): + """ + ToneTouchType + """ + + value: Union[StrictFloat, StrictInt] = Field(...) + __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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> ToneTouchType: + """Create an instance of ToneTouchType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ToneTouchType.parse_obj(obj) + + _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 new file mode 100644 index 0000000..7355ac7 --- /dev/null +++ b/python_client/mozart_api/models/tone_touch_type_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.tone_touch_type import ToneTouchType + + +class ToneTouchTypeRange(BaseModel): + """ + ToneTouchTypeRange + """ + + default: ToneTouchType = Field(...) + range: conlist(ToneTouchType, unique_items=True) = Field( + ..., description="Product and role specific tone touch X or Y 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 ToneTouchTypeRange.parse_obj(obj) + + _obj = ToneTouchTypeRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/tone_touch_x_feature.py b/python_client/mozart_api/models/tone_touch_x_feature.py new file mode 100644 index 0000000..10d3554 --- /dev/null +++ b/python_client/mozart_api/models/tone_touch_x_feature.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.tone_touch_type import ToneTouchType + + +class ToneTouchXFeature(BaseModel): + """ + ToneTouchXFeature + """ + + 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 = ["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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 ToneTouchXFeature.parse_obj(obj) + + _obj = ToneTouchXFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/tone_touch_y_feature.py b/python_client/mozart_api/models/tone_touch_y_feature.py new file mode 100644 index 0000000..f196541 --- /dev/null +++ b/python_client/mozart_api/models/tone_touch_y_feature.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Union +from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist +from mozart_api.models.tone_touch_type import ToneTouchType + + +class ToneTouchYFeature(BaseModel): + """ + ToneTouchYFeature + """ + + 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 = ["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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 ToneTouchYFeature.parse_obj(obj) + + _obj = ToneTouchYFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/treble.py b/python_client/mozart_api/models/treble.py new file mode 100644 index 0000000..8594083 --- /dev/null +++ b/python_client/mozart_api/models/treble.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictInt + + +class Treble(BaseModel): + """ + Treble + """ + + value: StrictInt = Field(..., description="Selected treble 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Treble: + """Create an instance of Treble from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Treble.parse_obj(obj) + + _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 new file mode 100644 index 0000000..885f7b4 --- /dev/null +++ b/python_client/mozart_api/models/treble_feature.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, StrictInt, conlist +from mozart_api.models.treble import Treble + + +class TrebleFeature(BaseModel): + """ + TrebleFeature + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 TrebleFeature.parse_obj(obj) + + _obj = TrebleFeature.parse_obj( + { + "value": obj.get("value"), + "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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/treble_range.py b/python_client/mozart_api/models/treble_range.py new file mode 100644 index 0000000..15b7976 --- /dev/null +++ b/python_client/mozart_api/models/treble_range.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List +from pydantic import BaseModel, Field, conlist +from mozart_api.models.treble import Treble + + +class TrebleRange(BaseModel): + """ + TrebleRange + """ + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of each item in range (list) + _items = [] + if self.range: + for _item in self.range: + if _item: + _items.append(_item.to_dict()) + _dict["range"] = _items + return _dict + + @classmethod + 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 TrebleRange.parse_obj(obj) + + _obj = TrebleRange.parse_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.get("range")] + if obj.get("range") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/tv_info_event_data.py b/python_client/mozart_api/models/tv_info_event_data.py new file mode 100644 index 0000000..4276eca --- /dev/null +++ b/python_client/mozart_api/models/tv_info_event_data.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from mozart_api.models.tv_integration_types import TvIntegrationTypes + + +class TvInfoEventData(BaseModel): + """ + TvInfoEventData + """ + + integration: Optional[TvIntegrationTypes] = None + __properties = ["integration"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> TvInfoEventData: + """Create an instance of TvInfoEventData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TvInfoEventData.parse_obj(obj) + + _obj = TvInfoEventData.parse_obj( + { + "integration": TvIntegrationTypes.from_dict(obj.get("integration")) + if obj.get("integration") is not None + else None + } + ) + return _obj diff --git a/python_client/mozart_api/models/tv_integration_types.py b/python_client/mozart_api/models/tv_integration_types.py new file mode 100644 index 0000000..719e6f5 --- /dev/null +++ b/python_client/mozart_api/models/tv_integration_types.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class TvIntegrationTypes(BaseModel): + """ + TvIntegrationTypes + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("ThirdParty", "Lge"): + raise ValueError("must be one of enum values ('ThirdParty', 'Lge')") + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> TvIntegrationTypes: + """Create an instance of TvIntegrationTypes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TvIntegrationTypes.parse_obj(obj) + + _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 new file mode 100644 index 0000000..f49b5e6 --- /dev/null +++ b/python_client/mozart_api/models/tv_properties.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictInt, StrictStr +from mozart_api.models.tv_integration_types import TvIntegrationTypes + + +class TvProperties(BaseModel): + """ + TvProperties + """ + + integration_supported: Optional[TvIntegrationTypes] = Field( + None, alias="integrationSupported" + ) + name: Optional[StrictStr] = None + year: Optional[StrictInt] = None + __properties = ["integrationSupported", "name", "year"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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 __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 __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: dict) -> TvProperties: + """Create an instance of TvProperties from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TvProperties.parse_obj(obj) + + _obj = TvProperties.parse_obj( + { + "integration_supported": TvIntegrationTypes.from_dict( + obj.get("integrationSupported") + ) + if obj.get("integrationSupported") is not None + else None, + "name": obj.get("name"), + "year": obj.get("year"), + } + ) + return _obj diff --git a/python_client/mozart_api/models/tv_sound_settings.py b/python_client/mozart_api/models/tv_sound_settings.py new file mode 100644 index 0000000..7066c61 --- /dev/null +++ b/python_client/mozart_api/models/tv_sound_settings.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from mozart_api.models.lge_tv_sound_settings import LgeTvSoundSettings + + +class TvSoundSettings(BaseModel): + """ + TvSoundSettings + """ + + lge: Optional[LgeTvSoundSettings] = None + __properties = ["lge"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> TvSoundSettings: + """Create an instance of TvSoundSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return TvSoundSettings.parse_obj(obj) + + _obj = TvSoundSettings.parse_obj( + { + "lge": LgeTvSoundSettings.from_dict(obj.get("lge")) + if obj.get("lge") is not None + else None + } + ) + return _obj diff --git a/python_client/mozart_api/models/tv_state.py b/python_client/mozart_api/models/tv_state.py new file mode 100644 index 0000000..ab640f5 --- /dev/null +++ b/python_client/mozart_api/models/tv_state.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +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 + + +class TvState(BaseModel): + """ + TvState + """ + + integration: Optional[TvIntegrationTypes] = None + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of sound_settings + if self.sound_settings: + _dict["soundSettings"] = self.sound_settings.to_dict() + # override the default output from pydantic by calling `to_dict()` of tv_info + if self.tv_info: + _dict["tvInfo"] = self.tv_info.to_dict() + return _dict + + @classmethod + 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 TvState.parse_obj(obj) + + _obj = TvState.parse_obj( + { + "integration": TvIntegrationTypes.from_dict(obj.get("integration")) + if obj.get("integration") is not None + else None, + "sound_settings": TvSoundSettings.from_dict(obj.get("soundSettings")) + if obj.get("soundSettings") is not None + else None, + "tv_info": TvProperties.from_dict(obj.get("tvInfo")) + if obj.get("tvInfo") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/uri.py b/python_client/mozart_api/models/uri.py new file mode 100644 index 0000000..8d090fb --- /dev/null +++ b/python_client/mozart_api/models/uri.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr + + +class Uri(BaseModel): + """ + Uri + """ + + location: Optional[StrictStr] = None + __properties = ["location"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> Uri: + """Create an instance of Uri from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return Uri.parse_obj(obj) + + _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 new file mode 100644 index 0000000..9bf9c69 --- /dev/null +++ b/python_client/mozart_api/models/user_flow.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + + +class UserFlow(BaseModel): + """ + UserFlow + """ + + user_id: Optional[StrictStr] = Field(None, alias="userId") + __properties = ["userId"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> UserFlow: + """Create an instance of UserFlow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return UserFlow.parse_obj(obj) + + _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 new file mode 100644 index 0000000..1751dd4 --- /dev/null +++ b/python_client/mozart_api/models/video_pixel_format.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr, validator + + +class VideoPixelFormat(BaseModel): + """ + VideoPixelFormat + """ + + bitdepth: Optional[StrictStr] = None + chroma_subsample: Optional[StrictStr] = Field(None, alias="chromaSubsample") + colorimetry: Optional[StrictStr] = None + 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 ("bit8", "bit10", "bit12"): + raise ValueError("must be one of enum values ('bit8', 'bit10', 'bit12')") + return value + + @validator("chroma_subsample") + def chroma_subsample_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("yCbCr444RGB", "yCbCr422", "yCbCr420"): + raise ValueError( + "must be one of enum values ('yCbCr444RGB', 'yCbCr422', 'yCbCr420')" + ) + return value + + @validator("colorimetry") + def colorimetry_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> VideoPixelFormat: + """Create an instance of VideoPixelFormat from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return VideoPixelFormat.parse_obj(obj) + + _obj = VideoPixelFormat.parse_obj( + { + "bitdepth": obj.get("bitdepth"), + "chroma_subsample": obj.get("chromaSubsample"), + "colorimetry": obj.get("colorimetry"), + "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 new file mode 100644 index 0000000..f282469 --- /dev/null +++ b/python_client/mozart_api/models/video_timings.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional, Union +from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt + + +class VideoTimings(BaseModel): + """ + VideoTimings + """ + + horizontal_resolution: Optional[StrictInt] = Field( + None, alias="horizontalResolution" + ) + interlaced: Optional[StrictBool] = None + refresh_rate: Optional[Union[StrictFloat, StrictInt]] = Field( + None, alias="refreshRate" + ) + vertical_resolution: Optional[StrictInt] = Field(None, alias="verticalResolution") + __properties = [ + "horizontalResolution", + "interlaced", + "refreshRate", + "verticalResolution", + ] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> VideoTimings: + """Create an instance of VideoTimings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return VideoTimings.parse_obj(obj) + + _obj = VideoTimings.parse_obj( + { + "horizontal_resolution": obj.get("horizontalResolution"), + "interlaced": obj.get("interlaced"), + "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 new file mode 100644 index 0000000..5b6cd86 --- /dev/null +++ b/python_client/mozart_api/models/volume_level.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictInt + + +class VolumeLevel(BaseModel): + """ + VolumeLevel + """ + + level: Optional[StrictInt] = None + __properties = ["level"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> VolumeLevel: + """Create an instance of VolumeLevel from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return VolumeLevel.parse_obj(obj) + + _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 new file mode 100644 index 0000000..77d7e33 --- /dev/null +++ b/python_client/mozart_api/models/volume_mute.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictBool + + +class VolumeMute(BaseModel): + """ + VolumeMute + """ + + muted: Optional[StrictBool] = None + __properties = ["muted"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> VolumeMute: + """Create an instance of VolumeMute from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return VolumeMute.parse_obj(obj) + + _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 new file mode 100644 index 0000000..c57e04a --- /dev/null +++ b/python_client/mozart_api/models/volume_settings.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from mozart_api.models.volume_level import VolumeLevel + + +class VolumeSettings(BaseModel): + """ + VolumeSettings + """ + + default: Optional[VolumeLevel] = None + maximum: Optional[VolumeLevel] = None + __properties = ["default", "maximum"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of maximum + if self.maximum: + _dict["maximum"] = self.maximum.to_dict() + return _dict + + @classmethod + 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 VolumeSettings.parse_obj(obj) + + _obj = VolumeSettings.parse_obj( + { + "default": VolumeLevel.from_dict(obj.get("default")) + if obj.get("default") is not None + else None, + "maximum": VolumeLevel.from_dict(obj.get("maximum")) + if obj.get("maximum") is not None + else None, + } + ) + return _obj diff --git a/python_client/mozart_api/models/volume_state.py b/python_client/mozart_api/models/volume_state.py new file mode 100644 index 0000000..414a666 --- /dev/null +++ b/python_client/mozart_api/models/volume_state.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from mozart_api.models.volume_level import VolumeLevel +from mozart_api.models.volume_mute import VolumeMute + + +class VolumeState(BaseModel): + """ + VolumeState + """ + + default: Optional[VolumeLevel] = None + level: Optional[VolumeLevel] = None + maximum: Optional[VolumeLevel] = None + muted: Optional[VolumeMute] = None + __properties = ["default", "level", "maximum", "muted"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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() + # override the default output from pydantic by calling `to_dict()` of level + if self.level: + _dict["level"] = self.level.to_dict() + # override the default output from pydantic by calling `to_dict()` of maximum + if self.maximum: + _dict["maximum"] = self.maximum.to_dict() + # override the default output from pydantic by calling `to_dict()` of muted + if self.muted: + _dict["muted"] = self.muted.to_dict() + return _dict + + @classmethod + 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 VolumeState.parse_obj(obj) + + _obj = VolumeState.parse_obj( + { + "default": VolumeLevel.from_dict(obj.get("default")) + if obj.get("default") is not None + else None, + "level": VolumeLevel.from_dict(obj.get("level")) + if obj.get("level") is not None + else None, + "maximum": VolumeLevel.from_dict(obj.get("maximum")) + if obj.get("maximum") is not None + else None, + "muted": VolumeMute.from_dict(obj.get("muted")) + if obj.get("muted") is not None + else None, + } + ) + return _obj 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 new file mode 100644 index 0000000..2e303db --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_active_hdmi_input_signal.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.hdmi_input import HdmiInput + + +class WebSocketEventActiveHdmiInputSignal(BaseModel): + """ + WebSocketEventActiveHdmiInputSignal + """ + + event_data: Optional[HdmiInput] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventActiveHdmiInputSignal: + """Create an instance of WebSocketEventActiveHdmiInputSignal from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventActiveHdmiInputSignal.parse_obj(obj) + + _obj = WebSocketEventActiveHdmiInputSignal.parse_obj( + { + "event_data": HdmiInput.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..8f7e797 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_active_listening_mode.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.listening_mode_props import ListeningModeProps + + +class WebSocketEventActiveListeningMode(BaseModel): + """ + WebSocketEventActiveListeningMode + """ + + event_data: Optional[ListeningModeProps] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventActiveListeningMode: + """Create an instance of WebSocketEventActiveListeningMode from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventActiveListeningMode.parse_obj(obj) + + _obj = WebSocketEventActiveListeningMode.parse_obj( + { + "event_data": ListeningModeProps.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..5257319 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_active_speaker_group.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.speaker_group_overview import SpeakerGroupOverview + + +class WebSocketEventActiveSpeakerGroup(BaseModel): + """ + WebSocketEventActiveSpeakerGroup + """ + + event_data: Optional[SpeakerGroupOverview] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventActiveSpeakerGroup: + """Create an instance of WebSocketEventActiveSpeakerGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventActiveSpeakerGroup.parse_obj(obj) + + _obj = WebSocketEventActiveSpeakerGroup.parse_obj( + { + "event_data": SpeakerGroupOverview.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..90c9d3e --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_alarm_timer.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.alarm_timer_event_data import AlarmTimerEventData + + +class WebSocketEventAlarmTimer(BaseModel): + """ + WebSocketEventAlarmTimer + """ + + event_data: Optional[AlarmTimerEventData] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventAlarmTimer: + """Create an instance of WebSocketEventAlarmTimer from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventAlarmTimer.parse_obj(obj) + + _obj = WebSocketEventAlarmTimer.parse_obj( + { + "event_data": AlarmTimerEventData.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..d38eccd --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_alarm_triggered.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.alarm_triggered_info import AlarmTriggeredInfo + + +class WebSocketEventAlarmTriggered(BaseModel): + """ + WebSocketEventAlarmTriggered + """ + + event_data: Optional[AlarmTriggeredInfo] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventAlarmTriggered: + """Create an instance of WebSocketEventAlarmTriggered from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventAlarmTriggered.parse_obj(obj) + + _obj = WebSocketEventAlarmTriggered.parse_obj( + { + "event_data": AlarmTriggeredInfo.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..7bd5597 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_battery.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.battery_state import BatteryState + + +class WebSocketEventBattery(BaseModel): + """ + WebSocketEventBattery + """ + + event_data: Optional[BatteryState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventBattery: + """Create an instance of WebSocketEventBattery from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventBattery.parse_obj(obj) + + _obj = WebSocketEventBattery.parse_obj( + { + "event_data": BatteryState.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..87734fe --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_beo_remote_button.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.beo_remote_button import BeoRemoteButton + + +class WebSocketEventBeoRemoteButton(BaseModel): + """ + WebSocketEventBeoRemoteButton + """ + + event_data: Optional[BeoRemoteButton] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventBeoRemoteButton: + """Create an instance of WebSocketEventBeoRemoteButton from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventBeoRemoteButton.parse_obj(obj) + + _obj = WebSocketEventBeoRemoteButton.parse_obj( + { + "event_data": BeoRemoteButton.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..b13ba37 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_beolink_experiences_result.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.beolink_experiences_result import BeolinkExperiencesResult + + +class WebSocketEventBeolinkExperiencesResult(BaseModel): + """ + WebSocketEventBeolinkExperiencesResult + """ + + event_data: BeolinkExperiencesResult = Field(..., alias="eventData") + event_type: StrictStr = Field(..., alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventBeolinkExperiencesResult: + """Create an instance of WebSocketEventBeolinkExperiencesResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventBeolinkExperiencesResult.parse_obj(obj) + + _obj = WebSocketEventBeolinkExperiencesResult.parse_obj( + { + "event_data": BeolinkExperiencesResult.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..bc2fbd3 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_beolink_join_result.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.beolink_join_result import BeolinkJoinResult + + +class WebSocketEventBeolinkJoinResult(BaseModel): + """ + WebSocketEventBeolinkJoinResult + """ + + event_data: BeolinkJoinResult = Field(..., alias="eventData") + event_type: StrictStr = Field(..., alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventBeolinkJoinResult: + """Create an instance of WebSocketEventBeolinkJoinResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventBeolinkJoinResult.parse_obj(obj) + + _obj = WebSocketEventBeolinkJoinResult.parse_obj( + { + "event_data": BeolinkJoinResult.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..baf858e --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_button.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.button_event import ButtonEvent + + +class WebSocketEventButton(BaseModel): + """ + WebSocketEventButton + """ + + event_data: Optional[ButtonEvent] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventButton: + """Create an instance of WebSocketEventButton from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventButton.parse_obj(obj) + + _obj = WebSocketEventButton.parse_obj( + { + "event_data": ButtonEvent.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..6996bd0 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_curtains.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.product_curtain_status import ProductCurtainStatus + + +class WebSocketEventCurtains(BaseModel): + """ + WebSocketEventCurtains + """ + + event_data: Optional[ProductCurtainStatus] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventCurtains: + """Create an instance of WebSocketEventCurtains from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventCurtains.parse_obj(obj) + + _obj = WebSocketEventCurtains.parse_obj( + { + "event_data": ProductCurtainStatus.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..70e6b78 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_hdmi_video_format_signal.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.hdmi_video_format import HdmiVideoFormat + + +class WebSocketEventHdmiVideoFormatSignal(BaseModel): + """ + WebSocketEventHdmiVideoFormatSignal + """ + + event_data: Optional[HdmiVideoFormat] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventHdmiVideoFormatSignal: + """Create an instance of WebSocketEventHdmiVideoFormatSignal from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventHdmiVideoFormatSignal.parse_obj(obj) + + _obj = WebSocketEventHdmiVideoFormatSignal.parse_obj( + { + "event_data": HdmiVideoFormat.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..388a5e8 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_notification.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.websocket_notification_tag import WebsocketNotificationTag + + +class WebSocketEventNotification(BaseModel): + """ + This telegram is used to send a tagged notification. # noqa: E501 + """ + + event_data: Optional[WebsocketNotificationTag] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventNotification: + """Create an instance of WebSocketEventNotification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventNotification.parse_obj(obj) + + _obj = WebSocketEventNotification.parse_obj( + { + "event_data": WebsocketNotificationTag.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..3655f6f --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_playback_error.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.playback_error import PlaybackError + + +class WebSocketEventPlaybackError(BaseModel): + """ + WebSocketEventPlaybackError + """ + + event_data: Optional[PlaybackError] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventPlaybackError: + """Create an instance of WebSocketEventPlaybackError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventPlaybackError.parse_obj(obj) + + _obj = WebSocketEventPlaybackError.parse_obj( + { + "event_data": PlaybackError.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..6b419a1 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_playback_metadata.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.playback_content_metadata import PlaybackContentMetadata + + +class WebSocketEventPlaybackMetadata(BaseModel): + """ + WebSocketEventPlaybackMetadata + """ + + event_data: Optional[PlaybackContentMetadata] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventPlaybackMetadata: + """Create an instance of WebSocketEventPlaybackMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventPlaybackMetadata.parse_obj(obj) + + _obj = WebSocketEventPlaybackMetadata.parse_obj( + { + "event_data": PlaybackContentMetadata.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..5852b14 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_playback_progress.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.playback_progress import PlaybackProgress + + +class WebSocketEventPlaybackProgress(BaseModel): + """ + WebSocketEventPlaybackProgress + """ + + event_data: Optional[PlaybackProgress] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventPlaybackProgress: + """Create an instance of WebSocketEventPlaybackProgress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventPlaybackProgress.parse_obj(obj) + + _obj = WebSocketEventPlaybackProgress.parse_obj( + { + "event_data": PlaybackProgress.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..590adf0 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_playback_source.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.source import Source + + +class WebSocketEventPlaybackSource(BaseModel): + """ + WebSocketEventPlaybackSource + """ + + event_data: Optional[Source] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventPlaybackSource: + """Create an instance of WebSocketEventPlaybackSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventPlaybackSource.parse_obj(obj) + + _obj = WebSocketEventPlaybackSource.parse_obj( + { + "event_data": Source.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..f816a52 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_playback_state.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.rendering_state import RenderingState + + +class WebSocketEventPlaybackState(BaseModel): + """ + WebSocketEventPlaybackState + """ + + event_data: Optional[RenderingState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventPlaybackState: + """Create an instance of WebSocketEventPlaybackState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventPlaybackState.parse_obj(obj) + + _obj = WebSocketEventPlaybackState.parse_obj( + { + "event_data": RenderingState.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..1443e6e --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_power_state.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.power_state_enum import PowerStateEnum + + +class WebSocketEventPowerState(BaseModel): + """ + WebSocketEventPowerState + """ + + event_data: Optional[PowerStateEnum] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventPowerState: + """Create an instance of WebSocketEventPowerState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventPowerState.parse_obj(obj) + + _obj = WebSocketEventPowerState.parse_obj( + { + "event_data": PowerStateEnum.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..2cdd00e --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_puc_install_remote_id_status.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.install_record_id_state import InstallRecordIdState + + +class WebSocketEventPucInstallRemoteIdStatus(BaseModel): + """ + WebSocketEventPucInstallRemoteIdStatus + """ + + event_data: Optional[InstallRecordIdState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventPucInstallRemoteIdStatus: + """Create an instance of WebSocketEventPucInstallRemoteIdStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventPucInstallRemoteIdStatus.parse_obj(obj) + + _obj = WebSocketEventPucInstallRemoteIdStatus.parse_obj( + { + "event_data": InstallRecordIdState.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..c27aff0 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_role.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.speaker_role_enum import SpeakerRoleEnum + + +class WebSocketEventRole(BaseModel): + """ + WebSocketEventRole + """ + + event_data: Optional[SpeakerRoleEnum] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventRole: + """Create an instance of WebSocketEventRole from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventRole.parse_obj(obj) + + _obj = WebSocketEventRole.parse_obj( + { + "event_data": SpeakerRoleEnum.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..42817c5 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_room_compensation_current_measurement_event.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.room_compensation_current_measurement import ( + RoomCompensationCurrentMeasurement, +) + + +class WebSocketEventRoomCompensationCurrentMeasurementEvent(BaseModel): + """ + 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( + None, alias="eventData" + ) + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict + ) -> WebSocketEventRoomCompensationCurrentMeasurementEvent: + """Create an instance of WebSocketEventRoomCompensationCurrentMeasurementEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventRoomCompensationCurrentMeasurementEvent.parse_obj(obj) + + _obj = WebSocketEventRoomCompensationCurrentMeasurementEvent.parse_obj( + { + "event_data": RoomCompensationCurrentMeasurement.from_dict( + obj.get("eventData") + ) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..3723b8d --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_room_compensation_state.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.room_compensation_state_value import RoomCompensationStateValue + + +class WebSocketEventRoomCompensationState(BaseModel): + """ + WebSocketEventRoomCompensationState + """ + + event_data: Optional[RoomCompensationStateValue] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventRoomCompensationState: + """Create an instance of WebSocketEventRoomCompensationState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventRoomCompensationState.parse_obj(obj) + + _obj = WebSocketEventRoomCompensationState.parse_obj( + { + "event_data": RoomCompensationStateValue.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..bd45f5f --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_software_update_state.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.software_update_state import SoftwareUpdateState + + +class WebSocketEventSoftwareUpdateState(BaseModel): + """ + WebSocketEventSoftwareUpdateState + """ + + event_data: Optional[SoftwareUpdateState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventSoftwareUpdateState: + """Create an instance of WebSocketEventSoftwareUpdateState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventSoftwareUpdateState.parse_obj(obj) + + _obj = WebSocketEventSoftwareUpdateState.parse_obj( + { + "event_data": SoftwareUpdateState.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..4a34a95 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_sound_settings.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.sound_settings import SoundSettings + + +class WebSocketEventSoundSettings(BaseModel): + """ + WebSocketEventSoundSettings + """ + + event_data: Optional[SoundSettings] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventSoundSettings: + """Create an instance of WebSocketEventSoundSettings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventSoundSettings.parse_obj(obj) + + _obj = WebSocketEventSoundSettings.parse_obj( + { + "event_data": SoundSettings.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..15cf6e4 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_source_change.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.source import Source + + +class WebSocketEventSourceChange(BaseModel): + """ + WebSocketEventSourceChange + """ + + event_data: Optional[Source] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventSourceChange: + """Create an instance of WebSocketEventSourceChange from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventSourceChange.parse_obj(obj) + + _obj = WebSocketEventSourceChange.parse_obj( + { + "event_data": Source.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..bd97996 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_speaker_group_changed.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr + + +class WebSocketEventSpeakerGroupChanged(BaseModel): + """ + WebSocketEventSpeakerGroupChanged + """ + + event_data: Optional[StrictStr] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventSpeakerGroupChanged: + """Create an instance of WebSocketEventSpeakerGroupChanged from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventSpeakerGroupChanged.parse_obj(obj) + + _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_stand_connected.py b/python_client/mozart_api/models/web_socket_event_stand_connected.py new file mode 100644 index 0000000..93b895d --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_stand_connected.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.stand_connected import StandConnected + + +class WebSocketEventStandConnected(BaseModel): + """ + WebSocketEventStandConnected + """ + + event_data: Optional[StandConnected] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventStandConnected: + """Create an instance of WebSocketEventStandConnected from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventStandConnected.parse_obj(obj) + + _obj = WebSocketEventStandConnected.parse_obj( + { + "event_data": StandConnected.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..e07d81e --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_stand_position.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.stand_position import StandPosition + + +class WebSocketEventStandPosition(BaseModel): + """ + WebSocketEventStandPosition + """ + + event_data: Optional[StandPosition] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventStandPosition: + """Create an instance of WebSocketEventStandPosition from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventStandPosition.parse_obj(obj) + + _obj = WebSocketEventStandPosition.parse_obj( + { + "event_data": StandPosition.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..9679205 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_tv_info.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.tv_info_event_data import TvInfoEventData + + +class WebSocketEventTvInfo(BaseModel): + """ + WebSocketEventTvInfo + """ + + event_data: Optional[TvInfoEventData] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventTvInfo: + """Create an instance of WebSocketEventTvInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventTvInfo.parse_obj(obj) + + _obj = WebSocketEventTvInfo.parse_obj( + { + "event_data": TvInfoEventData.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..4e758c9 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_volume.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.volume_state import VolumeState + + +class WebSocketEventVolume(BaseModel): + """ + WebSocketEventVolume + """ + + event_data: Optional[VolumeState] = Field(None, alias="eventData") + event_type: Optional[StrictStr] = Field(None, alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventVolume: + """Create an instance of WebSocketEventVolume from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventVolume.parse_obj(obj) + + _obj = WebSocketEventVolume.parse_obj( + { + "event_data": VolumeState.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..07f2644 --- /dev/null +++ b/python_client/mozart_api/models/web_socket_event_wisa_out_state.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from pydantic import BaseModel, Field, StrictStr +from mozart_api.models.wisa_out_state import WisaOutState + + +class WebSocketEventWisaOutState(BaseModel): + """ + Speaker Discovery State changed # noqa: E501 + """ + + event_data: WisaOutState = Field(..., alias="eventData") + event_type: StrictStr = Field(..., alias="eventType") + __properties = ["eventData", "eventType"] + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebSocketEventWisaOutState: + """Create an instance of WebSocketEventWisaOutState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebSocketEventWisaOutState.parse_obj(obj) + + _obj = WebSocketEventWisaOutState.parse_obj( + { + "event_data": WisaOutState.from_dict(obj.get("eventData")) + if obj.get("eventData") is not None + else None, + "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 new file mode 100644 index 0000000..f6c11c9 --- /dev/null +++ b/python_client/mozart_api/models/websocket_notification_tag.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class WebsocketNotificationTag(BaseModel): + """ + WebsocketNotificationTag + """ + + value: Optional[StrictStr] = None + __properties = ["value"] + + @validator("value") + def value_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + 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 + + 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WebsocketNotificationTag: + """Create an instance of WebsocketNotificationTag from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WebsocketNotificationTag.parse_obj(obj) + + _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 new file mode 100644 index 0000000..b45f70b --- /dev/null +++ b/python_client/mozart_api/models/wisa_out_state.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr, validator + + +class WisaOutState(BaseModel): + """ + WisaOutState + """ + + state: Optional[StrictStr] = None + __properties = ["state"] + + @validator("state") + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in ("idle", "discovering", "deleting", "updatingSpeakerFirmware"): + raise ValueError( + "must be one of enum values ('idle', 'discovering', 'deleting', 'updatingSpeakerFirmware')" + ) + return 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.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + 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): + """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: dict) -> WisaOutState: + """Create an instance of WisaOutState from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return WisaOutState.parse_obj(obj) + + _obj = WisaOutState.parse_obj({"state": obj.get("state")}) + return _obj diff --git a/python_client/mozart_api/mozart_cli.py b/python_client/mozart_api/mozart_cli.py new file mode 100644 index 0000000..2868938 --- /dev/null +++ b/python_client/mozart_api/mozart_cli.py @@ -0,0 +1,352 @@ +"""Main Mozart CLI document.""" +# pylint: disable= too-few-public-methods too-many-instance-attributes + +import argparse +import asyncio +import ipaddress +import re +import sys +import threading +from dataclasses import dataclass +from typing import Final, cast + +from aioconsole import ainput # type: ignore +from mozart_api import __version__ as MOZART_API_VERSION +from mozart_api.models import VolumeLevel, VolumeMute +from mozart_api.mozart_client import MozartClient +from zeroconf import ServiceBrowser, ServiceInfo, ServiceListener, Zeroconf + +MOZART_MDNS_TYPE: Final[str] = "_bangolufsen._tcp.local." +MDNS_TIMEOUT: Final[int] = 10 +DISCOVER_MODE: Final[str] = "discover" +VERSION_MODE: Final[str] = "version" + +AVAILABLE_COMMANDS: Final[list[str]] = [ + "preset", + "play", + "pause", + "next", + "previous", + "mute", + "unmute", + "volume", + "join", + "info", + "standby", + "allstandby", + "timer", +] + + +@dataclass +class MozartDevice: + """Dataclass for describing Zeroconf discovered Mozart devices.""" + + friendly_name: str | None = "" + model_name: str = "" + serial_number: str = "" + ip_address: str = "" + sw_version: str = "" + + +mozart_devices: list[MozartDevice] = [] + + +class MozartListener(ServiceListener): + """Listener for Zeroconf discovery of Mozart devices.""" + + def __init__(self, mode: str, verbose: bool, event: threading.Event) -> None: + super().__init__() + self.mode = mode + self.verbose = verbose + self.event = event + + def update_service(self, zc: Zeroconf, type_: str, name: str) -> None: + """Unused.""" + + def remove_service(self, zc: Zeroconf, type_: str, name: str) -> None: + """Unused.""" + + def add_service(self, zc: Zeroconf, type_: str, name: str) -> None: + """Add discovered Mozart device.""" + info = cast(ServiceInfo, zc.get_service_info(type_, name)) + + # Create MozartDevice object from MDNS discovered information. + ip_address = info.parsed_addresses()[0] + serial_number = cast(bytes, info.properties.get(b"sn")).decode("utf-8") + model_name = cast(str, info.server)[:-16].replace("-", " ") + sw_version = cast(bytes, info.properties.get(b"fv")).decode("utf-8") + + friendly_name = info.properties.get(b"fn") + + # MDNS devices other than Mozart devices may not have friendly names + if friendly_name is not None: + friendly_name = cast(bytes, friendly_name).decode("utf-8") + + mozart_device = MozartDevice( + friendly_name, model_name, serial_number, ip_address, sw_version + ) + + mozart_devices.append(mozart_device) + + # Stop discovery if the desired Mozart device has been found. + if self.mode == serial_number: + print(f"Desired Mozart device: {self.mode} found: {mozart_device}") + self.event.set() + + # Only print the discovered devices if in 'discover' mode or verbose is enabled. + elif self.mode == DISCOVER_MODE or self.verbose: + print(mozart_device) + + +def discover_devices(mode: str, timeout: int, verbose: bool) -> list[MozartDevice]: + """MDNS discovery of devices on the current network.""" + event = threading.Event() + + zeroconf = Zeroconf() + listener = MozartListener(mode, verbose, event) + browser = ServiceBrowser(zeroconf, MOZART_MDNS_TYPE, listener) + + if mode == "discover" or verbose: + print("Discovering Mozart devices. Scanning _bangolufsen._tcp.local.") + + if timeout == -1: + input("Press 'enter' to stop discovery.\n\r") + + else: + # Stop if the serial number has been found with MDNS + timeout_status = event.wait(timeout) + + if not timeout_status: + print(f"Discovery timed out with timeout of {timeout} seconds.") + + browser.cancel() + zeroconf.close() + + return mozart_devices + + +def init_argument_parser() -> argparse.ArgumentParser: + """Initialize and add arguments.""" + parser = argparse.ArgumentParser( + prog="mozart-cli", + description="CLI for sending simple commands to Mozart devices.", + ) + + parser.add_argument( + "--verbose", + "-v", + action="store_true", + help="Specify if the output should be verbose.", + ) + + parser.add_argument( + "--websocket", + "-w", + action="store_true", + help="Specify if the websocket listener should be active.", + ) + + parser.add_argument( + "--timeout", + "-t", + action="store", + help="""Specify Zeroconf discovery timeout. + '-1' for input-interrupted discovery in 'discover' mode.""", + ) + + parser.add_argument( + "mode", + help="""Specify the serial number or IP address for command execution + or 'discover' for Zeroconf discovery of Mozart devices.""", + ) + + parser.add_argument( + "command", + nargs="?", + choices=AVAILABLE_COMMANDS, + help="Specify the command.", + ) + + parser.add_argument( + "command_args", + nargs="*", + help="Specify the command arguments if needed.", + ) + return parser + + +class MozartApiCli: + """Mozart CLI client.""" + + def __init__(self) -> None: + """Init the Mozart CLI.""" + self.timeout: int = MDNS_TIMEOUT + self.verbose: bool = False + self.websocket: bool = False + self.mode: str = "" + self.command: str = "" + self.host: str = "" + self.command_args: list[str] = [] + self.mozart_devices: list[MozartDevice] = [] + + parser = init_argument_parser() + args = parser.parse_args() + + if args.timeout: + self.timeout = int(args.timeout) + + self.verbose = bool(args.verbose) + self.websocket = bool(args.websocket) + self.mode = args.mode + self.command = args.command + self.command_args = args.command_args + + # Check if the API version should be printed + if self.mode == VERSION_MODE: + print(MOZART_API_VERSION) + sys.exit(0) + + # Check if the mode defined is an ip address + try: + ipaddress.ip_address(self.mode) + self.host = self.mode + except ValueError as exception: + # Ensure that the mode's serial number has the correct format or 'discover' mode. + if self.mode != DISCOVER_MODE and re.fullmatch(r"\d{8}", self.mode) is None: + # Check if the mode is then an ip address + raise ValueError( + f""""{self.mode}" has an invalid value. + Must either be a serial number, ip address, "discover" or "version".""" + ) from exception + + # Discover devices if host has not been defined + if not self.host: + self.mozart_devices = discover_devices( + self.mode, self.timeout, self.verbose + ) + + # Get the ip address from the devices Mozart devices + self.host = next( + ( + device + for device in self.mozart_devices + if device.serial_number == self.mode + ), + MozartDevice(), + ).ip_address + + # Exit if in discover mode, no command has been defined or desired host can't be found. + if self.mode == DISCOVER_MODE or self.command == "" or self.host == "": + sys.exit(0) + + asyncio.run(self._run_api()) + + sys.exit(0) + + async def _run_api(self): + """Run async API command handling""" + # Generate MozartApi object for calling API endpoints. + self.mozart_client = MozartClient(self.host) + + # Connect to the websocket notification channel if defined + if self.websocket: + print("Connecting to WebSocket channel") + self.mozart_client.get_all_notifications(self.all_notifications) + await self.mozart_client.connect_notifications(remote_control=True) + + # Handle command + await self._command_handler() + + # If websocket listener is enabled, then wait for keypress before exiting the CLI + if self.websocket: + await ainput( + "Listening to WebSocket events. Press any key to exit CLI.\n\r" + ) + self.mozart_client.disconnect_notifications() + + await self.mozart_client.close_api_client() + + async def _beolink_join(self): + """Showcase async API usage of the Beolink command.""" + # If no JID is specified, then join an active experience if available + if len(self.command_args) == 0: + status = await self.mozart_client.join_latest_beolink_experience() + + else: + serial_number = self.command_args[0] + + # Check if a device with specified serial number + # is available as a peer and get JID if available + peers = await self.mozart_client.get_beolink_peers() + + # The peers may be outdated and still have now unavailable devices. + if len(peers) == 0: + print("No available Beolink peers.") + return + + jid = [peer for peer in peers if serial_number in peer.jid][0].jid + + status = await self.mozart_client.join_beolink_peer(jid=jid) + + return status + + def all_notifications(self, notification, notification_type): + """Handle all notifications.""" + print(notification_type, notification) + + async def _command_handler(self): + """Handle commands.""" + + print( + f"Sending command: '{self.command}' to device with args {self.command_args}." + ) + status = None + + if self.command == "preset": + preset_id = int(self.command_args[0]) + await self.mozart_client.activate_preset(id=preset_id) + + elif self.command in ("play", "pause", "next", "previous"): + await self.mozart_client.post_playback_command(command=self.command) + + elif self.command == "mute": + await self.mozart_client.set_volume_mute(volume_mute=VolumeMute(muted=True)) + + elif self.command == "unmute": + await self.mozart_client.set_volume_mute( + volume_mute=VolumeMute(muted=False) + ) + + elif self.command == "volume": + volume_level = int(self.command_args[0]) + await self.mozart_client.set_current_volume_level( + volume_level=VolumeLevel(level=volume_level) + ) + + elif self.command == "join": + status = await self._beolink_join() + + # Currently show battery state, product state + elif self.command == "info": + battery_state = await self.mozart_client.get_battery_state() + print(f"Battery state: {battery_state}") + + power_state = await self.mozart_client.get_product_state() + print(f"Product state: {power_state}") + + elif self.command == "allstandby": + await self.mozart_client.post_beolink_allstandby() + + else: + print(f"Invalid command {self.command}.") + return + + # Print verbose status information if defined. + if self.verbose and self.command == "join": + # Wait for the join-result to be available + await asyncio.sleep(1) + print("Beolink Join status:") + print( + await self.mozart_client.get_beolink_join_result(id=status.request_id) + ) diff --git a/python_client/mozart_api/mozart_client.py b/python_client/mozart_api/mozart_client.py new file mode 100644 index 0000000..34808fe --- /dev/null +++ b/python_client/mozart_api/mozart_client.py @@ -0,0 +1,547 @@ +"""Helper classes for using auto-generated API.""" +# pylint: disable=line-too-long too-many-instance-attributes too-many-public-methods + +import asyncio +import json +import logging +import re +from collections import defaultdict +from dataclasses import dataclass +from datetime import time +from typing import Callable + +from aiohttp import ClientSession +from aiohttp.client_exceptions import ( + ClientConnectorError, + ClientOSError, + ServerTimeoutError, +) +from inflection import underscore + +from mozart_api.api.mozart_api import MozartApi +from mozart_api.api_client import ApiClient +from mozart_api.configuration import Configuration +from mozart_api.models import Art, PlaybackContentMetadata + +RECONNECT_INTERVAL = 15.0 +WEBSOCKET_HEARTBEAT = 10 +WEBSOCKET_TIMEOUT = 5.0 + +NOTIFICATION_TYPES = { + "active_hdmi_input_signal", + "active_listening_mode", + "active_speaker_group", + "alarm_timer", + "alarm_triggered", + "battery", + "beo_remote_button", + "beolink_experiences_result", + "beolink_join_result", + "button", + "curtains", + "hdmi_video_format_signal", + "notification", + "playback_error", + "playback_metadata", + "playback_progress", + "playback_source", + "playback_state", + "power_state", + "puc_install_remote_id_status", + "role", + "room_compensation_current_measurement_event", + "room_compensation_state", + "software_update_state", + "sound_settings", + "source_change", + "speaker_group_changed", + "stand_connected", + "stand_position", + "tv_info", + "volume", + "wisa_out_state", +} + +logger = logging.getLogger(__name__) + + +def refactor_name(notification_type: str) -> str: + """Remove WebSocketEvent prefix from string and convert to snake_case.""" + return underscore(notification_type.removeprefix("WebSocketEvent")) + + +def time_to_seconds(time_object: time) -> int: + """Convert time object to number of seconds.""" + return (time_object.hour * 60 * 60) + (time_object.minute * 60) + time_object.second + + +def check_valid_jid(jid: str) -> bool: + """Check if a JID is valid.""" + pattern = re.compile(r"(^\d{4})[.](\d{7})[.](\d{8})(@products\.bang-olufsen\.com)$") + + if pattern.fullmatch(jid) is not None: + return True + + return False + + +def check_valid_serial_number(serial_number: str) -> bool: + """Check if a serial_number is valid.""" + return bool(re.fullmatch(r"\d{8}", serial_number)) + + +def get_highest_resolution_artwork(metadata: PlaybackContentMetadata) -> Art: + """Get the highest resolution Art from provided PlaybackContentMetadata.""" + + # Return an empty Art if no artwork is in metadata to ensure no stale artwork + if not metadata.art: + return Art() # type: ignore + + # Dict for sorting images that have size defined by a string + art_size = {"small": 1, "medium": 2, "large": 3} + + images = [] + + # Images either have a key for specifying resolution or a "size" for the image. + for image in metadata.art: + # Netradio. + if image.key: + images.append(int(image.key.split("x")[0])) + # Everything else. + elif image.size: + images.append(art_size[image.size]) + + # Choose the largest image. + return metadata.art[images.index(max(images))] + + +class MozartClient(MozartApi): + """User friendly setup for a Mozart device.""" + + def __init__( + self, + host: str, + websocket_reconnect: bool = False, + websocket_reconnect_interval: float = RECONNECT_INTERVAL, + urllib3_logging_level: int = logging.WARNING, + ) -> None: + """Initialize Mozart device.""" + self.host: str = host + self.websocket_connected: bool = False + self.websocket_reconnect: bool = websocket_reconnect + self._websocket_reconnect_interval: float = websocket_reconnect_interval + + self._websocket_tasks: set[asyncio.Task] = set() + self._websocket_active: bool = False + + self._on_connection_lost = None + self._on_connection = None + + self._on_all_notifications = None + self._on_all_notifications_raw = None + + self._notification_callbacks: dict[str, Callable | None] = defaultdict() + self._notification_callbacks.default_factory = lambda: None + + # Configure MozartApi object. + self.configuration = Configuration(host="http://" + self.host) + self.configuration.logger["urllib3_logger"].setLevel(urllib3_logging_level) + self.configuration.verify_ssl = False + + super().__init__(ApiClient(self.configuration)) + + async def close_api_client(self) -> None: + """Close the API ClientSession.""" + await self.api_client.close() + + async def __aenter__(self): + """Context entry""" + if self.api_client.rest_client.pool_manager.closed: + self.api_client = ApiClient(self.configuration) + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + """Context exit.""" + await self.api_client.close() + + @dataclass + class _ResponseWrapper: + """Wrapper class for deserializing WebSocket response.""" + + data: str + + async def connect_notifications(self, remote_control=False) -> bool: + """Start the WebSocket listener task(s). Returns if a connection can be made.""" + + # Always add main WebSocket listener + if len(self._websocket_tasks) == 0: + websocket_listener = asyncio.create_task( + coro=self._websocket_listener(f"ws://{self.host}:9339/"), + name=f"{self.host} - listener task", + ) + self._websocket_tasks.add(websocket_listener) + + # Add WebSocket listener for remote control events if defined. + if len(self._websocket_tasks) == 1 and remote_control: + websocket_remote_listener = asyncio.create_task( + coro=self._websocket_listener(f"ws://{self.host}:9339/remoteControl"), + name=f"{self.host} - remote listener task", + ) + self._websocket_tasks.add(websocket_remote_listener) + + self._websocket_active = True + + return await self.check_websocket_connection() + + async def check_websocket_connection(self) -> bool: + """Check if a connection can be made to the device's WebSocket notification channel.""" + try: + async with ClientSession(conn_timeout=WEBSOCKET_TIMEOUT) as session: + async with session.ws_connect(f"ws://{self.host}:9339/") as websocket: + return bool(await websocket.receive()) + + except (ClientConnectorError, ClientOSError, ServerTimeoutError): + return False + + def disconnect_notifications(self) -> None: + """Stop the WebSocket listener tasks.""" + self._websocket_active = False + + for task in self._websocket_tasks: + task.cancel() + + self._websocket_tasks = set() + + async def _websocket_listener(self, host: str) -> None: + """WebSocket listener.""" + while True: + try: + async with ClientSession(conn_timeout=WEBSOCKET_TIMEOUT) as session: + async with session.ws_connect( + url=host, heartbeat=WEBSOCKET_HEARTBEAT + ) as websocket: + self.websocket_connected = True + + if self._on_connection: + await self._trigger_callback(self._on_connection) + + while self._websocket_active: + try: + # Receive JSON in order to get the Websocket notification name for deserialization + notification = await asyncio.wait_for( + websocket.receive_json(), + timeout=WEBSOCKET_TIMEOUT, + ) + + # Ensure that any notifications received after the disconnect command has been executed are not processed + if not self._websocket_active: + break + + await self._on_message(notification) + + except asyncio.TimeoutError: + pass + + return + + except ( + ClientConnectorError, + ClientOSError, + TypeError, + ServerTimeoutError, + ) as error: + if self.websocket_connected: + self.websocket_connected = False + + if self._on_connection_lost: + await self._trigger_callback(self._on_connection_lost) + + if not self.websocket_reconnect: + logger.error("%s : %s", host, error) + return + + await asyncio.sleep(self._websocket_reconnect_interval) + + except asyncio.CancelledError: + return + + async def _on_message(self, notification) -> None: + """Handle WebSocket notifications.""" + + # Get the object type and deserialized object. + try: + notification_type = notification["eventType"] + + deserialized_data = self.api_client.deserialize( + self._ResponseWrapper(json.dumps(notification)), notification_type + ).event_data + + except (ValueError, AttributeError) as error: + logger.error( + "Unable to deserialize WebSocket notification: (%s : %s) with error: (%s : %s)", + notification_type, + notification, + type(error), + error, + ) + return + + # Ensure that only valid notifications trigger callbacks + if deserialized_data is None: + return + + # Handle all notifications if defined + if self._on_all_notifications: + await self._trigger_callback( + self._on_all_notifications, + notification, + refactor_name(notification_type), + ) + + if self._on_all_notifications_raw: + await self._trigger_callback(self._on_all_notifications_raw, notification) + + # Handle specific notifications if defined + triggered_notification = self._notification_callbacks[notification_type] + + if triggered_notification: + await self._trigger_callback(triggered_notification, deserialized_data) + + async def _trigger_callback(self, callback, *args): + """Trigger async or sync callback correctly.""" + if asyncio.iscoroutinefunction(callback): + await callback(*args) + else: + callback(*args) + + def get_on_connection_lost(self, on_connection_lost) -> None: + """Callback for WebSocket connection lost.""" + self._on_connection_lost = on_connection_lost + + def get_on_connection(self, on_connection) -> None: + """Callback for WebSocket connection.""" + self._on_connection = on_connection + + def get_all_notifications(self, on_all_notifications) -> None: + """Callback for all notifications.""" + self._on_all_notifications = on_all_notifications + + def get_all_notifications_raw(self, on_all_notifications_raw) -> None: + """Callback for all notifications as dict.""" + self._on_all_notifications_raw = on_all_notifications_raw + + def get_active_hdmi_input_signal_notifications( + self, on_active_hdmi_input_signal_notification + ) -> None: + """Callback for WebSocketEventActiveHdmiInputSignal notifications.""" + self._notification_callbacks[ + "WebSocketEventActiveHdmiInputSignal" + ] = on_active_hdmi_input_signal_notification + + def get_active_listening_mode_notifications( + self, on_active_listening_mode_notification + ) -> None: + """Callback for WebSocketEventActiveListeningMode notifications.""" + self._notification_callbacks[ + "WebSocketEventActiveListeningMode" + ] = on_active_listening_mode_notification + + def get_active_speaker_group_notifications( + self, on_active_speaker_group_notification + ) -> None: + """Callback for WebSocketEventActiveSpeakerGroup notifications.""" + self._notification_callbacks[ + "WebSocketEventActiveSpeakerGroup" + ] = on_active_speaker_group_notification + + def get_alarm_timer_notifications(self, on_alarm_timer_notification) -> None: + """Callback for WebSocketEventAlarmTimer notifications.""" + self._notification_callbacks[ + "WebSocketEventAlarmTimer" + ] = on_alarm_timer_notification + + def get_alarm_triggered_notifications( + self, on_alarm_triggered_notification + ) -> None: + """Callback for WebSocketEventAlarmTriggered notifications.""" + self._notification_callbacks[ + "WebSocketEventAlarmTriggered" + ] = on_alarm_triggered_notification + + def get_battery_notifications(self, on_battery_notification) -> None: + """Callback for WebSocketEventBattery notifications.""" + self._notification_callbacks["WebSocketEventBattery"] = on_battery_notification + + def get_beo_remote_button_notifications( + self, on_beo_remote_button_notification + ) -> None: + """Callback for WebSocketEventBeoRemoteButton notifications.""" + self._notification_callbacks[ + "WebSocketEventBeoRemoteButton" + ] = on_beo_remote_button_notification + + def get_beolink_experiences_result_notifications( + self, on_beolink_experiences_result_notification + ) -> None: + """Callback for WebSocketEventBeolinkExperiencesResult notifications.""" + self._notification_callbacks[ + "WebSocketEventBeolinkExperiencesResult" + ] = on_beolink_experiences_result_notification + + def get_beolink_join_result_notifications( + self, on_beolink_join_result_notification + ) -> None: + """Callback for WebSocketEventBeolinkJoinResult notifications.""" + self._notification_callbacks[ + "WebSocketEventBeolinkJoinResult" + ] = on_beolink_join_result_notification + + def get_button_notifications(self, on_button_notification) -> None: + """Callback for WebSocketEventButton notifications.""" + self._notification_callbacks["WebSocketEventButton"] = on_button_notification + + def get_curtains_notifications(self, on_curtains_notification) -> None: + """Callback for WebSocketEventCurtains notifications.""" + self._notification_callbacks[ + "WebSocketEventCurtains" + ] = on_curtains_notification + + def get_hdmi_video_format_signal_notifications( + self, on_hdmi_video_format_signal_notification + ) -> None: + """Callback for WebSocketEventHdmiVideoFormatSignal notifications.""" + self._notification_callbacks[ + "WebSocketEventHdmiVideoFormatSignal" + ] = on_hdmi_video_format_signal_notification + + def get_notification_notifications(self, on_notification_notification) -> None: + """Callback for WebSocketEventNotification notifications.""" + self._notification_callbacks[ + "WebSocketEventNotification" + ] = on_notification_notification + + def get_playback_error_notifications(self, on_playback_error_notification) -> None: + """Callback for WebSocketEventPlaybackError notifications.""" + self._notification_callbacks[ + "WebSocketEventPlaybackError" + ] = on_playback_error_notification + + def get_playback_metadata_notifications( + self, on_playback_metadata_notification + ) -> None: + """Callback for WebSocketEventPlaybackMetadata notifications.""" + self._notification_callbacks[ + "WebSocketEventPlaybackMetadata" + ] = on_playback_metadata_notification + + def get_playback_progress_notifications( + self, on_playback_progress_notification + ) -> None: + """Callback for WebSocketEventPlaybackProgress notifications.""" + self._notification_callbacks[ + "WebSocketEventPlaybackProgress" + ] = on_playback_progress_notification + + def get_playback_source_notifications( + self, on_playback_source_notification + ) -> None: + """Callback for WebSocketEventPlaybackSource notifications.""" + self._notification_callbacks[ + "WebSocketEventPlaybackSource" + ] = on_playback_source_notification + + def get_playback_state_notifications(self, on_playback_state_notification) -> None: + """Callback for WebSocketEventPlaybackState notifications.""" + self._notification_callbacks[ + "WebSocketEventPlaybackState" + ] = on_playback_state_notification + + def get_power_state_notifications(self, on_power_state_notification) -> None: + """Callback for WebSocketEventPowerState notifications.""" + self._notification_callbacks[ + "WebSocketEventPowerState" + ] = on_power_state_notification + + def get_puc_install_remote_id_status_notifications( + self, on_puc_install_remote_id_status_notification + ) -> None: + """Callback for WebSocketEventPucInstallRemoteIdStatus notifications.""" + self._notification_callbacks[ + "WebSocketEventPucInstallRemoteIdStatus" + ] = on_puc_install_remote_id_status_notification + + def get_role_notifications(self, on_role_notification) -> None: + """Callback for WebSocketEventRole notifications.""" + self._notification_callbacks["WebSocketEventRole"] = on_role_notification + + def get_room_compensation_current_measurement_event_notifications( + self, on_room_compensation_current_measurement_event_notification + ) -> None: + """Callback for WebSocketEventRoomCompensationCurrentMeasurementEvent notifications.""" + self._notification_callbacks[ + "WebSocketEventRoomCompensationCurrentMeasurementEvent" + ] = on_room_compensation_current_measurement_event_notification + + def get_room_compensation_state_notifications( + self, on_room_compensation_state_notification + ) -> None: + """Callback for WebSocketEventRoomCompensationState notifications.""" + self._notification_callbacks[ + "WebSocketEventRoomCompensationState" + ] = on_room_compensation_state_notification + + def get_software_update_state_notifications( + self, on_software_update_state_notification + ) -> None: + """Callback for WebSocketEventSoftwareUpdateState notifications.""" + self._notification_callbacks[ + "WebSocketEventSoftwareUpdateState" + ] = on_software_update_state_notification + + def get_sound_settings_notifications(self, on_sound_settings_notification) -> None: + """Callback for WebSocketEventSoundSettings notifications.""" + self._notification_callbacks[ + "WebSocketEventSoundSettings" + ] = on_sound_settings_notification + + def get_source_change_notifications(self, on_source_change_notification) -> None: + """Callback for WebSocketEventSourceChange notifications.""" + self._notification_callbacks[ + "WebSocketEventSourceChange" + ] = on_source_change_notification + + def get_speaker_group_changed_notifications( + self, on_speaker_group_changed_notification + ) -> None: + """Callback for WebSocketEventSpeakerGroupChanged notifications.""" + self._notification_callbacks[ + "WebSocketEventSpeakerGroupChanged" + ] = on_speaker_group_changed_notification + + def get_stand_connected_notifications( + self, on_stand_connected_notification + ) -> None: + """Callback for WebSocketEventStandConnected notifications.""" + self._notification_callbacks[ + "WebSocketEventStandConnected" + ] = on_stand_connected_notification + + def get_stand_position_notifications(self, on_stand_position_notification) -> None: + """Callback for WebSocketEventStandPosition notifications.""" + self._notification_callbacks[ + "WebSocketEventStandPosition" + ] = on_stand_position_notification + + def get_tv_info_notifications(self, on_tv_info_notification) -> None: + """Callback for WebSocketEventTvInfo notifications.""" + self._notification_callbacks["WebSocketEventTvInfo"] = on_tv_info_notification + + def get_volume_notifications(self, on_volume_notification) -> None: + """Callback for WebSocketEventVolume notifications.""" + self._notification_callbacks["WebSocketEventVolume"] = on_volume_notification + + def get_wisa_out_state_notifications(self, on_wisa_out_state_notification) -> None: + """Callback for WebSocketEventWisaOutState notifications.""" + self._notification_callbacks[ + "WebSocketEventWisaOutState" + ] = on_wisa_out_state_notification diff --git a/python_client/mozart_api/py.typed b/python_client/mozart_api/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/python_client/mozart_api/rest.py b/python_client/mozart_api/rest.py new file mode 100644 index 0000000..a79d5d8 --- /dev/null +++ b/python_client/mozart_api/rest.py @@ -0,0 +1,312 @@ +# coding: utf-8 + +""" + Mozart platform API + + API for interacting with the Mozart platform. + + The version of the OpenAPI document: 0.2.0 + Contact: support@bang-olufsen.dk + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import logging +import re +import ssl + +import aiohttp +from urllib.parse import urlencode, quote_plus + +from mozart_api.exceptions import ApiException, ApiValueError + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + def __init__(self, resp, data) -> None: + self.aiohttp_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = data + + def getheaders(self): + """Returns a CIMultiDictProxy of the response headers.""" + return self.aiohttp_response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.aiohttp_response.headers.get(name, default) + + +class RESTClientObject: + def __init__(self, configuration, pools_size=4, maxsize=None) -> None: + # maxsize is number of requests to host that are allowed in parallel + if maxsize is None: + maxsize = configuration.connection_pool_maxsize + + ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) + if configuration.cert_file: + ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE + + connector = aiohttp.TCPConnector(limit=maxsize, ssl=ssl_context) + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + # https pool manager + self.pool_manager = aiohttp.ClientSession(connector=connector, trust_env=True) + + async def close(self): + await self.pool_manager.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 + (connection, read) timeouts. + """ + method = method.upper() + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + 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: + headers["Content-Type"] = "application/json" + + args = {"method": method, "url": url, "timeout": timeout, "headers": headers} + + if self.proxy: + args["proxy"] = self.proxy + 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" + ): # noqa: E501 + args["data"] = aiohttp.FormData(post_params) + elif headers["Content-Type"] == "multipart/form-data": + # must del headers['Content-Type'], or the correct + # Content-Type which generated by aiohttp + del headers["Content-Type"] + data = aiohttp.FormData() + for param in post_params: + k, v = param + if isinstance(v, tuple) and len(v) == 3: + data.add_field(k, value=v[1], filename=v[0], content_type=v[2]) + else: + data.add_field(k, v) + args["data"] = data + + # Pass a `bytes` parameter directly in the body to support + # other content types than Json when `body` argument is provided + # in serialized form + elif isinstance(body, bytes): + args["data"] = body + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + + 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) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=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 new file mode 100644 index 0000000..a522d23 --- /dev/null +++ b/python_client/pyproject.toml @@ -0,0 +1,63 @@ +[tool.poetry] +name = "mozart_api" +version = "3.2.1.150.6" +description = "Mozart platform API" +authors = [ + "BangOlufsen ", +] +license = "MIT" +readme = "README.md" +repository = "https://github.com/bang-olufsen/mozart-open-api" +keywords = [ + "OpenAPI", + "OpenAPI-Generator", + "Mozart platform API", +] +include = [ + "mozart_api/py.typed", +] +homepage = "https://pypi.org/project/mozart-api/" +documentation = "https://bang-olufsen.github.io/mozart-open-api/" +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Topic :: Multimedia", + "Intended Audience :: Developers", +] +exclude = [ + "test", +] + +[tool.poetry.dependencies] +urllib3 = ">= 1.25.3" +python-dateutil = ">=2.8.2" +aiohttp = ">=3.8.3" +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" +python = ">=3.8" + +[tool.poetry.dev-dependencies] +pytest = ">=7.2.1" +tox = ">=3.9.0" +flake8 = ">=4.0.0" + +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/bang-olufsen/mozart-open-api/issues" + +[tool.poetry.scripts] +mozart_api = "mozart_api.mozart_cli:MozartApiCli" + +[tool.pylint."MESSAGES CONTROL"] +extension-pkg-whitelist = "pydantic" + +[build-system] +requires = [ + "poetry-core", +] +build-backend = "poetry.core.masonry.api"