// // 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 Condition { /// Returns a new [Condition] instance. Condition({ this.deviceId, this.state, this.startTime, this.endTime, this.type, this.value, }); String deviceId; StateAPI state; String startTime; String endTime; ConditionType type; ConditionValue value; @override bool operator ==(Object other) => identical(this, other) || other is Condition && other.deviceId == deviceId && other.state == state && other.startTime == startTime && other.endTime == endTime && other.type == type && other.value == value; @override int get hashCode => (deviceId == null ? 0 : deviceId.hashCode) + (state == null ? 0 : state.hashCode) + (startTime == null ? 0 : startTime.hashCode) + (endTime == null ? 0 : endTime.hashCode) + (type == null ? 0 : type.hashCode) + (value == null ? 0 : value.hashCode); @override String toString() => 'Condition[deviceId=$deviceId, state=$state, startTime=$startTime, endTime=$endTime, type=$type, value=$value]'; Map toJson() { final json = {}; if (deviceId != null) { json[r'deviceId'] = deviceId; } if (state != null) { json[r'state'] = state; } if (startTime != null) { json[r'startTime'] = startTime; } if (endTime != null) { json[r'endTime'] = endTime; } if (type != null) { json[r'type'] = type; } if (value != null) { json[r'value'] = value; } return json; } /// Returns a new [Condition] instance and imports its values from /// [json] if it's non-null, null if [json] is null. static Condition fromJson(Map json) => json == null ? null : Condition( deviceId: json[r'deviceId'], startTime: json[r'startTime'], endTime: json[r'endTime'], type: ConditionType.fromJson(json[r'type']), value: ConditionValue.fromJson(json[r'value']), ); static List listFromJson(List json, {bool emptyIsNull, bool growable,}) => json == null || json.isEmpty ? true == emptyIsNull ? null : [] : json.map((v) => Condition.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] = Condition.fromJson(v)); } return map; } // maps a json object with a list of Condition-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] = Condition.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); }); } return map; } }