getUpperServiceFromMap function
Implementation
Either<String, UpperService> getUpperServiceFromMap(
Map<String, dynamic> serviceJson,
) {
return verifyMap(
serviceJson,
[
'name',
'version',
'table_name',
'path',
'server_file_name',
'service_file_name',
'service_class_name',
'proto_name',
'proto_path',
'docker_tag',
'gcloud_name',
'gcr_memory'
],
).fold(
() {
return right(UpperService(
name: serviceJson['name'],
version: serviceJson['version'],
tableName: serviceJson['table_name'],
path: serviceJson['path'],
serverFileName: serviceJson['server_file_name'],
serviceFileName: serviceJson['service_file_name'],
serviceClassName: serviceJson['service_class_name'],
protoName: serviceJson['proto_name'],
protoPath: serviceJson['proto_path'],
dockerTag: serviceJson['docker_tag'],
gcloudName: serviceJson['gcloud_name'],
grcMemory: serviceJson['gcr_memory'],
));
},
(a) => left(a),
);
}