Deployment.fromMap constructor
Deployment.fromMap(
- Map<String, dynamic> map
)
Implementation
factory Deployment.fromMap(
Map<String, dynamic> map,
) {
map = {
'\$id': "",
'\$createdAt': "",
'\$updatedAt': "",
'type': "",
'resourceId': "",
'resourceType': "",
'entrypoint': "",
'sourceSize': 0,
'buildSize': 0,
'totalSize': 0,
'buildId': "",
'activate': false,
'screenshotLight': "",
'screenshotDark': "",
'buildLogs': "",
'buildDuration': 0,
'providerRepositoryName': "",
'providerRepositoryOwner': "",
'providerRepositoryUrl': "",
'providerCommitHash': "",
'providerCommitAuthorUrl': "",
'providerCommitAuthor': "",
'providerCommitMessage': "",
'providerCommitUrl': "",
'providerBranch': "",
'providerBranchUrl': "",
...map,
};
return Deployment(
$id: map['\$id'].toString(),
$createdAt: map['\$createdAt'].toString(),
$updatedAt: map['\$updatedAt'].toString(),
type: map['type'].toString(),
resourceId: map['resourceId'].toString(),
resourceType: map['resourceType'].toString(),
entrypoint: map['entrypoint'].toString(),
sourceSize: map['sourceSize'],
buildSize: map['buildSize'],
totalSize: map['totalSize'],
buildId: map['buildId'].toString(),
activate: map['activate'],
screenshotLight: map['screenshotLight'].toString(),
screenshotDark: map['screenshotDark'].toString(),
status: enums.DeploymentStatus.values.firstWhere(
(e) => e.value == map['status'],
),
buildLogs: map['buildLogs'].toString(),
buildDuration: map['buildDuration'],
providerRepositoryName: map['providerRepositoryName'].toString(),
providerRepositoryOwner: map['providerRepositoryOwner'].toString(),
providerRepositoryUrl: map['providerRepositoryUrl'].toString(),
providerCommitHash: map['providerCommitHash'].toString(),
providerCommitAuthorUrl: map['providerCommitAuthorUrl'].toString(),
providerCommitAuthor: map['providerCommitAuthor'].toString(),
providerCommitMessage: map['providerCommitMessage'].toString(),
providerCommitUrl: map['providerCommitUrl'].toString(),
providerBranch: map['providerBranch'].toString(),
providerBranchUrl: map['providerBranchUrl'].toString(),
);
}