File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ def __init__(self, location=None):
2626 self .device_token_url = self .base_url + "device_tokens/"
2727 self .apid_url = self .base_url + "apids/"
2828 self .push_url = self .base_url + "push/"
29+ self .validate_url = self .push_url + "validate/"
2930 self .schedules_url = self .base_url + "schedules/"
3031 self .tags_url = self .base_url + "tags/"
3132 self .segments_url = self .base_url + "segments/"
Original file line number Diff line number Diff line change @@ -50,6 +50,22 @@ def device_types(self, types):
5050 )
5151 self ._device_types = types
5252
53+ def validate (self ):
54+ """
55+ Test push payload against the validate endpoint. No sends will result from this
56+ method being called. This method is otherwise identical to the `send` method.
57+ """
58+
59+ response = self ._airship ._request (
60+ method = "POST" ,
61+ body = json .dumps (self .payload ),
62+ url = self ._airship .urls .get ("validate_url" ),
63+ content_type = "application/json" ,
64+ version = 3 ,
65+ )
66+
67+ return PushResponse (response )
68+
5369 def send (self ):
5470 """Send the notification.
5571
You can’t perform that action at this time.
0 commit comments