authenticate method
Use this to authenticate yourself on the gateway by using the given credentials.
login
is either the user's login for the DooZ app or the gateway user login (available on the product's notice) and password
is the corresponding password.
Implementation
Future<AuthResponse> authenticate(
final String login,
final String password,
) async {
if (login.isBlank) {
throw ArgumentError('login must not be blank');
}
if (password.isBlank) {
throw ArgumentError('password must not be blank');
}
return AuthResponse.fromJson(await _sendRequest(
'authenticate',
params: <String, dynamic>{
'login': login,
'password': password,
},
));
}