def METHOD_NAME(self, plugin, event, payload):
    def find_obico_g_code_file_id(payload):
        md5_hash = plugin._file_manager.get_metadata(path=payload['path'], destination=payload['origin']).get('hash')
        if not md5_hash:
            return None
        g_code_data = dict(
            filename=payload['name'],
            safe_filename=os.path.basename(payload['path']),
            num_bytes=payload['size'],
            agent_signature='md5:{}'.format(md5_hash),
            url = payload['path']
            )
        resp = server_request('POST', '/api/v1/octo/g_code_files/', plugin, timeout=60, data=g_code_data, headers=plugin.auth_headers())
        return resp.json()['id'] if resp else None
    if event == 'PrintStarted':
        with self._mutex:
            self.current_print_ts = int(time.time())
            self._file_metadata_cache = None
        self.set_obico_g_code_file_id(find_obico_g_code_file_id(payload))
    data = self.status(plugin)
    data['event'] = {
        'event_type': event,
        'data': payload
    }
    # Unsetting self.current_print_ts should happen after it is captured in payload to make sure last event of a print contains the correct current_print_ts
    with self._mutex:
        if event == 'PrintFailed' or event == 'PrintDone':
            self.current_print_ts = -1
            self.set_obico_g_code_file_id(None)
            self._file_metadata_cache = None
            self.current_layer_height = None
    return data