# Path: repokid/exceptions.py
# class IAMError(Exception):
#     pass


import datetime
import json
import logging
import re
import botocore
from typing import Any
from typing import Dict
from cloudaux.aws.iam import delete_role_policy
from cloudaux.aws.iam import put_role_policy
from cloudaux.aws.sts import boto3_cached_conn
from mypy_boto3_iam.client import IAMClient
from repokid.exceptions import IAMError
        bool
    """
    exported_no_whitespace = json.dumps(policies, separators=(",", ":"))
    if len(exported_no_whitespace) > MAX_AWS_POLICY_SIZE:
        return True
    return False


def delete_policy(
    name: str, role_name: str, account_number: str, conn: Dict[str, Any]
) -> None:
    """Deletes the specified IAM Role inline policy.

    Args:
        name (string)
        role (Role object)
        account_number (string)
        conn (dict)

    Returns:
        error (string) or None
    """
    LOGGER.info(
        "Deleting policy with name {} from {} in account {}".format(
            name, role_name, account_number
        )
    )
    try:
        delete_role_policy(RoleName=role_name, PolicyName=name, **conn)
    except botocore.exceptions.ClientError as e:

# Path: repokid/exceptions.py
# class IAMError(Exception):
#     pass


# Path: repokid/utils/iam.py
import datetime
import json
import logging
import re
import botocore
from typing import Any
from typing import Dict
from cloudaux.aws.iam import delete_role_policy
from cloudaux.aws.iam import put_role_policy
from cloudaux.aws.sts import boto3_cached_conn
from mypy_boto3_iam.client import IAMClient
from repokid.exceptions import IAMError

        bool
    """
    exported_no_whitespace = json.dumps(policies, separators=(",", ":"))
    if len(exported_no_whitespace) > MAX_AWS_POLICY_SIZE:
        return True
    return False


def delete_policy(
    name: str, role_name: str, account_number: str, conn: Dict[str, Any]
) -> None:
    """Deletes the specified IAM Role inline policy.

    Args:
        name (string)
        role (Role object)
        account_number (string)
        conn (dict)

    Returns:
        error (string) or None
    """
    LOGGER.info(
        "Deleting policy with name {} from {} in account {}".format(
            name, role_name, account_number
        )
    )
    try:
        delete_role_policy(RoleName=role_name, PolicyName=name, **conn)
    except botocore.exceptions.ClientError as e:

        raise IAMError(