tablet-app/manager_api/lib/model/resource_detail_dto.dart

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