system_config_machine_learning_dto.dart 4.1 KB

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