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

182 lines
5.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 SectionDTO {
/// Returns a new [SectionDTO] instance.
SectionDTO({
this.id,
this.label,
this.title,
this.description,
this.imageId,
this.imageSource,
this.configurationId,
this.isSubSection,
this.parentId,
this.type,
this.data,
this.dateCreation,
this.order,
});
String id;
String label;
List<TranslationDTO> title;
List<TranslationDTO> description;
String imageId;
String imageSource;
String configurationId;
bool isSubSection;
String parentId;
SectionType type;
String data;
DateTime dateCreation;
int order;
@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.imageSource == imageSource &&
other.configurationId == configurationId &&
other.isSubSection == isSubSection &&
other.parentId == parentId &&
other.type == type &&
other.data == data &&
other.dateCreation == dateCreation &&
other.order == order;
@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) +
(imageSource == null ? 0 : imageSource.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) +
(order == null ? 0 : order.hashCode);
@override
String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order]';
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 (imageSource != null) {
json[r'imageSource'] = imageSource;
}
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();
}
if (order != null) {
json[r'order'] = order;
}
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: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']),
imageId: json[r'imageId'],
imageSource: json[r'imageSource'],
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']),
order: json[r'order'],
);
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;
}
}