Add dbus SignalControl interface to register/verify/link accounts

This commit is contained in:
AsamK 2021-04-03 19:13:12 +02:00
parent 48b2c7ff8a
commit 8f781c019f
9 changed files with 272 additions and 22 deletions

View file

@ -0,0 +1,56 @@
package org.asamk;
import org.freedesktop.dbus.DBusPath;
import org.freedesktop.dbus.exceptions.DBusExecutionException;
import org.freedesktop.dbus.interfaces.DBusInterface;
import java.util.List;
/**
* DBus interface for the org.asamk.SignalControl interface.
* Including emitted Signals and returned Errors.
*/
public interface SignalControl extends DBusInterface {
void register(
String number, boolean voiceVerification
) throws Error.Failure, Error.InvalidNumber, Error.RequiresCaptcha;
void registerWithCaptcha(
String number, boolean voiceVerification, String captcha
) throws Error.Failure, Error.InvalidNumber, Error.RequiresCaptcha;
void verify(String number, String verificationCode) throws Error.Failure, Error.InvalidNumber;
void verifyWithPin(String number, String verificationCode, String pin) throws Error.Failure, Error.InvalidNumber;
String link(String newDeviceName) throws Error.Failure;
public String version();
List<DBusPath> listAccounts();
interface Error {
class Failure extends DBusExecutionException {
public Failure(final String message) {
super(message);
}
}
class InvalidNumber extends DBusExecutionException {
public InvalidNumber(final String message) {
super(message);
}
}
class RequiresCaptcha extends DBusExecutionException {
public RequiresCaptcha(final String message) {
super(message);
}
}
}
}