ContainerDefinition.fromJson constructor
ContainerDefinition.fromJson(
- Map<String, dynamic> json
)
Implementation
factory ContainerDefinition.fromJson(Map<String, dynamic> json) {
return ContainerDefinition(
command: (json['command'] as List?)
?.whereNotNull()
.map((e) => e as String)
.toList(),
cpu: json['cpu'] as int?,
dependsOn: (json['dependsOn'] as List?)
?.whereNotNull()
.map((e) => ContainerDependency.fromJson(e as Map<String, dynamic>))
.toList(),
disableNetworking: json['disableNetworking'] as bool?,
dnsSearchDomains: (json['dnsSearchDomains'] as List?)
?.whereNotNull()
.map((e) => e as String)
.toList(),
dnsServers: (json['dnsServers'] as List?)
?.whereNotNull()
.map((e) => e as String)
.toList(),
dockerLabels: (json['dockerLabels'] as Map<String, dynamic>?)
?.map((k, e) => MapEntry(k, e as String)),
dockerSecurityOptions: (json['dockerSecurityOptions'] as List?)
?.whereNotNull()
.map((e) => e as String)
.toList(),
entryPoint: (json['entryPoint'] as List?)
?.whereNotNull()
.map((e) => e as String)
.toList(),
environment: (json['environment'] as List?)
?.whereNotNull()
.map((e) => KeyValuePair.fromJson(e as Map<String, dynamic>))
.toList(),
environmentFiles: (json['environmentFiles'] as List?)
?.whereNotNull()
.map((e) => EnvironmentFile.fromJson(e as Map<String, dynamic>))
.toList(),
essential: json['essential'] as bool?,
extraHosts: (json['extraHosts'] as List?)
?.whereNotNull()
.map((e) => HostEntry.fromJson(e as Map<String, dynamic>))
.toList(),
firelensConfiguration: json['firelensConfiguration'] != null
? FirelensConfiguration.fromJson(
json['firelensConfiguration'] as Map<String, dynamic>)
: null,
healthCheck: json['healthCheck'] != null
? HealthCheck.fromJson(json['healthCheck'] as Map<String, dynamic>)
: null,
hostname: json['hostname'] as String?,
image: json['image'] as String?,
interactive: json['interactive'] as bool?,
links: (json['links'] as List?)
?.whereNotNull()
.map((e) => e as String)
.toList(),
linuxParameters: json['linuxParameters'] != null
? LinuxParameters.fromJson(
json['linuxParameters'] as Map<String, dynamic>)
: null,
logConfiguration: json['logConfiguration'] != null
? LogConfiguration.fromJson(
json['logConfiguration'] as Map<String, dynamic>)
: null,
memory: json['memory'] as int?,
memoryReservation: json['memoryReservation'] as int?,
mountPoints: (json['mountPoints'] as List?)
?.whereNotNull()
.map((e) => MountPoint.fromJson(e as Map<String, dynamic>))
.toList(),
name: json['name'] as String?,
portMappings: (json['portMappings'] as List?)
?.whereNotNull()
.map((e) => PortMapping.fromJson(e as Map<String, dynamic>))
.toList(),
privileged: json['privileged'] as bool?,
pseudoTerminal: json['pseudoTerminal'] as bool?,
readonlyRootFilesystem: json['readonlyRootFilesystem'] as bool?,
repositoryCredentials: json['repositoryCredentials'] != null
? RepositoryCredentials.fromJson(
json['repositoryCredentials'] as Map<String, dynamic>)
: null,
resourceRequirements: (json['resourceRequirements'] as List?)
?.whereNotNull()
.map((e) => ResourceRequirement.fromJson(e as Map<String, dynamic>))
.toList(),
secrets: (json['secrets'] as List?)
?.whereNotNull()
.map((e) => Secret.fromJson(e as Map<String, dynamic>))
.toList(),
startTimeout: json['startTimeout'] as int?,
stopTimeout: json['stopTimeout'] as int?,
systemControls: (json['systemControls'] as List?)
?.whereNotNull()
.map((e) => SystemControl.fromJson(e as Map<String, dynamic>))
.toList(),
ulimits: (json['ulimits'] as List?)
?.whereNotNull()
.map((e) => Ulimit.fromJson(e as Map<String, dynamic>))
.toList(),
user: json['user'] as String?,
volumesFrom: (json['volumesFrom'] as List?)
?.whereNotNull()
.map((e) => VolumeFrom.fromJson(e as Map<String, dynamic>))
.toList(),
workingDirectory: json['workingDirectory'] as String?,
);
}