toViolationReason method

ViolationReason toViolationReason()

Implementation

ViolationReason toViolationReason() {
  switch (this) {
    case 'WEB_ACL_MISSING_RULE_GROUP':
      return ViolationReason.webAclMissingRuleGroup;
    case 'RESOURCE_MISSING_WEB_ACL':
      return ViolationReason.resourceMissingWebAcl;
    case 'RESOURCE_INCORRECT_WEB_ACL':
      return ViolationReason.resourceIncorrectWebAcl;
    case 'RESOURCE_MISSING_SHIELD_PROTECTION':
      return ViolationReason.resourceMissingShieldProtection;
    case 'RESOURCE_MISSING_WEB_ACL_OR_SHIELD_PROTECTION':
      return ViolationReason.resourceMissingWebAclOrShieldProtection;
    case 'RESOURCE_MISSING_SECURITY_GROUP':
      return ViolationReason.resourceMissingSecurityGroup;
    case 'RESOURCE_VIOLATES_AUDIT_SECURITY_GROUP':
      return ViolationReason.resourceViolatesAuditSecurityGroup;
    case 'SECURITY_GROUP_UNUSED':
      return ViolationReason.securityGroupUnused;
    case 'SECURITY_GROUP_REDUNDANT':
      return ViolationReason.securityGroupRedundant;
    case 'MISSING_FIREWALL':
      return ViolationReason.missingFirewall;
    case 'MISSING_FIREWALL_SUBNET_IN_AZ':
      return ViolationReason.missingFirewallSubnetInAz;
    case 'MISSING_EXPECTED_ROUTE_TABLE':
      return ViolationReason.missingExpectedRouteTable;
    case 'NETWORK_FIREWALL_POLICY_MODIFIED':
      return ViolationReason.networkFirewallPolicyModified;
  }
  throw Exception('$this is not known in enum ViolationReason');
}