@@ -40,7 +40,7 @@ def __init__(self, channel, notification_type, control_type):
4040 self ._channel = channel
4141 self ._notification_type = Type (notification_type )
4242 self ._control_type = Control (control_type )
43-
43+
4444 @property
4545 def channel (self ):
4646 return self ._channel
@@ -87,7 +87,7 @@ def change_number(self):
8787 @property
8888 def notification_type (self ):
8989 return self ._notification_type
90-
90+
9191 @property
9292 def segment_name (self ):
9393 return self ._segment_name
@@ -111,7 +111,7 @@ def __init__(self, channel, notification_type, change_number):
111111 self ._channel = channel
112112 self ._notification_type = Type (notification_type )
113113 self ._change_number = change_number
114-
114+
115115 @property
116116 def channel (self ):
117117 return self ._channel
@@ -149,23 +149,23 @@ def __init__(self, channel, notification_type, change_number, default_treatment,
149149 self ._change_number = change_number
150150 self ._default_treatment = default_treatment
151151 self ._split_name = split_name
152-
152+
153153 @property
154154 def channel (self ):
155155 return self ._channel
156-
156+
157157 @property
158158 def change_number (self ):
159159 return self ._change_number
160-
160+
161161 @property
162162 def default_treatment (self ):
163163 return self ._default_treatment
164-
164+
165165 @property
166166 def notification_type (self ):
167167 return self ._notification_type
168-
168+
169169 @property
170170 def split_name (self ):
171171 return self ._split_name
@@ -178,25 +178,26 @@ def split_name(self):
178178 Type .CONTROL : lambda c , d : ControlNotification (c , Type .CONTROL , d ['controlType' ])
179179}
180180
181- def wrap_notification (raw_data , channel ):
182- """
183- Parse notification from raw notification payload
184181
185- :param raw_data: data
186- :type raw_data: str
187- :param channel: Channel of incoming notification
188- :type channel: str
189- """
190- try :
191- if channel is None :
192- raise ValueError ("channel cannot be None." )
193- raw_data = json .loads (raw_data )
194- notification_type = Type (raw_data ['type' ])
195- mapper = _NOTIFICATION_MAPPERS [notification_type ]
196- return mapper (channel , raw_data )
197- except ValueError :
198- raise ValueError ("Wrong notification type received." )
199- except KeyError :
200- raise KeyError ("Could not parse notification." )
201- except TypeError :
202- raise TypeError ("Wrong JSON format." )
182+ def wrap_notification (raw_data , channel ):
183+ """
184+ Parse notification from raw notification payload
185+
186+ :param raw_data: data
187+ :type raw_data: str
188+ :param channel: Channel of incoming notification
189+ :type channel: str
190+ """
191+ try :
192+ if channel is None :
193+ raise ValueError ("channel cannot be None." )
194+ raw_data = json .loads (raw_data )
195+ notification_type = Type (raw_data ['type' ])
196+ mapper = _NOTIFICATION_MAPPERS [notification_type ]
197+ return mapper (channel , raw_data )
198+ except ValueError :
199+ raise ValueError ("Wrong notification type received." )
200+ except KeyError :
201+ raise KeyError ("Could not parse notification." )
202+ except TypeError :
203+ raise TypeError ("Wrong JSON format." )
0 commit comments