ContainerOverride.fromJson constructor

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

Implementation

factory ContainerOverride.fromJson(Map<String, dynamic> json) {
  return ContainerOverride(
    command: (json['command'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    cpu: json['cpu'] as int?,
    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(),
    memory: json['memory'] as int?,
    memoryReservation: json['memoryReservation'] as int?,
    name: json['name'] as String?,
    resourceRequirements: (json['resourceRequirements'] as List?)
        ?.whereNotNull()
        .map((e) => ResourceRequirement.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}