TableMetadata.fromJson constructor

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

Implementation

factory TableMetadata.fromJson(Map<String, dynamic> json) {
  return TableMetadata(
    name: json['Name'] as String,
    columns: (json['Columns'] as List?)
        ?.whereNotNull()
        .map((e) => Column.fromJson(e as Map<String, dynamic>))
        .toList(),
    createTime: timeStampFromJson(json['CreateTime']),
    lastAccessTime: timeStampFromJson(json['LastAccessTime']),
    parameters: (json['Parameters'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    partitionKeys: (json['PartitionKeys'] as List?)
        ?.whereNotNull()
        .map((e) => Column.fromJson(e as Map<String, dynamic>))
        .toList(),
    tableType: json['TableType'] as String?,
  );
}