server_features_dto.dart 4.6 KB

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