AccessControlRule.fromJson constructor

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

Implementation

factory AccessControlRule.fromJson(Map<String, dynamic> json) {
  return AccessControlRule(
    actions: (json['Actions'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    dateCreated: timeStampFromJson(json['DateCreated']),
    dateModified: timeStampFromJson(json['DateModified']),
    description: json['Description'] as String?,
    effect: (json['Effect'] as String?)?.toAccessControlRuleEffect(),
    ipRanges: (json['IpRanges'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    name: json['Name'] as String?,
    notActions: (json['NotActions'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    notIpRanges: (json['NotIpRanges'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    notUserIds: (json['NotUserIds'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    userIds: (json['UserIds'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
  );
}