(self)
Handles notification pings.
Handles notification pings.
Handles notification pings .
def post(self):
    """Handles notification pings."""
    logging.info('Got a notification with payload %s', self.request.body)
    data = json.loads(self.request.body)
    userid = data['userToken']
    # TODO: Check that the userToken is a valid userToken.
    self.mirror_service = util.create_service(
        'mirror', 'v1',
        StorageByKeyName(Credentials, userid, 'credentials').get())
    if data.get('collection') == 'locations':
      self._handle_locations_notification(data)
    elif data.get('collection') == 'timeline':
      self._handle_timeline_notification(data)
def post ( self ) : logging . info ( 'Got a notification with payload %s' , self . request . body ) data = json . loads ( self . request . body ) userid = data [ 'userToken' ] # TODO: Check that the userToken is a valid userToken. self . mirror_service = util . create_service ( 'mirror' , 'v1' , StorageByKeyName ( Credentials , userid , 'credentials' ) . get ( ) ) if data . get ( 'collection' ) == 'locations' : self . _handle_locations_notification ( data ) elif data . get ( 'collection' ) == 'timeline' : self . _handle_timeline_notification ( data )