bp-check/models.py

19 lines
428 B
Python
Raw Normal View History

2024-08-05 02:30:34 +00:00
from pydantic import BaseModel
2024-08-14 01:05:06 +00:00
from utils import convert_snake_case
from typing import List
2024-08-05 02:30:34 +00:00
class RuleCheckResult(BaseModel):
passed: bool
compliant_resources: List[str]
non_compliant_resources: List[str]
2024-08-14 01:05:06 +00:00
class RuleChecker:
def __init__(self):
pass
def check_rule(self, rule_name) -> RuleCheckResult:
check_func = getattr(self, convert_snake_case(rule_name))
return check_func()