withEncryptionMetadata method

Future<DecryptedDocument> withEncryptionMetadata(
  1. String sdkId,
  2. DecryptedDocument? base,
  3. Message? message,
  4. User? user,
  5. Map<String, AccessLevel> delegates,
  6. SecretIdUseOption secretId,
)

Implementation

Future<DecryptedDocument> withEncryptionMetadata(String sdkId, DecryptedDocument? base, Message? message, User? user, Map<String, AccessLevel> delegates, SecretIdUseOption secretId) async {
	final res = await _methodChannel.invokeMethod<String>(
		'DocumentApi.withEncryptionMetadata',
		{
			"sdkId": sdkId,
			"base": jsonEncode(base == null ? null : DecryptedDocument.encode(base!)),
			"message": jsonEncode(message == null ? null : Message.encode(message!)),
			"user": jsonEncode(user == null ? null : User.encode(user!)),
			"delegates": jsonEncode(delegates.map((k0, v0) => MapEntry(k0, AccessLevel.encode(v0)))),
			"secretId": jsonEncode(SecretIdUseOption.encode(secretId)),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method withEncryptionMetadata");
	final parsedResJson = jsonDecode(res);
	return DecryptedDocument.fromJSON(parsedResJson);
}