150 lines
4.2 KiB
Dart

//
// 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 Group {
/// Returns a new [Group] instance.
Group({
this.id,
this.userId,
this.name,
this.type,
this.serviceIdentification,
this.isAlarm,
this.createdDate,
this.updatedDate,
this.devicesIds,
});
String id;
String userId;
String name;
String type;
int serviceIdentification;
bool isAlarm;
DateTime createdDate;
DateTime updatedDate;
List<String> devicesIds;
@override
bool operator ==(Object other) => identical(this, other) || other is Group &&
other.id == id &&
other.userId == userId &&
other.name == name &&
other.type == type &&
other.serviceIdentification == serviceIdentification &&
other.isAlarm == isAlarm &&
other.createdDate == createdDate &&
other.updatedDate == updatedDate &&
other.devicesIds == devicesIds;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(userId == null ? 0 : userId.hashCode) +
(name == null ? 0 : name.hashCode) +
(type == null ? 0 : type.hashCode) +
(serviceIdentification == null ? 0 : serviceIdentification.hashCode) +
(isAlarm == null ? 0 : isAlarm.hashCode) +
(createdDate == null ? 0 : createdDate.hashCode) +
(updatedDate == null ? 0 : updatedDate.hashCode) +
(devicesIds == null ? 0 : devicesIds.hashCode);
@override
String toString() => 'Group[id=$id, userId=$userId, name=$name, type=$type, serviceIdentification=$serviceIdentification, isAlarm=$isAlarm, createdDate=$createdDate, updatedDate=$updatedDate, devicesIds=$devicesIds]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (userId != null) {
json[r'userId'] = userId;
}
if (name != null) {
json[r'name'] = name;
}
if (type != null) {
json[r'type'] = type;
}
if (serviceIdentification != null) {
json[r'serviceIdentification'] = serviceIdentification;
}
if (isAlarm != null) {
json[r'isAlarm'] = isAlarm;
}
if (createdDate != null) {
json[r'createdDate'] = createdDate.toUtc().toIso8601String();
}
if (updatedDate != null) {
json[r'updatedDate'] = updatedDate.toUtc().toIso8601String();
}
if (devicesIds != null) {
json[r'devicesIds'] = devicesIds;
}
return json;
}
/// Returns a new [Group] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static Group fromJson(Map<String, dynamic> json) => json == null
? null
: Group(
id: json[r'id'],
userId: json[r'userId'],
name: json[r'name'],
type: json[r'type'],
serviceIdentification: json[r'serviceIdentification'],
isAlarm: json[r'isAlarm'],
createdDate: json[r'createdDate'] == null
? null
: DateTime.parse(json[r'createdDate']),
updatedDate: json[r'updatedDate'] == null
? null
: DateTime.parse(json[r'updatedDate']),
devicesIds: json[r'devicesIds'] == null
? null
: (json[r'devicesIds'] as List).cast<String>(),
);
static List<Group> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Group>[]
: json.map((v) => Group.fromJson(v)).toList(growable: true == growable);
static Map<String, Group> mapFromJson(Map<String, dynamic> json) {
final map = <String, Group>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Group.fromJson(v));
}
return map;
}
// maps a json object with a list of Group-objects as value to a dart map
static Map<String, List<Group>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Group>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Group.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}