Database.fromJson constructor

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

Implementation

factory Database.fromJson(Map<String, dynamic> json) {
  return Database(
    name: json['Name'] as String,
    catalogId: json['CatalogId'] as String?,
    createTableDefaultPermissions: (json['CreateTableDefaultPermissions']
            as List?)
        ?.whereNotNull()
        .map((e) => PrincipalPermissions.fromJson(e as Map<String, dynamic>))
        .toList(),
    createTime: timeStampFromJson(json['CreateTime']),
    description: json['Description'] as String?,
    locationUri: json['LocationUri'] as String?,
    parameters: (json['Parameters'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    targetDatabase: json['TargetDatabase'] != null
        ? DatabaseIdentifier.fromJson(
            json['TargetDatabase'] as Map<String, dynamic>)
        : null,
  );
}