queue_status_dto.dart 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 QueueStatusDto {
  11. /// Returns a new [QueueStatusDto] instance.
  12. QueueStatusDto({
  13. required this.isActive,
  14. required this.isPaused,
  15. });
  16. bool isActive;
  17. bool isPaused;
  18. @override
  19. bool operator ==(Object other) => identical(this, other) || other is QueueStatusDto &&
  20. other.isActive == isActive &&
  21. other.isPaused == isPaused;
  22. @override
  23. int get hashCode =>
  24. // ignore: unnecessary_parenthesis
  25. (isActive.hashCode) +
  26. (isPaused.hashCode);
  27. @override
  28. String toString() => 'QueueStatusDto[isActive=$isActive, isPaused=$isPaused]';
  29. Map<String, dynamic> toJson() {
  30. final json = <String, dynamic>{};
  31. json[r'isActive'] = this.isActive;
  32. json[r'isPaused'] = this.isPaused;
  33. return json;
  34. }
  35. /// Returns a new [QueueStatusDto] instance and imports its values from
  36. /// [value] if it's a [Map], null otherwise.
  37. // ignore: prefer_constructors_over_static_methods
  38. static QueueStatusDto? fromJson(dynamic value) {
  39. if (value is Map) {
  40. final json = value.cast<String, dynamic>();
  41. // Ensure that the map contains the required keys.
  42. // Note 1: the values aren't checked for validity beyond being non-null.
  43. // Note 2: this code is stripped in release mode!
  44. assert(() {
  45. requiredKeys.forEach((key) {
  46. assert(json.containsKey(key), 'Required key "QueueStatusDto[$key]" is missing from JSON.');
  47. assert(json[key] != null, 'Required key "QueueStatusDto[$key]" has a null value in JSON.');
  48. });
  49. return true;
  50. }());
  51. return QueueStatusDto(
  52. isActive: mapValueOfType<bool>(json, r'isActive')!,
  53. isPaused: mapValueOfType<bool>(json, r'isPaused')!,
  54. );
  55. }
  56. return null;
  57. }
  58. static List<QueueStatusDto>? listFromJson(dynamic json, {bool growable = false,}) {
  59. final result = <QueueStatusDto>[];
  60. if (json is List && json.isNotEmpty) {
  61. for (final row in json) {
  62. final value = QueueStatusDto.fromJson(row);
  63. if (value != null) {
  64. result.add(value);
  65. }
  66. }
  67. }
  68. return result.toList(growable: growable);
  69. }
  70. static Map<String, QueueStatusDto> mapFromJson(dynamic json) {
  71. final map = <String, QueueStatusDto>{};
  72. if (json is Map && json.isNotEmpty) {
  73. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  74. for (final entry in json.entries) {
  75. final value = QueueStatusDto.fromJson(entry.value);
  76. if (value != null) {
  77. map[entry.key] = value;
  78. }
  79. }
  80. }
  81. return map;
  82. }
  83. // maps a json object with a list of QueueStatusDto-objects as value to a dart map
  84. static Map<String, List<QueueStatusDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  85. final map = <String, List<QueueStatusDto>>{};
  86. if (json is Map && json.isNotEmpty) {
  87. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  88. for (final entry in json.entries) {
  89. final value = QueueStatusDto.listFromJson(entry.value, growable: growable,);
  90. if (value != null) {
  91. map[entry.key] = value;
  92. }
  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. 'isActive',
  100. 'isPaused',
  101. };
  102. }