'Update a rule
Update various attributes for the given rule.
{method} {path}
"name": "My rule name",
"conditions": [],
"actions": [],
"actionMatch": "all"'

def put(self, request, project, rule_id):

    rule = Rule.objects.get(project=project, id=rule_id)
    serializer = RuleSerializer({'actionMatch': (rule.data.get('action_match') or Rule.DEFAULT_ACTION_MATCH), 'frequency': (rule.data.get('frequency') or Rule.DEFAULT_FREQUENCY)}, context={'project': project}, data=request.DATA, partial=True)
    if serializer.is_valid():
        rule = serializer.save(rule=rule)
        self.create_audit_entry(request=request, organization=project.organization, target_object=rule.id, event=AuditLogEntryEvent.RULE_EDIT, data=rule.get_audit_log_data())
        return Response(serialize(rule, request.user))
    return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
