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