mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 16:41:19 +00:00
121 lines
3.6 KiB
Dart
121 lines
3.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 ConfigurationDTO {
|
|
/// Returns a new [ConfigurationDTO] instance.
|
|
ConfigurationDTO({
|
|
this.id,
|
|
this.label,
|
|
this.primaryColor,
|
|
this.secondaryColor,
|
|
this.languages,
|
|
this.dateCreation,
|
|
});
|
|
|
|
String id;
|
|
|
|
String label;
|
|
|
|
String primaryColor;
|
|
|
|
String secondaryColor;
|
|
|
|
List<String> languages;
|
|
|
|
DateTime dateCreation;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
|
other.id == id &&
|
|
other.label == label &&
|
|
other.primaryColor == primaryColor &&
|
|
other.secondaryColor == secondaryColor &&
|
|
other.languages == languages &&
|
|
other.dateCreation == dateCreation;
|
|
|
|
@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);
|
|
|
|
@override
|
|
String toString() => 'ConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, 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 (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();
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [ConfigurationDTO] instance and imports its values from
|
|
/// [json] if it's non-null, null if [json] is null.
|
|
static ConfigurationDTO fromJson(Map<String, dynamic> json) => json == null
|
|
? null
|
|
: ConfigurationDTO(
|
|
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']),
|
|
);
|
|
|
|
static List<ConfigurationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
|
json == null || json.isEmpty
|
|
? true == emptyIsNull ? null : <ConfigurationDTO>[]
|
|
: json.map((v) => ConfigurationDTO.fromJson(v)).toList(growable: true == growable);
|
|
|
|
static Map<String, ConfigurationDTO> mapFromJson(Map<String, dynamic> json) {
|
|
final map = <String, ConfigurationDTO>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) => map[key] = ConfigurationDTO.fromJson(v));
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of ConfigurationDTO-objects as value to a dart map
|
|
static Map<String, List<ConfigurationDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
|
final map = <String, List<ConfigurationDTO>>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) {
|
|
map[key] = ConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
|
});
|
|
}
|
|
return map;
|
|
}
|
|
}
|
|
|