permissionByEmail method
Returns Future Permission
by email.
Requires SheetsApi.DriveScope.
email
email of requested permission.
Returns null
if email
not found.
Throws Exception if GSheets's scopes does not include DriveScope. Throws GSheetsException if DriveScope is not configured.
Implementation
Future<Permission?> permissionByEmail(String email) async {
final response = await _client.get(
'$_filesEndpoint$id/permissions'.toUri(),
);
checkResponse(response);
return (jsonDecode(response.body)['items'] as List?)
?.map((json) => Permission._fromJson(json))
.firstWhereOrNull((it) => it.email == email);
}