bosesoundtouchapi.soundtouchmodelrequest
@export
class
SoundTouchModelRequest:
A class representing a model that can issue a POST request with an xml payload that gets placed in the request body.
@abstractmethod
def
ToElement(self, isRequestBody: bool = False) -> xml.etree.ElementTree.Element:
Returns an xmltree Element node representation of the class.
Arguments:
- isRequestBody (bool): True if the element should only return attributes needed for a POST request body; otherwise, False to return all attributes.
@abstractmethod
def
ToXmlRequestBody(self, encoding: str = 'utf-8') -> str:
Returns a POST request body, which is used to update the device configuration.
Arguments:
- encoding (str): encode type (e.g. 'utf-8', 'unicode', etc).
Default is 'utf-8'.
Returns:
An xml string that can be used in a POST request to update the device configuration.