Nodegroup.fromJson constructor

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

Implementation

factory Nodegroup.fromJson(Map<String, dynamic> json) {
  return Nodegroup(
    amiType: (json['amiType'] as String?)?.toAMITypes(),
    capacityType: (json['capacityType'] as String?)?.toCapacityTypes(),
    clusterName: json['clusterName'] as String?,
    createdAt: timeStampFromJson(json['createdAt']),
    diskSize: json['diskSize'] as int?,
    health: json['health'] != null
        ? NodegroupHealth.fromJson(json['health'] as Map<String, dynamic>)
        : null,
    instanceTypes: (json['instanceTypes'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    labels: (json['labels'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    launchTemplate: json['launchTemplate'] != null
        ? LaunchTemplateSpecification.fromJson(
            json['launchTemplate'] as Map<String, dynamic>)
        : null,
    modifiedAt: timeStampFromJson(json['modifiedAt']),
    nodeRole: json['nodeRole'] as String?,
    nodegroupArn: json['nodegroupArn'] as String?,
    nodegroupName: json['nodegroupName'] as String?,
    releaseVersion: json['releaseVersion'] as String?,
    remoteAccess: json['remoteAccess'] != null
        ? RemoteAccessConfig.fromJson(
            json['remoteAccess'] as Map<String, dynamic>)
        : null,
    resources: json['resources'] != null
        ? NodegroupResources.fromJson(
            json['resources'] as Map<String, dynamic>)
        : null,
    scalingConfig: json['scalingConfig'] != null
        ? NodegroupScalingConfig.fromJson(
            json['scalingConfig'] as Map<String, dynamic>)
        : null,
    status: (json['status'] as String?)?.toNodegroupStatus(),
    subnets: (json['subnets'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    tags: (json['tags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    version: json['version'] as String?,
  );
}