Runbook.fromJson constructor

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

Implementation

factory Runbook.fromJson(Map<String, dynamic> json) {
  return Runbook(
    documentName: json['DocumentName'] as String,
    documentVersion: json['DocumentVersion'] as String?,
    maxConcurrency: json['MaxConcurrency'] as String?,
    maxErrors: json['MaxErrors'] as String?,
    parameters: (json['Parameters'] as Map<String, dynamic>?)?.map((k, e) =>
        MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
    targetLocations: (json['TargetLocations'] as List?)
        ?.whereNotNull()
        .map((e) => TargetLocation.fromJson(e as Map<String, dynamic>))
        .toList(),
    targetParameterName: json['TargetParameterName'] as String?,
    targets: (json['Targets'] as List?)
        ?.whereNotNull()
        .map((e) => Target.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}