Image.fromJson constructor

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

Implementation

factory Image.fromJson(Map<String, dynamic> json) {
  return Image(
    name: json['Name'] as String,
    applications: (json['Applications'] as List?)
        ?.whereNotNull()
        .map((e) => Application.fromJson(e as Map<String, dynamic>))
        .toList(),
    appstreamAgentVersion: json['AppstreamAgentVersion'] as String?,
    arn: json['Arn'] as String?,
    baseImageArn: json['BaseImageArn'] as String?,
    createdTime: timeStampFromJson(json['CreatedTime']),
    description: json['Description'] as String?,
    displayName: json['DisplayName'] as String?,
    imageBuilderName: json['ImageBuilderName'] as String?,
    imageBuilderSupported: json['ImageBuilderSupported'] as bool?,
    imagePermissions: json['ImagePermissions'] != null
        ? ImagePermissions.fromJson(
            json['ImagePermissions'] as Map<String, dynamic>)
        : null,
    platform: (json['Platform'] as String?)?.toPlatformType(),
    publicBaseImageReleasedDate:
        timeStampFromJson(json['PublicBaseImageReleasedDate']),
    state: (json['State'] as String?)?.toImageState(),
    stateChangeReason: json['StateChangeReason'] != null
        ? ImageStateChangeReason.fromJson(
            json['StateChangeReason'] as Map<String, dynamic>)
        : null,
    visibility: (json['Visibility'] as String?)?.toVisibilityType(),
  );
}