NodeTemplate.fromJson constructor

NodeTemplate.fromJson(
  1. Map json_
)

Implementation

NodeTemplate.fromJson(core.Map json_)
    : this(
        accelerators: json_.containsKey('accelerators')
            ? (json_['accelerators'] as core.List)
                .map((value) => AcceleratorConfig.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        cpuOvercommitType: json_.containsKey('cpuOvercommitType')
            ? json_['cpuOvercommitType'] as core.String
            : null,
        creationTimestamp: json_.containsKey('creationTimestamp')
            ? json_['creationTimestamp'] as core.String
            : null,
        description: json_.containsKey('description')
            ? json_['description'] as core.String
            : null,
        disks: json_.containsKey('disks')
            ? (json_['disks'] as core.List)
                .map((value) => LocalDisk.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        id: json_.containsKey('id') ? json_['id'] as core.String : null,
        kind: json_.containsKey('kind') ? json_['kind'] as core.String : null,
        name: json_.containsKey('name') ? json_['name'] as core.String : null,
        nodeAffinityLabels: json_.containsKey('nodeAffinityLabels')
            ? (json_['nodeAffinityLabels']
                    as core.Map<core.String, core.dynamic>)
                .map(
                (key, value) => core.MapEntry(
                  key,
                  value as core.String,
                ),
              )
            : null,
        nodeType: json_.containsKey('nodeType')
            ? json_['nodeType'] as core.String
            : null,
        nodeTypeFlexibility: json_.containsKey('nodeTypeFlexibility')
            ? NodeTemplateNodeTypeFlexibility.fromJson(
                json_['nodeTypeFlexibility']
                    as core.Map<core.String, core.dynamic>)
            : null,
        region: json_.containsKey('region')
            ? json_['region'] as core.String
            : null,
        selfLink: json_.containsKey('selfLink')
            ? json_['selfLink'] as core.String
            : null,
        serverBinding: json_.containsKey('serverBinding')
            ? ServerBinding.fromJson(
                json_['serverBinding'] as core.Map<core.String, core.dynamic>)
            : null,
        status: json_.containsKey('status')
            ? json_['status'] as core.String
            : null,
        statusMessage: json_.containsKey('statusMessage')
            ? json_['statusMessage'] as core.String
            : null,
      );