ProjectDetails.fromJson constructor

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

Implementation

factory ProjectDetails.fromJson(Map<String, dynamic> json) {
  return ProjectDetails(
    consoleUrl: json['consoleUrl'] as String?,
    createdDate: timeStampFromJson(json['createdDate']),
    lastUpdatedDate: timeStampFromJson(json['lastUpdatedDate']),
    name: json['name'] as String?,
    projectId: json['projectId'] as String?,
    region: json['region'] as String?,
    resources: (json['resources'] as List?)
        ?.whereNotNull()
        .map((e) => Resource.fromJson(e as Map<String, dynamic>))
        .toList(),
    state: (json['state'] as String?)?.toProjectState(),
  );
}