exif_response_dto.dart 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. //
  2. // AUTO-GENERATED FILE, DO NOT MODIFY!
  3. //
  4. // @dart=2.12
  5. // ignore_for_file: unused_element, unused_import
  6. // ignore_for_file: always_put_required_named_parameters_first
  7. // ignore_for_file: constant_identifier_names
  8. // ignore_for_file: lines_longer_than_80_chars
  9. part of openapi.api;
  10. class ExifResponseDto {
  11. /// Returns a new [ExifResponseDto] instance.
  12. ExifResponseDto({
  13. this.fileSizeInByte,
  14. this.make,
  15. this.model,
  16. this.imageName,
  17. this.exifImageWidth,
  18. this.exifImageHeight,
  19. this.orientation,
  20. this.dateTimeOriginal,
  21. this.modifyDate,
  22. this.lensModel,
  23. this.fNumber,
  24. this.focalLength,
  25. this.iso,
  26. this.exposureTime,
  27. this.latitude,
  28. this.longitude,
  29. this.city,
  30. this.state,
  31. this.country,
  32. });
  33. int? fileSizeInByte;
  34. String? make;
  35. String? model;
  36. String? imageName;
  37. num? exifImageWidth;
  38. num? exifImageHeight;
  39. String? orientation;
  40. DateTime? dateTimeOriginal;
  41. DateTime? modifyDate;
  42. String? lensModel;
  43. num? fNumber;
  44. num? focalLength;
  45. num? iso;
  46. String? exposureTime;
  47. num? latitude;
  48. num? longitude;
  49. String? city;
  50. String? state;
  51. String? country;
  52. @override
  53. bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto &&
  54. other.fileSizeInByte == fileSizeInByte &&
  55. other.make == make &&
  56. other.model == model &&
  57. other.imageName == imageName &&
  58. other.exifImageWidth == exifImageWidth &&
  59. other.exifImageHeight == exifImageHeight &&
  60. other.orientation == orientation &&
  61. other.dateTimeOriginal == dateTimeOriginal &&
  62. other.modifyDate == modifyDate &&
  63. other.lensModel == lensModel &&
  64. other.fNumber == fNumber &&
  65. other.focalLength == focalLength &&
  66. other.iso == iso &&
  67. other.exposureTime == exposureTime &&
  68. other.latitude == latitude &&
  69. other.longitude == longitude &&
  70. other.city == city &&
  71. other.state == state &&
  72. other.country == country;
  73. @override
  74. int get hashCode =>
  75. // ignore: unnecessary_parenthesis
  76. (fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) +
  77. (make == null ? 0 : make!.hashCode) +
  78. (model == null ? 0 : model!.hashCode) +
  79. (imageName == null ? 0 : imageName!.hashCode) +
  80. (exifImageWidth == null ? 0 : exifImageWidth!.hashCode) +
  81. (exifImageHeight == null ? 0 : exifImageHeight!.hashCode) +
  82. (orientation == null ? 0 : orientation!.hashCode) +
  83. (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
  84. (modifyDate == null ? 0 : modifyDate!.hashCode) +
  85. (lensModel == null ? 0 : lensModel!.hashCode) +
  86. (fNumber == null ? 0 : fNumber!.hashCode) +
  87. (focalLength == null ? 0 : focalLength!.hashCode) +
  88. (iso == null ? 0 : iso!.hashCode) +
  89. (exposureTime == null ? 0 : exposureTime!.hashCode) +
  90. (latitude == null ? 0 : latitude!.hashCode) +
  91. (longitude == null ? 0 : longitude!.hashCode) +
  92. (city == null ? 0 : city!.hashCode) +
  93. (state == null ? 0 : state!.hashCode) +
  94. (country == null ? 0 : country!.hashCode);
  95. @override
  96. String toString() => 'ExifResponseDto[fileSizeInByte=$fileSizeInByte, make=$make, model=$model, imageName=$imageName, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country]';
  97. Map<String, dynamic> toJson() {
  98. final json = <String, dynamic>{};
  99. if (this.fileSizeInByte != null) {
  100. json[r'fileSizeInByte'] = this.fileSizeInByte;
  101. } else {
  102. // json[r'fileSizeInByte'] = null;
  103. }
  104. if (this.make != null) {
  105. json[r'make'] = this.make;
  106. } else {
  107. // json[r'make'] = null;
  108. }
  109. if (this.model != null) {
  110. json[r'model'] = this.model;
  111. } else {
  112. // json[r'model'] = null;
  113. }
  114. if (this.imageName != null) {
  115. json[r'imageName'] = this.imageName;
  116. } else {
  117. // json[r'imageName'] = null;
  118. }
  119. if (this.exifImageWidth != null) {
  120. json[r'exifImageWidth'] = this.exifImageWidth;
  121. } else {
  122. // json[r'exifImageWidth'] = null;
  123. }
  124. if (this.exifImageHeight != null) {
  125. json[r'exifImageHeight'] = this.exifImageHeight;
  126. } else {
  127. // json[r'exifImageHeight'] = null;
  128. }
  129. if (this.orientation != null) {
  130. json[r'orientation'] = this.orientation;
  131. } else {
  132. // json[r'orientation'] = null;
  133. }
  134. if (this.dateTimeOriginal != null) {
  135. json[r'dateTimeOriginal'] = this.dateTimeOriginal!.toUtc().toIso8601String();
  136. } else {
  137. // json[r'dateTimeOriginal'] = null;
  138. }
  139. if (this.modifyDate != null) {
  140. json[r'modifyDate'] = this.modifyDate!.toUtc().toIso8601String();
  141. } else {
  142. // json[r'modifyDate'] = null;
  143. }
  144. if (this.lensModel != null) {
  145. json[r'lensModel'] = this.lensModel;
  146. } else {
  147. // json[r'lensModel'] = null;
  148. }
  149. if (this.fNumber != null) {
  150. json[r'fNumber'] = this.fNumber;
  151. } else {
  152. // json[r'fNumber'] = null;
  153. }
  154. if (this.focalLength != null) {
  155. json[r'focalLength'] = this.focalLength;
  156. } else {
  157. // json[r'focalLength'] = null;
  158. }
  159. if (this.iso != null) {
  160. json[r'iso'] = this.iso;
  161. } else {
  162. // json[r'iso'] = null;
  163. }
  164. if (this.exposureTime != null) {
  165. json[r'exposureTime'] = this.exposureTime;
  166. } else {
  167. // json[r'exposureTime'] = null;
  168. }
  169. if (this.latitude != null) {
  170. json[r'latitude'] = this.latitude;
  171. } else {
  172. // json[r'latitude'] = null;
  173. }
  174. if (this.longitude != null) {
  175. json[r'longitude'] = this.longitude;
  176. } else {
  177. // json[r'longitude'] = null;
  178. }
  179. if (this.city != null) {
  180. json[r'city'] = this.city;
  181. } else {
  182. // json[r'city'] = null;
  183. }
  184. if (this.state != null) {
  185. json[r'state'] = this.state;
  186. } else {
  187. // json[r'state'] = null;
  188. }
  189. if (this.country != null) {
  190. json[r'country'] = this.country;
  191. } else {
  192. // json[r'country'] = null;
  193. }
  194. return json;
  195. }
  196. /// Returns a new [ExifResponseDto] instance and imports its values from
  197. /// [value] if it's a [Map], null otherwise.
  198. // ignore: prefer_constructors_over_static_methods
  199. static ExifResponseDto? fromJson(dynamic value) {
  200. if (value is Map) {
  201. final json = value.cast<String, dynamic>();
  202. // Ensure that the map contains the required keys.
  203. // Note 1: the values aren't checked for validity beyond being non-null.
  204. // Note 2: this code is stripped in release mode!
  205. assert(() {
  206. requiredKeys.forEach((key) {
  207. assert(json.containsKey(key), 'Required key "ExifResponseDto[$key]" is missing from JSON.');
  208. assert(json[key] != null, 'Required key "ExifResponseDto[$key]" has a null value in JSON.');
  209. });
  210. return true;
  211. }());
  212. return ExifResponseDto(
  213. fileSizeInByte: mapValueOfType<int>(json, r'fileSizeInByte'),
  214. make: mapValueOfType<String>(json, r'make'),
  215. model: mapValueOfType<String>(json, r'model'),
  216. imageName: mapValueOfType<String>(json, r'imageName'),
  217. exifImageWidth: json[r'exifImageWidth'] == null
  218. ? null
  219. : num.parse(json[r'exifImageWidth'].toString()),
  220. exifImageHeight: json[r'exifImageHeight'] == null
  221. ? null
  222. : num.parse(json[r'exifImageHeight'].toString()),
  223. orientation: mapValueOfType<String>(json, r'orientation'),
  224. dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', ''),
  225. modifyDate: mapDateTime(json, r'modifyDate', ''),
  226. lensModel: mapValueOfType<String>(json, r'lensModel'),
  227. fNumber: json[r'fNumber'] == null
  228. ? null
  229. : num.parse(json[r'fNumber'].toString()),
  230. focalLength: json[r'focalLength'] == null
  231. ? null
  232. : num.parse(json[r'focalLength'].toString()),
  233. iso: json[r'iso'] == null
  234. ? null
  235. : num.parse(json[r'iso'].toString()),
  236. exposureTime: mapValueOfType<String>(json, r'exposureTime'),
  237. latitude: json[r'latitude'] == null
  238. ? null
  239. : num.parse(json[r'latitude'].toString()),
  240. longitude: json[r'longitude'] == null
  241. ? null
  242. : num.parse(json[r'longitude'].toString()),
  243. city: mapValueOfType<String>(json, r'city'),
  244. state: mapValueOfType<String>(json, r'state'),
  245. country: mapValueOfType<String>(json, r'country'),
  246. );
  247. }
  248. return null;
  249. }
  250. static List<ExifResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
  251. final result = <ExifResponseDto>[];
  252. if (json is List && json.isNotEmpty) {
  253. for (final row in json) {
  254. final value = ExifResponseDto.fromJson(row);
  255. if (value != null) {
  256. result.add(value);
  257. }
  258. }
  259. }
  260. return result.toList(growable: growable);
  261. }
  262. static Map<String, ExifResponseDto> mapFromJson(dynamic json) {
  263. final map = <String, ExifResponseDto>{};
  264. if (json is Map && json.isNotEmpty) {
  265. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  266. for (final entry in json.entries) {
  267. final value = ExifResponseDto.fromJson(entry.value);
  268. if (value != null) {
  269. map[entry.key] = value;
  270. }
  271. }
  272. }
  273. return map;
  274. }
  275. // maps a json object with a list of ExifResponseDto-objects as value to a dart map
  276. static Map<String, List<ExifResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  277. final map = <String, List<ExifResponseDto>>{};
  278. if (json is Map && json.isNotEmpty) {
  279. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  280. for (final entry in json.entries) {
  281. final value = ExifResponseDto.listFromJson(entry.value, growable: growable,);
  282. if (value != null) {
  283. map[entry.key] = value;
  284. }
  285. }
  286. }
  287. return map;
  288. }
  289. /// The list of required keys that must be present in a JSON.
  290. static const requiredKeys = <String>{
  291. };
  292. }