@@ -108,6 +108,34 @@ def send(self):
108108
109109 return PushResponse (response )
110110
111+ @classmethod
112+ def message_center_delete (cls , airship , push_id ):
113+ """
114+ Delete a Message Center message completely, removing it from every user's inbox.
115+ This is an asynchronous call; a success response means that the deletion has
116+ been queued for processing.
117+ This delete call will work with either the message_id or the push_id of the
118+ accompanying push notification.
119+ This endpoint will not work with a group_id from an automated message or a
120+ push to local time delivery. To delete a rich message that was part of an
121+ automated or local time delivery, you must use the relevant push_id from the
122+ operation.
123+
124+ :param airship: Required. Airship object instantiated with auth that corresponds
125+ to message to be deleted.
126+ :param push_id: Required. The message_id to delete or the push_id of the
127+ accompanying push notification.
128+ """
129+
130+ response = airship ._request (
131+ method = "DELETE" ,
132+ url = airship .urls .get ("message_center_delete_url" ) + push_id ,
133+ body = "" ,
134+ version = 3 ,
135+ )
136+
137+ return response
138+
111139
112140class ScheduledPush (object ):
113141 """A scheduled push notification. Set schedule, push, and send."""
@@ -162,6 +190,7 @@ def payload(self):
162190 data = {"schedule" : self .schedule , "push" : self .push .payload }
163191 else :
164192 data = {"schedule" : self .schedule , "push" : self .push .payload }
193+
165194 if self .recurring :
166195 data ["schedule" ].update (self .recurring )
167196
0 commit comments