mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 00:21:19 +00:00
117 lines
3.3 KiB
Dart
117 lines
3.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 GeoPointDTO {
|
|
/// Returns a new [GeoPointDTO] instance.
|
|
GeoPointDTO({
|
|
this.id,
|
|
this.title,
|
|
this.description,
|
|
this.images,
|
|
this.latitude,
|
|
this.longitude,
|
|
});
|
|
|
|
int id;
|
|
|
|
List<TranslationDTO> title;
|
|
|
|
List<TranslationDTO> description;
|
|
|
|
List<ImageGeoPoint> images;
|
|
|
|
String latitude;
|
|
|
|
String longitude;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is GeoPointDTO &&
|
|
other.id == id &&
|
|
other.title == title &&
|
|
other.description == description &&
|
|
other.images == images &&
|
|
other.latitude == latitude &&
|
|
other.longitude == longitude;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
(id == null ? 0 : id.hashCode) +
|
|
(title == null ? 0 : title.hashCode) +
|
|
(description == null ? 0 : description.hashCode) +
|
|
(images == null ? 0 : images.hashCode) +
|
|
(latitude == null ? 0 : latitude.hashCode) +
|
|
(longitude == null ? 0 : longitude.hashCode);
|
|
|
|
@override
|
|
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (id != null) {
|
|
json[r'id'] = id;
|
|
}
|
|
if (title != null) {
|
|
json[r'title'] = title;
|
|
}
|
|
if (description != null) {
|
|
json[r'description'] = description;
|
|
}
|
|
if (images != null) {
|
|
json[r'images'] = images;
|
|
}
|
|
if (latitude != null) {
|
|
json[r'latitude'] = latitude;
|
|
}
|
|
if (longitude != null) {
|
|
json[r'longitude'] = longitude;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [GeoPointDTO] instance and imports its values from
|
|
/// [json] if it's non-null, null if [json] is null.
|
|
static GeoPointDTO fromJson(Map<String, dynamic> json) => json == null
|
|
? null
|
|
: GeoPointDTO(
|
|
id: json[r'id'],
|
|
title: TranslationDTO.listFromJson(json[r'title']),
|
|
description: TranslationDTO.listFromJson(json[r'description']),
|
|
images: ImageGeoPoint.listFromJson(json[r'images']),
|
|
latitude: json[r'latitude'],
|
|
longitude: json[r'longitude'],
|
|
);
|
|
|
|
static List<GeoPointDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
|
json == null || json.isEmpty
|
|
? true == emptyIsNull ? null : <GeoPointDTO>[]
|
|
: json.map((v) => GeoPointDTO.fromJson(v)).toList(growable: true == growable);
|
|
|
|
static Map<String, GeoPointDTO> mapFromJson(Map<String, dynamic> json) {
|
|
final map = <String, GeoPointDTO>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) => map[key] = GeoPointDTO.fromJson(v));
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of GeoPointDTO-objects as value to a dart map
|
|
static Map<String, List<GeoPointDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
|
final map = <String, List<GeoPointDTO>>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) {
|
|
map[key] = GeoPointDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
|
});
|
|
}
|
|
return map;
|
|
}
|
|
}
|
|
|