WorkerPool.fromJson constructor

WorkerPool.fromJson(
  1. Map _json
)

Implementation

WorkerPool.fromJson(core.Map _json)
    : this(
        autoscalingSettings: _json.containsKey('autoscalingSettings')
            ? AutoscalingSettings.fromJson(_json['autoscalingSettings']
                as core.Map<core.String, core.dynamic>)
            : null,
        dataDisks: _json.containsKey('dataDisks')
            ? (_json['dataDisks'] as core.List)
                .map((value) => Disk.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        defaultPackageSet: _json.containsKey('defaultPackageSet')
            ? _json['defaultPackageSet'] as core.String
            : null,
        diskSizeGb: _json.containsKey('diskSizeGb')
            ? _json['diskSizeGb'] as core.int
            : null,
        diskSourceImage: _json.containsKey('diskSourceImage')
            ? _json['diskSourceImage'] as core.String
            : null,
        diskType: _json.containsKey('diskType')
            ? _json['diskType'] as core.String
            : null,
        ipConfiguration: _json.containsKey('ipConfiguration')
            ? _json['ipConfiguration'] as core.String
            : null,
        kind: _json.containsKey('kind') ? _json['kind'] as core.String : null,
        machineType: _json.containsKey('machineType')
            ? _json['machineType'] as core.String
            : null,
        metadata: _json.containsKey('metadata')
            ? (_json['metadata'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  item as core.String,
                ),
              )
            : null,
        network: _json.containsKey('network')
            ? _json['network'] as core.String
            : null,
        numThreadsPerWorker: _json.containsKey('numThreadsPerWorker')
            ? _json['numThreadsPerWorker'] as core.int
            : null,
        numWorkers: _json.containsKey('numWorkers')
            ? _json['numWorkers'] as core.int
            : null,
        onHostMaintenance: _json.containsKey('onHostMaintenance')
            ? _json['onHostMaintenance'] as core.String
            : null,
        packages: _json.containsKey('packages')
            ? (_json['packages'] as core.List)
                .map((value) => Package.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        poolArgs: _json.containsKey('poolArgs')
            ? _json['poolArgs'] as core.Map<core.String, core.dynamic>
            : null,
        sdkHarnessContainerImages:
            _json.containsKey('sdkHarnessContainerImages')
                ? (_json['sdkHarnessContainerImages'] as core.List)
                    .map((value) => SdkHarnessContainerImage.fromJson(
                        value as core.Map<core.String, core.dynamic>))
                    .toList()
                : null,
        subnetwork: _json.containsKey('subnetwork')
            ? _json['subnetwork'] as core.String
            : null,
        taskrunnerSettings: _json.containsKey('taskrunnerSettings')
            ? TaskRunnerSettings.fromJson(_json['taskrunnerSettings']
                as core.Map<core.String, core.dynamic>)
            : null,
        teardownPolicy: _json.containsKey('teardownPolicy')
            ? _json['teardownPolicy'] as core.String
            : null,
        workerHarnessContainerImage:
            _json.containsKey('workerHarnessContainerImage')
                ? _json['workerHarnessContainerImage'] as core.String
                : null,
        zone: _json.containsKey('zone') ? _json['zone'] as core.String : null,
      );