(self, request, tenant_id)
return b''
Create notification target
Create notification target
Create notification target
def create_notification(self, request, tenant_id):
        """
        Create notification target
        """
        content = request.content.read()
        new_n = create_notification(
            self._session_store.clock, json.loads(content.decode("utf-8")))
        notifications = self._entity_cache_for_tenant(tenant_id).notifications
        notifications[new_n.id] = new_n
        status = 201
        request.setResponseCode(status)
        request.setHeader(b'content-type', b'text/plain')
        request.setHeader(b'location', base_uri_from_request(request).rstrip('/').encode('utf-8') +
                          request.path + b'/' + new_n.id.encode('utf-8'))
        request.setHeader(b'x-object-id', new_n.id.encode('utf-8'))
        self._audit('notifications', request, tenant_id, status, content)
        return b''
def create_notification ( self , request , tenant_id ) : content = request . content . read ( ) new_n = create_notification ( self . _session_store . clock , json . loads ( content . decode ( "utf-8" ) ) ) notifications = self . _entity_cache_for_tenant ( tenant_id ) . notifications notifications [ new_n . id ] = new_n status = 201 request . setResponseCode ( status ) request . setHeader ( b'content-type' , b'text/plain' ) request . setHeader ( b'location' , base_uri_from_request ( request ) . rstrip ( '/' ) . encode ( 'utf-8' ) + request . path + b'/' + new_n . id . encode ( 'utf-8' ) ) request . setHeader ( b'x-object-id' , new_n . id . encode ( 'utf-8' ) ) self . _audit ( 'notifications' , request , tenant_id , status , content ) return b''