class AwsIamService {

    public Policy getAssumeRolePolicy(Role role) {
        Policy policy = null;
        String assumeRolePolicyDocument = role.getAssumeRolePolicyDocument();
        if (assumeRolePolicyDocument != null) {
            try {
                String decodedAssumeRolePolicyDocument = URLDecoder.decode(assumeRolePolicyDocument,
                        StandardCharsets.UTF_8);
                policy = Policy.fromJson(decodedAssumeRolePolicyDocument);
            } catch (IllegalArgumentException e) {
                LOGGER.error(String.format("Unable to get policy from role (%s)", role.getArn()), e);
            }
        }

        return policy;
    }

}