system_config_new_version_check_dto.dart 3.0 KB

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