AllocationPolicy.fromJson constructor

AllocationPolicy.fromJson(
  1. Map json_
)

Implementation

AllocationPolicy.fromJson(core.Map json_)
    : this(
        instances: json_.containsKey('instances')
            ? (json_['instances'] as core.List)
                .map((value) => InstancePolicyOrTemplate.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        labels: json_.containsKey('labels')
            ? (json_['labels'] as core.Map<core.String, core.dynamic>).map(
                (key, value) => core.MapEntry(
                  key,
                  value as core.String,
                ),
              )
            : null,
        location: json_.containsKey('location')
            ? LocationPolicy.fromJson(
                json_['location'] as core.Map<core.String, core.dynamic>)
            : null,
        network: json_.containsKey('network')
            ? NetworkPolicy.fromJson(
                json_['network'] as core.Map<core.String, core.dynamic>)
            : null,
        placement: json_.containsKey('placement')
            ? PlacementPolicy.fromJson(
                json_['placement'] as core.Map<core.String, core.dynamic>)
            : null,
        serviceAccount: json_.containsKey('serviceAccount')
            ? ServiceAccount.fromJson(json_['serviceAccount']
                as core.Map<core.String, core.dynamic>)
            : null,
        tags: json_.containsKey('tags')
            ? (json_['tags'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
      );