mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 16:41:19 +00:00
128 lines
3.4 KiB
Dart
128 lines
3.4 KiB
Dart
//
|
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
|
//
|
|
// @dart=2.0
|
|
|
|
// ignore_for_file: unused_element, unused_import
|
|
// ignore_for_file: always_put_required_named_parameters_first
|
|
// ignore_for_file: lines_longer_than_80_chars
|
|
|
|
part of openapi.api;
|
|
|
|
class User {
|
|
/// Returns a new [User] instance.
|
|
User({
|
|
this.id,
|
|
this.email,
|
|
this.password,
|
|
this.firstName,
|
|
this.lastName,
|
|
this.token,
|
|
this.dateCreation,
|
|
});
|
|
|
|
String id;
|
|
|
|
String email;
|
|
|
|
String password;
|
|
|
|
String firstName;
|
|
|
|
String lastName;
|
|
|
|
String token;
|
|
|
|
DateTime dateCreation;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is User &&
|
|
other.id == id &&
|
|
other.email == email &&
|
|
other.password == password &&
|
|
other.firstName == firstName &&
|
|
other.lastName == lastName &&
|
|
other.token == token &&
|
|
other.dateCreation == dateCreation;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
(id == null ? 0 : id.hashCode) +
|
|
(email == null ? 0 : email.hashCode) +
|
|
(password == null ? 0 : password.hashCode) +
|
|
(firstName == null ? 0 : firstName.hashCode) +
|
|
(lastName == null ? 0 : lastName.hashCode) +
|
|
(token == null ? 0 : token.hashCode) +
|
|
(dateCreation == null ? 0 : dateCreation.hashCode);
|
|
|
|
@override
|
|
String toString() => 'User[id=$id, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, dateCreation=$dateCreation]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (id != null) {
|
|
json[r'id'] = id;
|
|
}
|
|
if (email != null) {
|
|
json[r'email'] = email;
|
|
}
|
|
if (password != null) {
|
|
json[r'password'] = password;
|
|
}
|
|
if (firstName != null) {
|
|
json[r'firstName'] = firstName;
|
|
}
|
|
if (lastName != null) {
|
|
json[r'lastName'] = lastName;
|
|
}
|
|
if (token != null) {
|
|
json[r'token'] = token;
|
|
}
|
|
if (dateCreation != null) {
|
|
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [User] instance and imports its values from
|
|
/// [json] if it's non-null, null if [json] is null.
|
|
static User fromJson(Map<String, dynamic> json) => json == null
|
|
? null
|
|
: User(
|
|
id: json[r'id'],
|
|
email: json[r'email'],
|
|
password: json[r'password'],
|
|
firstName: json[r'firstName'],
|
|
lastName: json[r'lastName'],
|
|
token: json[r'token'],
|
|
dateCreation: json[r'dateCreation'] == null
|
|
? null
|
|
: DateTime.parse(json[r'dateCreation']),
|
|
);
|
|
|
|
static List<User> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
|
json == null || json.isEmpty
|
|
? true == emptyIsNull ? null : <User>[]
|
|
: json.map((v) => User.fromJson(v)).toList(growable: true == growable);
|
|
|
|
static Map<String, User> mapFromJson(Map<String, dynamic> json) {
|
|
final map = <String, User>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) => map[key] = User.fromJson(v));
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of User-objects as value to a dart map
|
|
static Map<String, List<User>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
|
final map = <String, List<User>>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) {
|
|
map[key] = User.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
|
});
|
|
}
|
|
return map;
|
|
}
|
|
}
|
|
|