update_user_dto.dart 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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 UpdateUserDto {
  11. /// Returns a new [UpdateUserDto] instance.
  12. UpdateUserDto({
  13. this.avatarColor,
  14. this.email,
  15. this.externalPath,
  16. required this.id,
  17. this.isAdmin,
  18. this.memoriesEnabled,
  19. this.name,
  20. this.password,
  21. this.shouldChangePassword,
  22. this.storageLabel,
  23. });
  24. ///
  25. /// Please note: This property should have been non-nullable! Since the specification file
  26. /// does not include a default value (using the "default:" property), however, the generated
  27. /// source code must fall back to having a nullable type.
  28. /// Consider adding a "default:" property in the specification file to hide this note.
  29. ///
  30. UserAvatarColor? avatarColor;
  31. ///
  32. /// Please note: This property should have been non-nullable! Since the specification file
  33. /// does not include a default value (using the "default:" property), however, the generated
  34. /// source code must fall back to having a nullable type.
  35. /// Consider adding a "default:" property in the specification file to hide this note.
  36. ///
  37. String? email;
  38. ///
  39. /// Please note: This property should have been non-nullable! Since the specification file
  40. /// does not include a default value (using the "default:" property), however, the generated
  41. /// source code must fall back to having a nullable type.
  42. /// Consider adding a "default:" property in the specification file to hide this note.
  43. ///
  44. String? externalPath;
  45. String id;
  46. ///
  47. /// Please note: This property should have been non-nullable! Since the specification file
  48. /// does not include a default value (using the "default:" property), however, the generated
  49. /// source code must fall back to having a nullable type.
  50. /// Consider adding a "default:" property in the specification file to hide this note.
  51. ///
  52. bool? isAdmin;
  53. ///
  54. /// Please note: This property should have been non-nullable! Since the specification file
  55. /// does not include a default value (using the "default:" property), however, the generated
  56. /// source code must fall back to having a nullable type.
  57. /// Consider adding a "default:" property in the specification file to hide this note.
  58. ///
  59. bool? memoriesEnabled;
  60. ///
  61. /// Please note: This property should have been non-nullable! Since the specification file
  62. /// does not include a default value (using the "default:" property), however, the generated
  63. /// source code must fall back to having a nullable type.
  64. /// Consider adding a "default:" property in the specification file to hide this note.
  65. ///
  66. String? name;
  67. ///
  68. /// Please note: This property should have been non-nullable! Since the specification file
  69. /// does not include a default value (using the "default:" property), however, the generated
  70. /// source code must fall back to having a nullable type.
  71. /// Consider adding a "default:" property in the specification file to hide this note.
  72. ///
  73. String? password;
  74. ///
  75. /// Please note: This property should have been non-nullable! Since the specification file
  76. /// does not include a default value (using the "default:" property), however, the generated
  77. /// source code must fall back to having a nullable type.
  78. /// Consider adding a "default:" property in the specification file to hide this note.
  79. ///
  80. bool? shouldChangePassword;
  81. ///
  82. /// Please note: This property should have been non-nullable! Since the specification file
  83. /// does not include a default value (using the "default:" property), however, the generated
  84. /// source code must fall back to having a nullable type.
  85. /// Consider adding a "default:" property in the specification file to hide this note.
  86. ///
  87. String? storageLabel;
  88. @override
  89. bool operator ==(Object other) => identical(this, other) || other is UpdateUserDto &&
  90. other.avatarColor == avatarColor &&
  91. other.email == email &&
  92. other.externalPath == externalPath &&
  93. other.id == id &&
  94. other.isAdmin == isAdmin &&
  95. other.memoriesEnabled == memoriesEnabled &&
  96. other.name == name &&
  97. other.password == password &&
  98. other.shouldChangePassword == shouldChangePassword &&
  99. other.storageLabel == storageLabel;
  100. @override
  101. int get hashCode =>
  102. // ignore: unnecessary_parenthesis
  103. (avatarColor == null ? 0 : avatarColor!.hashCode) +
  104. (email == null ? 0 : email!.hashCode) +
  105. (externalPath == null ? 0 : externalPath!.hashCode) +
  106. (id.hashCode) +
  107. (isAdmin == null ? 0 : isAdmin!.hashCode) +
  108. (memoriesEnabled == null ? 0 : memoriesEnabled!.hashCode) +
  109. (name == null ? 0 : name!.hashCode) +
  110. (password == null ? 0 : password!.hashCode) +
  111. (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) +
  112. (storageLabel == null ? 0 : storageLabel!.hashCode);
  113. @override
  114. String toString() => 'UpdateUserDto[avatarColor=$avatarColor, email=$email, externalPath=$externalPath, id=$id, isAdmin=$isAdmin, memoriesEnabled=$memoriesEnabled, name=$name, password=$password, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
  115. Map<String, dynamic> toJson() {
  116. final json = <String, dynamic>{};
  117. if (this.avatarColor != null) {
  118. json[r'avatarColor'] = this.avatarColor;
  119. } else {
  120. // json[r'avatarColor'] = null;
  121. }
  122. if (this.email != null) {
  123. json[r'email'] = this.email;
  124. } else {
  125. // json[r'email'] = null;
  126. }
  127. if (this.externalPath != null) {
  128. json[r'externalPath'] = this.externalPath;
  129. } else {
  130. // json[r'externalPath'] = null;
  131. }
  132. json[r'id'] = this.id;
  133. if (this.isAdmin != null) {
  134. json[r'isAdmin'] = this.isAdmin;
  135. } else {
  136. // json[r'isAdmin'] = null;
  137. }
  138. if (this.memoriesEnabled != null) {
  139. json[r'memoriesEnabled'] = this.memoriesEnabled;
  140. } else {
  141. // json[r'memoriesEnabled'] = null;
  142. }
  143. if (this.name != null) {
  144. json[r'name'] = this.name;
  145. } else {
  146. // json[r'name'] = null;
  147. }
  148. if (this.password != null) {
  149. json[r'password'] = this.password;
  150. } else {
  151. // json[r'password'] = null;
  152. }
  153. if (this.shouldChangePassword != null) {
  154. json[r'shouldChangePassword'] = this.shouldChangePassword;
  155. } else {
  156. // json[r'shouldChangePassword'] = null;
  157. }
  158. if (this.storageLabel != null) {
  159. json[r'storageLabel'] = this.storageLabel;
  160. } else {
  161. // json[r'storageLabel'] = null;
  162. }
  163. return json;
  164. }
  165. /// Returns a new [UpdateUserDto] instance and imports its values from
  166. /// [value] if it's a [Map], null otherwise.
  167. // ignore: prefer_constructors_over_static_methods
  168. static UpdateUserDto? fromJson(dynamic value) {
  169. if (value is Map) {
  170. final json = value.cast<String, dynamic>();
  171. return UpdateUserDto(
  172. avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']),
  173. email: mapValueOfType<String>(json, r'email'),
  174. externalPath: mapValueOfType<String>(json, r'externalPath'),
  175. id: mapValueOfType<String>(json, r'id')!,
  176. isAdmin: mapValueOfType<bool>(json, r'isAdmin'),
  177. memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled'),
  178. name: mapValueOfType<String>(json, r'name'),
  179. password: mapValueOfType<String>(json, r'password'),
  180. shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword'),
  181. storageLabel: mapValueOfType<String>(json, r'storageLabel'),
  182. );
  183. }
  184. return null;
  185. }
  186. static List<UpdateUserDto> listFromJson(dynamic json, {bool growable = false,}) {
  187. final result = <UpdateUserDto>[];
  188. if (json is List && json.isNotEmpty) {
  189. for (final row in json) {
  190. final value = UpdateUserDto.fromJson(row);
  191. if (value != null) {
  192. result.add(value);
  193. }
  194. }
  195. }
  196. return result.toList(growable: growable);
  197. }
  198. static Map<String, UpdateUserDto> mapFromJson(dynamic json) {
  199. final map = <String, UpdateUserDto>{};
  200. if (json is Map && json.isNotEmpty) {
  201. json = json.cast<String, dynamic>(); // ignore: parameter_assignments
  202. for (final entry in json.entries) {
  203. final value = UpdateUserDto.fromJson(entry.value);
  204. if (value != null) {
  205. map[entry.key] = value;
  206. }
  207. }
  208. }
  209. return map;
  210. }
  211. // maps a json object with a list of UpdateUserDto-objects as value to a dart map
  212. static Map<String, List<UpdateUserDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
  213. final map = <String, List<UpdateUserDto>>{};
  214. if (json is Map && json.isNotEmpty) {
  215. // ignore: parameter_assignments
  216. json = json.cast<String, dynamic>();
  217. for (final entry in json.entries) {
  218. map[entry.key] = UpdateUserDto.listFromJson(entry.value, growable: growable,);
  219. }
  220. }
  221. return map;
  222. }
  223. /// The list of required keys that must be present in a JSON.
  224. static const requiredKeys = <String>{
  225. 'id',
  226. };
  227. }