RevokeAccessRequest.fromJson constructor

RevokeAccessRequest.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory RevokeAccessRequest.fromJson(Map<String, dynamic> json) {
  final typeStr = json['type'] as String;
  final type = MailboxType.values.firstWhere((e) => e.name == typeStr);

  return RevokeAccessRequest(
    address: parseAddress(json['address'] as String, type: type),
    targetPeerId: PeerId.fromString(json['targetPeerId'] as String),
  );
}