class AwsCredentials {

    private final String accessKeyId;
    private final String secretAccessKey;
    private final String sessionToken;

    public AwsCredentials(String accessKeyId, String secretAccessKey) {
        this(accessKeyId, secretAccessKey, null);
    }

    public AwsCredentials(String accessKeyId, String secretAccessKey, String sessionToken) {
        this.accessKeyId = ensureNotBlank(accessKeyId, "accessKeyId");
        this.secretAccessKey = ensureNotBlank(secretAccessKey, "secretAccessKey");
        this.sessionToken = sessionToken;
    }

    public AwsCredentialsProvider toCredentialsProvider() {
        return StaticCredentialsProvider.create(toCredentials());
    }

    private software.amazon.awssdk.auth.credentials.AwsCredentials toCredentials() {<FILL_FUNCTION_BODY>}
}

        if (sessionToken != null) {
            return AwsSessionCredentials.create(accessKeyId, secretAccessKey, sessionToken);
        }
        return AwsBasicCredentials.create(accessKeyId, secretAccessKey);
    
<no_super_class>