GetMailboxInfoRequest.fromJson constructor

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

Implementation

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

  return GetMailboxInfoRequest(
    address: parseAddress(json['address'] as String, type: type),
  );
}