system_config_reverse_geocoding_dto.dart 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 SystemConfigReverseGeocodingDto {
  11. /// Returns a new [SystemConfigReverseGeocodingDto] instance.
  12. SystemConfigReverseGeocodingDto({
  13. required this.citiesFileOverride,
  14. required this.enabled,
  15. required this.mapboxAccessToken,
  16. required this.useMapbox,
  17. });
  18. CitiesFile citiesFileOverride;
  19. bool enabled;
  20. String mapboxAccessToken;
  21. bool useMapbox;
  22. @override
  23. bool operator ==(Object other) => identical(this, other) || other is SystemConfigReverseGeocodingDto &&
  24. other.citiesFileOverride == citiesFileOverride &&
  25. other.enabled == enabled &&
  26. other.mapboxAccessToken == mapboxAccessToken &&
  27. other.useMapbox == useMapbox;
  28. @override
  29. int get hashCode =>
  30. // ignore: unnecessary_parenthesis
  31. (citiesFileOverride.hashCode) +
  32. (enabled.hashCode) +
  33. (mapboxAccessToken.hashCode) +
  34. (useMapbox.hashCode);
  35. @override
  36. String toString() => 'SystemConfigReverseGeocodingDto[citiesFileOverride=$citiesFileOverride, enabled=$enabled, mapboxAccessToken=$mapboxAccessToken, useMapbox=$useMapbox]';
  37. Map<String, dynamic> toJson() {
  38. final json = <String, dynamic>{};
  39. json[r'citiesFileOverride'] = this.citiesFileOverride;
  40. json[r'enabled'] = this.enabled;
  41. json[r'mapboxAccessToken'] = this.mapboxAccessToken;
  42. json[r'useMapbox'] = this.useMapbox;
  43. return json;
  44. }
  45. /// Returns a new [SystemConfigReverseGeocodingDto] instance and imports its values from
  46. /// [value] if it's a [Map], null otherwise.
  47. // ignore: prefer_constructors_over_static_methods
  48. static SystemConfigReverseGeocodingDto? fromJson(dynamic value) {
  49. if (value is Map) {
  50. final json = value.cast<String, dynamic>();
  51. return SystemConfigReverseGeocodingDto(
  52. citiesFileOverride: CitiesFile.fromJson(json[r'citiesFileOverride'])!,
  53. enabled: mapValueOfType<bool>(json, r'enabled')!,
  54. mapboxAccessToken: mapValueOfType<String>(json, r'mapboxAccessToken')!,
  55. useMapbox: mapValueOfType<bool>(json, r'useMapbox')!,
  56. );
  57. }
  58. return null;
  59. }
  60. static List<SystemConfigReverseGeocodingDto> listFromJson(dynamic json, {bool growable = false,}) {
  61. final result = <SystemConfigReverseGeocodingDto>[];
  62. if (json is List && json.isNotEmpty) {
  63. for (final row in json) {
  64. final value = SystemConfigReverseGeocodingDto.fromJson(row);
  65. if (value != null) {
  66. result.add(value);
  67. }
  68. }
  69. }
  70. return result.toList(growable: growable);
  71. }
  72. static Map<String, SystemConfigReverseGeocodingDto> mapFromJson(dynamic json) {
  73. final map = <String, SystemConfigReverseGeocodingDto>{};
  74. if (json is Map && json.isNotEmpty) {
  75. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  76. for (final entry in json.entries) {
  77. final value = SystemConfigReverseGeocodingDto.fromJson(entry.value);
  78. if (value != null) {
  79. map[entry.key] = value;
  80. }
  81. }
  82. }
  83. return map;
  84. }
  85. // maps a json object with a list of SystemConfigReverseGeocodingDto-objects as value to a dart map
  86. static Map<String, List<SystemConfigReverseGeocodingDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  87. final map = <String, List<SystemConfigReverseGeocodingDto>>{};
  88. if (json is Map && json.isNotEmpty) {
  89. // ignore: parameter_assignments
  90. json = json.cast<String, dynamic>();
  91. for (final entry in json.entries) {
  92. map[entry.key] = SystemConfigReverseGeocodingDto.listFromJson(entry.value, growable: growable,);
  93. }
  94. }
  95. return map;
  96. }
  97. /// The list of required keys that must be present in a JSON.
  98. static const requiredKeys = <String>{
  99. 'citiesFileOverride',
  100. 'enabled',
  101. 'mapboxAccessToken',
  102. 'useMapbox',
  103. };
  104. }