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

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