Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_aliasuser(self, alias, platform=None):
"""Get appkey alias users.
"""
url = common.get_url('alias', self.zone) + alias
params = { 'platform': platform } if platform else None
info = self.send("GET", url, params = params)
return info
def get_messages(self, msg_ids):
url = common.get_url('report', self.zone) + 'messages'
params = { 'msg_ids': msg_ids }
messages = self.send("GET", url, params = params)
return messages
def get_received_detail(self, msg_ids):
url = common.get_url('report', self.zone) + 'received/detail'
params = {'msg_ids': msg_ids}
response = self.send("GET", url, params = params)
return response
def send_validate(self):
"""Send the notification to validate.
:returns: :py:class:`PushResponse` object with ``push_ids`` and
other response data.
:raises JPushFailure: Request failed.
:raises Unauthorized: Authentication failed.
"""
body = json.dumps(self.payload)
url = common.get_url('push', self.zone) + 'push/validate'
response = self._jpush._request('POST', body, url, 'application/json', version=3)
return PushResponse(response)
def get_taglist(self):
"""Get deviceinfo with registration id.
"""
url = common.get_url('tag', self.zone)
info = self.send("GET", url)
return info
def delete_alias(self, alias, platform=None):
"""Delete appkey alias.
"""
url = common.get_url('alias', self.zone) + alias
params = { 'platform': platform } if platform else None
info = self.send("DELETE", url, params = params)
return info
def get_messages_detail(self, msg_ids):
url = common.get_url('report', self.zone) + 'messages/detail'
params = {'msg_ids': msg_ids}
response = self.send("GET", url, params = params)
return response
def check_taguserexist(self, tag, registration_id):
"""Check registration id whether in tag.
"""
url = common.get_url('tag', self.zone) + tag + "/registration_ids/" + registration_id
info = self.send("GET", url)
return info