SubscriptionModel.fromJson constructor

SubscriptionModel.fromJson(
  1. Map<String, dynamic> jsonMap
)

Creates instance of SubscriptionModel with values read from json

Implementation

SubscriptionModel.fromJson(Map<String, dynamic> jsonMap) {
  jsonMap.forEach((key, value) {
    if ((key == 'extension') && (value is String)) {
      toExt = value;
    } else if ((key == 'label') && (value is String)) {
      label = value;
    } else if ((key == 'accId') && (value is int)) {
      fromAccId = value;
    } else if ((key == 'accUri') && (value is String)) {
      accUri = value;
    } else if ((key == 'mimeSubType') && (value is String)) {
      mimeSubType = value;
    } else if ((key == 'body') && (value is String)) {
      body = value;
    } else if ((key == 'eventType') && (value is String)) {
      eventType = value;
    } else if ((key == 'expireTime') && (value is int)) {
      expireTime = value;
    }
  });
}