def update_alert(self, alert_id, alert, fields=[]):
req = self.url + "<STR_LIT>".format(alert_id)<EOL>update_keys = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:title>', '<STR_LIT:description>']<EOL>data = {k: v for k, v in alert.__dict__.items() if<EOL>(len(fields) > <NUM_LIT:0> and k in fields) or (len(fields) == <NUM_LIT:0> and k in update_keys)}<EOL>if hasattr(alert, '<STR_LIT>'):<EOL><INDENT>data['<STR_LIT>'] = [a.__dict__ for a in alert.artifacts]<EOL><DEDENT>try:<EOL><INDENT>return requests.patch(req, headers={'<STR_LIT:Content-Type>': '<STR_LIT:application/json>'}, json=data, proxies=self.proxies, auth=self.auth, verify=self.cert)<EOL><DEDENT>except requests.exceptions.RequestException:<EOL><INDENT>raise AlertException("<STR_LIT>".format(e))<EOL><DEDENT>
Update an alert.
:param alert_id: The ID of the alert to update.
:param data: The alert to update.
:param fields: Optional parameter, an array of fields names, the ones we want to update
:return: