Layer.fromJson constructor

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

Implementation

factory Layer.fromJson(Map<String, dynamic> json) {
  return Layer(
    arn: json['Arn'] as String?,
    attributes: (json['Attributes'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k.toLayerAttributesKeys(), e as String)),
    autoAssignElasticIps: json['AutoAssignElasticIps'] as bool?,
    autoAssignPublicIps: json['AutoAssignPublicIps'] as bool?,
    cloudWatchLogsConfiguration: json['CloudWatchLogsConfiguration'] != null
        ? CloudWatchLogsConfiguration.fromJson(
            json['CloudWatchLogsConfiguration'] as Map<String, dynamic>)
        : null,
    createdAt: json['CreatedAt'] as String?,
    customInstanceProfileArn: json['CustomInstanceProfileArn'] as String?,
    customJson: json['CustomJson'] as String?,
    customRecipes: json['CustomRecipes'] != null
        ? Recipes.fromJson(json['CustomRecipes'] as Map<String, dynamic>)
        : null,
    customSecurityGroupIds: (json['CustomSecurityGroupIds'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    defaultRecipes: json['DefaultRecipes'] != null
        ? Recipes.fromJson(json['DefaultRecipes'] as Map<String, dynamic>)
        : null,
    defaultSecurityGroupNames: (json['DefaultSecurityGroupNames'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    enableAutoHealing: json['EnableAutoHealing'] as bool?,
    installUpdatesOnBoot: json['InstallUpdatesOnBoot'] as bool?,
    layerId: json['LayerId'] as String?,
    lifecycleEventConfiguration: json['LifecycleEventConfiguration'] != null
        ? LifecycleEventConfiguration.fromJson(
            json['LifecycleEventConfiguration'] as Map<String, dynamic>)
        : null,
    name: json['Name'] as String?,
    packages: (json['Packages'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    shortname: json['Shortname'] as String?,
    stackId: json['StackId'] as String?,
    type: (json['Type'] as String?)?.toLayerType(),
    useEbsOptimizedInstances: json['UseEbsOptimizedInstances'] as bool?,
    volumeConfigurations: (json['VolumeConfigurations'] as List?)
        ?.whereNotNull()
        .map((e) => VolumeConfiguration.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}