def METHOD_NAME(violations):
    """Flatten RuleViolations into a dict for each RuleViolation member.
    Args:
        violations (list): The RuleViolations to flatten.
    Yields:
        dict: Iterator of RuleViolations as a dict per member.
    """
    for violation in violations:
        resource_data = {
            'whoCanAdd': violation.whoCanAdd,
            'whoCanJoin': violation.whoCanJoin,
            'whoCanViewMembership': violation.whoCanViewMembership,
            'whoCanViewGroup': violation.whoCanViewGroup,
            'whoCanInvite': violation.whoCanInvite,
            'allowExternalMembers': violation.allowExternalMembers,
            'whoCanLeaveGroup': violation.whoCanLeaveGroup,
        }
        violation_data = {
            'group_email': violation.group_email,
            'violation_settings': violation.violation_settings,
        }
        yield {
            'resource_id': violation.group_email,
            'full_name': violation.group_email,
            'resource_name': violation.group_email,
            'resource_data': json.dumps(resource_data, sort_keys=True),
            'violation_data': violation_data,
            'resource_type': violation.resource_type,
            'rule_index': violation.rule_index,
            'rule_name': violation.rule_name,
            'violation_type': violation.violation_type,
        }