1515#
1616
1717from solnlib import splunk_rest_client as rest_client
18- from typing import Optional , List
18+ from typing import Optional
1919import json
2020
2121__all__ = ["BulletinRestClient" ]
@@ -40,18 +40,18 @@ def __init__(
4040 app : str ,
4141 ** context : dict ,
4242 ):
43- """Initializes BulletinRestClient.
44- When creating a new bulletin message, you must provide a name, which is a kind of ID.
45- If you try to create another message with the same name (ID), the API will not add another message
46- to the bulletin, but it will overwrite the existing one. Similar behaviour applies to deletion.
47- To delete a message, you must indicate the name (ID) of the message.
48- To provide better and easier control over bulletin messages, this client works in such a way
49- that there is one instance responsible for handling one specific message.
50- If you need to add another message to bulletin create another instance
51- with a different 'message_name'
52- e.g.
53- msg_1 = BulletinRestClient("message_1", "<some session key>")
54- msg_2 = BulletinRestClient("message_2", "<some session key>")
43+ """Initializes BulletinRestClient. When creating a new bulletin
44+ message, you must provide a name, which is a kind of ID. If you try to
45+ create another message with the same name (ID), the API will not add
46+ another message to the bulletin, but it will overwrite the existing
47+ one. Similar behaviour applies to deletion. To delete a message, you
48+ must indicate the name (ID) of the message. To provide better and
49+ easier control over bulletin messages, this client works in such a way
50+ that there is one instance responsible for handling one specific
51+ message. If you need to add another message to bulletin create another
52+ instance with a different 'message_name' e.g. msg_1 =
53+ BulletinRestClient("message_1", "<some session key>") msg_2 =
54+ BulletinRestClient("message_2", "<some session key>")
5555
5656 Arguments:
5757 message_name: Name of the message in the Splunk's bulletin.
@@ -72,8 +72,8 @@ def create_message(
7272 self ,
7373 msg : str ,
7474 severity : Severity = Severity .WARNING ,
75- capabilities : Optional [List [str ]] = None ,
76- roles : Optional [List ] = None ,
75+ capabilities : Optional [list [str ]] = None ,
76+ roles : Optional [list ] = None ,
7777 ):
7878 """Creates a message in the Splunk's bulletin. Calling this method
7979 multiple times for the same instance will overwrite existing message.
@@ -144,7 +144,7 @@ def delete_message(self):
144144 self ._rest_client .delete (endpoint )
145145
146146 @staticmethod
147- def _validate_and_get_body_value (arg , error_msg ) -> List :
147+ def _validate_and_get_body_value (arg , error_msg ) -> list :
148148 if type (arg ) is list and (all (isinstance (el , str ) for el in arg )):
149149 return [el for el in arg ]
150150 else :
0 commit comments