AssociationDescription.fromJson constructor

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

Implementation

factory AssociationDescription.fromJson(Map<String, dynamic> json) {
  return AssociationDescription(
    applyOnlyAtCronInterval: json['ApplyOnlyAtCronInterval'] as bool?,
    associationId: json['AssociationId'] as String?,
    associationName: json['AssociationName'] as String?,
    associationVersion: json['AssociationVersion'] as String?,
    automationTargetParameterName:
        json['AutomationTargetParameterName'] as String?,
    complianceSeverity: (json['ComplianceSeverity'] as String?)
        ?.toAssociationComplianceSeverity(),
    date: timeStampFromJson(json['Date']),
    documentVersion: json['DocumentVersion'] as String?,
    instanceId: json['InstanceId'] as String?,
    lastExecutionDate: timeStampFromJson(json['LastExecutionDate']),
    lastSuccessfulExecutionDate:
        timeStampFromJson(json['LastSuccessfulExecutionDate']),
    lastUpdateAssociationDate:
        timeStampFromJson(json['LastUpdateAssociationDate']),
    maxConcurrency: json['MaxConcurrency'] as String?,
    maxErrors: json['MaxErrors'] as String?,
    name: json['Name'] as String?,
    outputLocation: json['OutputLocation'] != null
        ? InstanceAssociationOutputLocation.fromJson(
            json['OutputLocation'] as Map<String, dynamic>)
        : null,
    overview: json['Overview'] != null
        ? AssociationOverview.fromJson(
            json['Overview'] as Map<String, dynamic>)
        : null,
    parameters: (json['Parameters'] as Map<String, dynamic>?)?.map((k, e) =>
        MapEntry(
            k, (e as List).whereNotNull().map((e) => e as String).toList())),
    scheduleExpression: json['ScheduleExpression'] as String?,
    status: json['Status'] != null
        ? AssociationStatus.fromJson(json['Status'] as Map<String, dynamic>)
        : null,
    syncCompliance:
        (json['SyncCompliance'] as String?)?.toAssociationSyncCompliance(),
    targetLocations: (json['TargetLocations'] as List?)
        ?.whereNotNull()
        .map((e) => TargetLocation.fromJson(e as Map<String, dynamic>))
        .toList(),
    targets: (json['Targets'] as List?)
        ?.whereNotNull()
        .map((e) => Target.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}