withEncryptionMetadata method
Future<GroupScoped<DecryptedHealthElement> >
withEncryptionMetadata(
- String sdkId,
- String entityGroupId,
- DecryptedHealthElement? base,
- GroupScoped<
Patient> patient, - User? user,
- Map<
EntityReferenceInGroup, AccessLevel> delegates, - SecretIdUseOption secretId,
Implementation
Future<GroupScoped<DecryptedHealthElement>> withEncryptionMetadata(String sdkId, String entityGroupId, DecryptedHealthElement? base, GroupScoped<Patient> patient, User? user, Map<EntityReferenceInGroup, AccessLevel> delegates, SecretIdUseOption secretId) async {
final res = await _methodChannel.invokeMethod<String>(
'HealthElementApi.inGroup.withEncryptionMetadata',
{
"sdkId": sdkId,
"entityGroupId": jsonEncode(entityGroupId),
"base": jsonEncode(base == null ? null : DecryptedHealthElement.encode(base!)),
"patient": jsonEncode(GroupScoped.encode(
patient,
(x0) {
return Patient.encode(x0);
},
)),
"user": jsonEncode(user == null ? null : User.encode(user!)),
"delegates": jsonEncode(delegates.entries.map((x0) => {
"k": EntityReferenceInGroup.encode(x0.key),
"v": AccessLevel.encode(x0.value),
}).toList()),
"secretId": jsonEncode(SecretIdUseOption.encode(secretId)),
}
).catchError(convertPlatformException);
if (res == null) throw AssertionError("received null result from platform method withEncryptionMetadata");
final parsedResJson = jsonDecode(res);
return GroupScoped.fromJSON(
parsedResJson,
(x1) {
return DecryptedHealthElement.fromJSON(x1);
},
);
}