def METHOD_NAME():
    argument_spec = dict(
        iam_type=dict(required=True, choices=["user", "group", "role"]),
        iam_name=dict(required=True),
        policy_name=dict(default=None, required=False),
    )
    module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True)
    args = dict(
        client=module.client("iam", retry_decorator=AWSRetry.jittered_backoff()),
        name=module.params.get("iam_name"),
        policy_name=module.params.get("policy_name"),
    )
    iam_type = module.params.get("iam_type")
    try:
        if iam_type == "user":
            policy = UserPolicy(**args)
        elif iam_type == "role":
            policy = RolePolicy(**args)
        elif iam_type == "group":
            policy = GroupPolicy(**args)
        module.exit_json(**(policy.run()))
    except is_boto3_error_code("NoSuchEntity") as e:
        module.exit_json(changed=False, msg=e.response["Error"]["Message"])
    except (
        botocore.exceptions.ClientError,
        botocore.exceptions.BotoCoreError,
    ) as e:  # pylint: disable=duplicate-except
        module.fail_json_aws(e)