// // AUTO-GENERATED FILE, DO NOT MODIFY! // // @dart=2.0 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: lines_longer_than_80_chars part of openapi.api; class Automation { /// Returns a new [Automation] instance. Automation({ this.id, this.userId, this.name, this.active, this.createdDate, this.updatedDate, this.triggers, this.conditions, this.actions, this.devicesIds, }); String id; String userId; String name; bool active; DateTime createdDate; DateTime updatedDate; List triggers; List conditions; List actions; List devicesIds; @override bool operator ==(Object other) => identical(this, other) || other is Automation && other.id == id && other.userId == userId && other.name == name && other.active == active && other.createdDate == createdDate && other.updatedDate == updatedDate && other.triggers == triggers && other.conditions == conditions && other.actions == actions && other.devicesIds == devicesIds; @override int get hashCode => (id == null ? 0 : id.hashCode) + (userId == null ? 0 : userId.hashCode) + (name == null ? 0 : name.hashCode) + (active == null ? 0 : active.hashCode) + (createdDate == null ? 0 : createdDate.hashCode) + (updatedDate == null ? 0 : updatedDate.hashCode) + (triggers == null ? 0 : triggers.hashCode) + (conditions == null ? 0 : conditions.hashCode) + (actions == null ? 0 : actions.hashCode) + (devicesIds == null ? 0 : devicesIds.hashCode); @override String toString() => 'Automation[id=$id, userId=$userId, name=$name, active=$active, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]'; Map toJson() { final json = {}; if (id != null) { json[r'id'] = id; } if (userId != null) { json[r'userId'] = userId; } if (name != null) { json[r'name'] = name; } if (active != null) { json[r'active'] = active; } if (createdDate != null) { json[r'createdDate'] = createdDate.toUtc().toIso8601String(); } if (updatedDate != null) { json[r'updatedDate'] = updatedDate.toUtc().toIso8601String(); } if (triggers != null) { json[r'triggers'] = triggers; } if (conditions != null) { json[r'conditions'] = conditions; } if (actions != null) { json[r'actions'] = actions; } if (devicesIds != null) { json[r'devicesIds'] = devicesIds; } return json; } /// Returns a new [Automation] instance and imports its values from /// [json] if it's non-null, null if [json] is null. static Automation fromJson(Map json) => json == null ? null : Automation( id: json[r'id'], userId: json[r'userId'], name: json[r'name'], active: json[r'active'], createdDate: json[r'createdDate'] == null ? null : DateTime.parse(json[r'createdDate']), updatedDate: json[r'updatedDate'] == null ? null : DateTime.parse(json[r'updatedDate']), triggers: Trigger.listFromJson(json[r'triggers']), conditions: Condition.listFromJson(json[r'conditions']), actions: Action.listFromJson(json[r'actions']), devicesIds: json[r'devicesIds'] == null ? null : (json[r'devicesIds'] as List).cast(), ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => json == null || json.isEmpty ? true == emptyIsNull ? null : [] : json.map((v) => Automation.fromJson(v)).toList(growable: true == growable); static Map mapFromJson(Map json) { final map = {}; if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic v) => map[key] = Automation.fromJson(v)); } return map; } // maps a json object with a list of Automation-objects as value to a dart map static Map> mapListFromJson(Map json, {bool emptyIsNull, bool growable,}) { final map = >{}; if (json != null && json.isNotEmpty) { json.forEach((String key, dynamic v) { map[key] = Automation.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); }); } return map; } }