createPartialSession method
Implementation
Future<PartialSession> createPartialSession({
String? email,
String? mobileE164,
String? mobileIso2,
String? mobileLocal,
}) async {
final body = <String, dynamic>{};
if (email != null) {
body['email'] = email;
}
if (mobileE164 != null) {
body['mobileE164'] = mobileE164;
}
if (mobileIso2 != null) {
body['mobileIso2'] = mobileIso2;
}
if (mobileLocal != null) {
body['mobileLocal'] = mobileLocal;
}
final response = await _post(
path: '/sessions',
body: body,
);
final json = jsonDecode(response.body);
if (response.statusCode >= 400) {
return Future.error(ApiError.fromJson(json));
}
return PartialSession.fromJson(json);
}