class TencentCredentials {

    private final String secretId;
    private final String secretKey;
    private final String sessionToken;

    public TencentCredentials(String secretId, String secretKey) {
        this(secretId, secretKey, null);
    }

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

    public COSCredentialsProvider toCredentialsProvider() {
        return new COSStaticCredentialsProvider(toCredentials());
    }

    public COSCredentials toCredentials() {<FILL_FUNCTION_BODY>}
}

        if (sessionToken == null) {
            return new BasicCOSCredentials(secretId, secretKey);
        }

        return new BasicSessionCredentials(secretId, secretKey, sessionToken);
    
<no_super_class>