Sensor.fromJson constructor

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

Implementation

Sensor.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  company =
      json['company'] != null ? Company?.fromJson(json['company']) : null;
  machine =
      json['machine'] != null ? Machine?.fromJson(json['machine']) : null;
  collector = json['collector'] != null
      ? Collector?.fromJson(json['collector'])
      : null;
  config = json['config'] != null ? Config?.fromJson(json['config']) : null;
  api = json['api'] != null ? Api?.fromJson(json['api']) : null;
  key = json['key'];
  tags = json['tags'].cast<String>();
  deleted = json['deleted'];
  name = json['name'];
  buildTogether = json['build_together'].cast<String>();
  buildDataChanges = json['build_data_changes'];
}