ViolationEvent.fromJson constructor

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

Implementation

factory ViolationEvent.fromJson(Map<String, dynamic> json) {
  return ViolationEvent(
    behavior: json['behavior'] != null
        ? Behavior.fromJson(json['behavior'] as Map<String, dynamic>)
        : null,
    metricValue: json['metricValue'] != null
        ? MetricValue.fromJson(json['metricValue'] 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,
    violationEventTime: timeStampFromJson(json['violationEventTime']),
    violationEventType:
        (json['violationEventType'] as String?)?.toViolationEventType(),
    violationId: json['violationId'] as String?,
  );
}