getUpperProjectFromMap function
Implementation
Either<String, UpperProject> getUpperProjectFromMap(
Map<String, dynamic> upperJson,
) {
return verifyMap(
upperJson,
[
'name',
'version',
'port_number',
'docker_tag',
'gcloud_project',
'gcloud_name',
'gcr_host',
'gcr_memory',
'gcr_timeout',
'gcr_allow_unauthenticated',
'services',
],
).fold(
() {
return getUpperServices(upperJson['services']).fold(
(l) => left(l),
(services) {
return right(UpperProject(
name: upperJson['name'],
version: upperJson['version'],
portNumer: upperJson['port_number'],
dockerTag: upperJson['docker_tag'],
gcloudProject: upperJson['gcloud_project'],
gcloudName: upperJson['gcloud_name'],
gcrHost: upperJson['gcr_host'],
gcrMemory: upperJson['gcr_memory'],
gcrTimeout: upperJson['gcr_timeout'],
gcrAllowUnauthenticated: upperJson['gcr_allow_unauthenticated'],
services: services));
},
);
},
(a) => left(a),
);
}