from typing import List
from typing import Dict


async def _generate_policy_statement(
    actions: List, resources: List, effect: str, condition: Dict
) -> Dict:
    """
    Generates an IAM policy resource given actions, effects, resources, and conditions
    :param actions: a List of actions
    :param resources: a List of AWS resource ARNs or wildcards
    :param effect: an Effect (Allow|Deny)
    :return:
    """

    policy_statement = {
        "Action": list(set(actions)),
        "Effect": effect,
        "Resource": list(set(resources)),
    }
    if condition:
        policy_statement["Condition"] = condition
    return policy_statement