Skip to content

Commit 145462b

Browse files
authored
Update _messages.py
1 parent 9e5c7cc commit 145462b

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

python37/src/push_admin/_messages.py

+3-20
Original file line numberDiff line numberDiff line change
@@ -381,17 +381,13 @@ class AndroidClickAction(object):
381381
1: to specific activity of application
382382
2: specific URL
383383
3: to specific application
384-
rich_resource: rich_resource of the android.notification (optional).
385384
"""
386-
def __init__(self, action_type=None, intent=None, action=None, url=None, rich_resource=None):
387-
MessageValidator.check_click_action(action_type=action_type, intent=intent, action=action, url=url,
388-
rich_resource=rich_resource)
385+
def __init__(self, action_type=None, intent=None, action=None, url=None):
386+
MessageValidator.check_click_action(action_type=action_type, intent=intent, action=action, url=url)
389387
self.action_type = action_type
390388
self.intent = intent
391389
self.action = action
392390
self.url = url
393-
self.rich_resource = rich_resource
394-
395391

396392
class AndroidBadgeNotification(object):
397393
"""A BadgeNotification that can be included in a message.android.notification.
@@ -736,12 +732,6 @@ def check_android(cls, title, body, icon, color, sound, default_sound, tag, clic
736732
raise ValueError('AndroidNotification.big_title must be valid string when style is 1')
737733
if (big_body is None) and (not isinstance(big_body, str)):
738734
raise ValueError('AndroidNotification.big_body must be valid string when style is 1')
739-
# # big_picture
740-
# if style == 2:
741-
# if (big_picture is None) or (not isinstance(big_picture, str)):
742-
# raise ValueError('AndroidNotification.big_picture must be valid string when style is 2')
743-
# if not big_picture.upper().startswith('HTTPS'):
744-
# raise ValueError('AndroidNotification.big_picture must be valid https url address when type is 2')
745735
# auto_clear
746736
cls.check_number(label='AndroidNotification.auto_clear ', value=auto_clear)
747737
# notify_id
@@ -786,7 +776,7 @@ def check_badge_notification(cls, add_num, set_num, clazz):
786776
cls.check_string(hint="AndroidBadgeNotification.clazz", value=clazz)
787777

788778
@classmethod
789-
def check_click_action(cls, action_type, intent, action, url, rich_resource):
779+
def check_click_action(cls, action_type, intent, action, url):
790780
# type must be in [1, 4]
791781
if (action_type is None) or (action_type not in [1, 2, 3, 4]):
792782
raise ValueError('ClickAction.type must be in [1, 2, 3, 4]')
@@ -804,13 +794,6 @@ def check_click_action(cls, action_type, intent, action, url, rich_resource):
804794
if not url.upper().startswith('HTTPS'):
805795
raise ValueError('ClickAction.url must be https prefix when ClickAction.type is 2')
806796

807-
# rich_resource, if type is 4, rich_resource must
808-
if action_type == 4:
809-
if not isinstance(rich_resource, str):
810-
raise ValueError('ClickAction.rich_resource must when ClickAction.type is 4')
811-
if not rich_resource.upper().startswith('HTTPS'):
812-
raise ValueError('ClickAction.rich_resource must be https prefix when ClickAction.type is 4')
813-
814797
@classmethod
815798
def check_light_settings(cls, color, light_on_duration, light_off_duration):
816799
cls.check_type(color, AndroidLightSettingsColor, "color must be an instance of AndroidLightSettingsColor")

0 commit comments

Comments
 (0)