mapToQBCustomObjectPermission static method

QBCustomObjectPermission mapToQBCustomObjectPermission(
  1. Map<String, Object> map
)

Implementation

static QBCustomObjectPermission mapToQBCustomObjectPermission(
    Map<String, Object> map) {
  QBCustomObjectPermission permission = QBCustomObjectPermission();

  if (map.containsKey("customObjectId")) {
    permission.customObjectId = map["customObjectId"] as String?;
  }
  if (map.containsKey("readLevel")) {
    Map<String, Object> permissionMap =
        Map.from(map["readLevel"] as Map<dynamic, dynamic>);
    QBCustomObjectPermissionLevel permissionLevel =
        mapToQBCustomObjectPermissionLevel(permissionMap);
    permission.readLevel = permissionLevel;
  }
  if (map.containsKey("updateLevel")) {
    Map<String, Object> permissionMap =
        Map.from(map["updateLevel"] as Map<dynamic, dynamic>);
    QBCustomObjectPermissionLevel permissionLevel =
        mapToQBCustomObjectPermissionLevel(permissionMap);
    permission.updateLevel = permissionLevel;
  }
  if (map.containsKey("deleteLevel")) {
    Map<String, Object> permissionMap =
        Map.from(map["deleteLevel"] as Map<dynamic, dynamic>);
    QBCustomObjectPermissionLevel permissionLevel =
        mapToQBCustomObjectPermissionLevel(permissionMap);
    permission.deleteLevel = permissionLevel;
  }

  return permission;
}