LLM-3861: JBAccountInfoService: Rename LoginRequired to AuthRequired, move up

GitOrigin-RevId: 45d26ef3dfdd633f4321b449842e47b9e328c80b
This commit is contained in:
Eldar Abusalimov
2024-09-09 21:26:47 +02:00
committed by intellij-monorepo-bot
parent fef6778210
commit 82cb70c932

View File

@@ -193,24 +193,27 @@ public interface JBAccountInfoService {
}
sealed interface LicenseListResult permits LicenseListResult.LicenseList,
LicenseListResult.LoginRequired,
LicenseListResult.RequestFailed,
LicenseListResult.RequestDeclined {
LicenseListResult.RequestDeclined,
AuthRequired {
record LicenseList(@NotNull List<@NotNull JbaLicense> licenses) implements LicenseListResult { }
/**
* Returned when the method returning the LicenseListResult is called while unauthenticated,
* or when the current auth credentials need to be revalidated by {@link #startLoginSession signing in} again.
*/
enum LoginRequired implements LicenseListResult {
INSTANCE
}
record RequestDeclined(@NotNull String errorCode, @NlsSafe @NotNull String message) implements LicenseListResult { }
record RequestFailed(@NlsSafe @NotNull String errorMessage) implements LicenseListResult { }
}
/**
* Returned in cases the method returning it is called while unauthenticated,
* or when the current auth credentials have expired and need to be revalidated by {@link #startLoginSession signing in} again.
*/
enum AuthRequired implements LicenseListResult {
INSTANCE;
@Override
public String toString() {
return "AuthRequired";
}
}
interface AuthStateListener extends EventListener {
@NotNull Topic<AuthStateListener> TOPIC = new Topic<>(AuthStateListener.class);