DeleteMailboxRequest.fromJson constructor

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

Implementation

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

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