コード例 #1
0
    def set_notification_level(self, level):
        """Set the notification level of the conversation.

        Pass hangouts_pb2.NOTIFICATION_LEVEL_QUIET to disable notifications, or
        hangouts_pb2.NOTIFICATION_LEVEL_RING to enable them.

        Raises hangups.NetworkError if the request fails.
        """
        yield from self._client.set_conversation_notification_level(
            hangouts_pb2.SetConversationNotificationLevelRequest(
                request_header=self._client.get_request_header(),
                conversation_id=hangouts_pb2.ConversationId(id=self.id_),
                level=level,
            ))
コード例 #2
0
    async def set_notification_level(self, level):
        """Set the notification level of this conversation.

        Args:
            level: ``NOTIFICATION_LEVEL_QUIET`` to disable notifications, or
                ``NOTIFICATION_LEVEL_RING`` to enable them.

        Raises:
            .NetworkError: If the request fails.
        """
        await self._client.set_conversation_notification_level(
            hangouts_pb2.SetConversationNotificationLevelRequest(
                request_header=self._client.get_request_header(),
                conversation_id=hangouts_pb2.ConversationId(id=self.id_),
                level=level,
            ))
コード例 #3
0
    def setconversationnotificationlevel(self, conversation_id, level):
        """Set the notification level of a conversation.

        Pass hangouts_pb2.NOTIFICATION_LEVEL_QUIET to disable notifications, or
        hangouts_pb2.NOTIFICATION_LEVEL_RING to enable them.

        Raises hangups.NetworkError if the request fails.
        """
        request = hangouts_pb2.SetConversationNotificationLevelRequest(
            request_header=self._get_request_header_pb(),
            conversation_id=hangouts_pb2.ConversationId(id=conversation_id),
            level=level,
        )
        response = hangouts_pb2.SetConversationNotificationLevelResponse()
        yield from self._pb_request(
            'conversations/setconversationnotificationlevel', request, response
        )
        return response