class CloudStore {

    AssumeRoleRequest getAssumeRoleRequest(String account, String roleName, String principal,
                                           Integer durationSeconds, String externalId) {

        // assume the target role to get the credentials for the client
        // aws format is arn:aws:iam::<account-id>:role/<role-name>

        final String arn = "arn:aws:iam::" + account + ":role/" + roleName;

        AssumeRoleRequest req = new AssumeRoleRequest();
        req.setRoleArn(arn);

        // for role session name AWS has a limit on length: 64
        // so we need to make sure our session is shorter than that

        req.setRoleSessionName(AWS_ROLE_SESSION_NAME);
        if (durationSeconds != null && durationSeconds > 0) {
            req.setDurationSeconds(durationSeconds);
        }
        if (externalId != null && !externalId.isEmpty()) {
            req.setExternalId(externalId);
        }
        return req;
    }

    public  CloudStore();

}