ActiveViolation.fromJson constructor

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

Implementation

factory ActiveViolation.fromJson(Map<String, dynamic> json) {
  return ActiveViolation(
    behavior: json['behavior'] != null
        ? Behavior.fromJson(json['behavior'] as Map<String, dynamic>)
        : null,
    lastViolationTime: timeStampFromJson(json['lastViolationTime']),
    lastViolationValue: json['lastViolationValue'] != null
        ? MetricValue.fromJson(
            json['lastViolationValue'] as Map<String, dynamic>)
        : null,
    securityProfileName: json['securityProfileName'] as String?,
    thingName: json['thingName'] as String?,
    violationEventAdditionalInfo: json['violationEventAdditionalInfo'] != null
        ? ViolationEventAdditionalInfo.fromJson(
            json['violationEventAdditionalInfo'] as Map<String, dynamic>)
        : null,
    violationId: json['violationId'] as String?,
    violationStartTime: timeStampFromJson(json['violationStartTime']),
  );
}