2021-09-27 19:27:13 +02:00
|
|
|
package it.tdlight.client;
|
|
|
|
|
2021-09-27 21:44:24 +02:00
|
|
|
public interface AuthenticationData {
|
2021-09-27 19:27:13 +02:00
|
|
|
|
2021-09-27 22:15:17 +02:00
|
|
|
boolean isQrCode();
|
|
|
|
|
2021-09-27 21:44:24 +02:00
|
|
|
boolean isBot();
|
2021-09-27 19:27:13 +02:00
|
|
|
|
2021-09-27 21:44:24 +02:00
|
|
|
long getUserPhoneNumber();
|
2021-09-27 19:27:13 +02:00
|
|
|
|
2021-09-27 21:44:24 +02:00
|
|
|
String getBotToken();
|
2021-09-27 19:27:13 +02:00
|
|
|
|
2021-09-27 22:15:17 +02:00
|
|
|
static AuthenticationData qrCode() {
|
|
|
|
return new AuthenticationDataQrCode();
|
|
|
|
}
|
|
|
|
|
2021-09-27 21:44:24 +02:00
|
|
|
static AuthenticationData user(long userPhoneNumber) {
|
|
|
|
return new AuthenticationDataImpl(userPhoneNumber, null);
|
2021-09-27 19:27:13 +02:00
|
|
|
}
|
|
|
|
|
2021-09-27 21:44:24 +02:00
|
|
|
static AuthenticationData bot(String botToken) {
|
|
|
|
return new AuthenticationDataImpl(null, botToken);
|
2021-09-27 19:27:13 +02:00
|
|
|
}
|
|
|
|
|
2021-10-24 00:33:57 +02:00
|
|
|
static ConsoleInteractiveAuthenticationData consoleLogin() {
|
2021-09-27 21:44:24 +02:00
|
|
|
return new ConsoleInteractiveAuthenticationData();
|
2021-09-27 19:27:13 +02:00
|
|
|
}
|
|
|
|
}
|