def id_last_played_item(self, id_last_played_item: str) -> None: raise_if_variable_not_expected_type( value=id_last_played_item, expected_type=str, variable_name="id_last_played_item") self.history.put("idLastPlayedItem", id_last_played_item) self.parent_handler_input.persistent_memorize( data_key="audioPlayerHistory", data_value=self.history)
def remote_endpoint( self, endpoint_url: str, endpoint_method: str = RemoteEndpoint.METHOD_POST) -> None: raise_if_variable_not_expected_type(value=endpoint_url, expected_type=endpoint_url, variable_name="endpoint_url") raise_if_value_not_in_list( value=endpoint_method, list_object=self.RemoteEndpoint.AVAILABLE_METHODS, variable_name="endpoint_method") self._remote_endpoint = self.RemoteEndpoint
def audioPlayer(self, audioPlayer: AudioPlayer) -> None: if self._audioPlayer is not None: logging.warning( f"The AudioPlayer has been with a playBehavior of {audioPlayer.playBehavior} where it had already" f"been set to another AudioPlayer with a playBehavior of {self._audioPlayer.playBehavior}." f"Normally you should set the AudioPlayer a maximum of one time per invocation, since if" f"you set it again you override the previously set one.") raise_if_variable_not_expected_type(value=audioPlayer, expected_type=AudioPlayer, variable_name="audioPlayer") self._audioPlayer = audioPlayer self.parent_handler_input.alexa.response.directives.append(audioPlayer) from inoft_vocal_framework.platforms_handlers.alexa.audioplayer.audioplayer_handlers import AlexaAudioPlayerHandlers self.parent_handler_input.alexa.save_audioplayer_handlers_group_class( handlers_group_class_type=AlexaAudioPlayerHandlers)
def text(self, text: str) -> None: raise_if_variable_not_expected_type(value=text, expected_type=str, variable_name="text") self._type = "PlainText" self._text = text
def seconds_end_time(self, seconds: float) -> None: raise_if_variable_not_expected_type(value=seconds, expected_type=float, variable_name="seconds_end_time") self._seconds_end_time = seconds
def applicationId(self, applicationId: str) -> None: raise_if_variable_not_expected_type( value=applicationId, expected_type=str, variable_name="applicationId") self._applicationId = applicationId
def offsetInMilliseconds(self, offsetInMilliseconds: int) -> None: raise_if_variable_not_expected_type( value=offsetInMilliseconds, expected_type=int, variable_name="offsetInMilliseconds") self._offsetInMilliseconds = offsetInMilliseconds
def apiEndpoint(self, apiEndpoint: str) -> None: raise_if_variable_not_expected_type(value=apiEndpoint, expected_type=str, variable_name="apiEndpoint") self._apiEndpoint = apiEndpoint
def intent(self, intent: str) -> None: raise_if_variable_not_expected_type(value=intent, expected_type=str, variable_name="intent") self._intent = intent
def shouldEndSession(self, shouldEndSession: bool) -> None: raise_if_variable_not_expected_type(value=shouldEndSession, expected_type=bool, variable_name="shouldEndSession") self._shouldEndSession = shouldEndSession
def synonyms(self, synonyms_list: list) -> None: raise_if_variable_not_expected_type( value=synonyms_list, expected_type=list, variable_name="synonyms_list") self._synonyms = synonyms_list
def key(self, key: str) -> None: raise_if_variable_not_expected_type(value=key, expected_type=str, variable_name="key") self._key = key
def image(self, image: Image) -> None: raise_if_variable_not_expected_type(value=image, expected_type=Image, variable_name="image") self._image = image
def description(self, description: str) -> None: raise_if_variable_not_expected_type( value=description, expected_type=str, variable_name="description") self._description = description
def id(self, id: str) -> None: raise_if_variable_not_expected_type(value=id, expected_type=str, variable_name="id") self._id = id
def append_sound_after_last_one(self, append_sound_after_last_one: bool) -> None: raise_if_variable_not_expected_type(value=append_sound_after_last_one, expected_type=bool, variable_name="append_sound_after_last_one") self._append_sound_after_last_one = append_sound_after_last_one
def relation(self, relation: Relation) -> None: raise_if_variable_not_expected_type(value=relation, expected_type=Relation, variable_name="relation") self._relation = relation
def ssml(self, ssml: str) -> None: raise_if_variable_not_expected_type(value=ssml, expected_type=str, variable_name="ssml") self._type = "SSML" self._ssml = ssml
def card(self, card: Card) -> None: raise_if_variable_not_expected_type(value=card, expected_type=Card, variable_name="card") self._card = card
def title(self, title: str) -> None: raise_if_variable_not_expected_type(value=title, expected_type=str, variable_name="title") self._title = title
def sessionId(self, sessionId: str) -> None: raise_if_variable_not_expected_type(value=sessionId, expected_type=str, variable_name="sessionId") self._sessionId = sessionId
def items(self, items_list: list) -> None: raise_if_variable_not_expected_type(value=items_list, expected_type=list, variable_name="items_list") self._items = items_list
def deviceId(self, deviceId: str) -> None: raise_if_variable_not_expected_type(value=deviceId, expected_type=str, variable_name="deviceId") self._deviceId = deviceId
def identifier(self, identifier: str) -> None: raise_if_variable_not_expected_type(value=identifier, expected_type=str, variable_name="identifier") self._identifier = identifier
def apiAccessToken(self, apiAccessToken: str) -> None: raise_if_variable_not_expected_type(value=apiAccessToken, expected_type=str, variable_name="apiAccessToken") self._apiAccessToken = apiAccessToken
def endpoints(self, endpoints: Endpoints) -> None: raise_if_variable_not_expected_type(value=endpoints, expected_type=self.Endpoints, variable_name="endpoints") self._endpoints = endpoints
def token(self, token: str) -> None: raise_if_variable_not_expected_type(value=token, expected_type=str, variable_name="token") self._token = token
def url(self, url: str) -> None: raise_if_variable_not_expected_type(value=url, expected_type=str, variable_name="url") self._url = url
def userId(self, userId: str) -> None: raise_if_variable_not_expected_type(value=userId, expected_type=str, variable_name="userId") self._userId = userId
def last_messages_list_id(self, last_messages_list_id: str) -> None: raise_if_variable_not_expected_type( value=last_messages_list_id, expected_type=str, variable_name="last_messages_list_id") self._last_messages_list_id = last_messages_list_id