mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 17:51:20 +00:00
265 lines
7.5 KiB
Dart
265 lines
7.5 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 UserInfo {
|
|
/// Returns a new [UserInfo] instance.
|
|
UserInfo({
|
|
this.id,
|
|
this.role,
|
|
this.email,
|
|
this.password,
|
|
this.firstName,
|
|
this.lastName,
|
|
this.token,
|
|
this.birthday,
|
|
this.dateCreation,
|
|
this.address,
|
|
this.city,
|
|
this.state,
|
|
this.country,
|
|
this.language,
|
|
this.timeZone,
|
|
this.postalCode,
|
|
this.automations,
|
|
this.devices,
|
|
this.providers,
|
|
this.groups,
|
|
this.screenConfigurationIds,
|
|
this.deviceIds,
|
|
});
|
|
|
|
String id;
|
|
|
|
String role;
|
|
|
|
String email;
|
|
|
|
String password;
|
|
|
|
String firstName;
|
|
|
|
String lastName;
|
|
|
|
String token;
|
|
|
|
DateTime birthday;
|
|
|
|
DateTime dateCreation;
|
|
|
|
String address;
|
|
|
|
String city;
|
|
|
|
String state;
|
|
|
|
String country;
|
|
|
|
String language;
|
|
|
|
String timeZone;
|
|
|
|
int postalCode;
|
|
|
|
List<Automation> automations;
|
|
|
|
List<Device> devices;
|
|
|
|
List<Provider> providers;
|
|
|
|
List<Group> groups;
|
|
|
|
List<ScreenConfiguration> screenConfigurationIds;
|
|
|
|
List<ScreenDevice> deviceIds;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is UserInfo &&
|
|
other.id == id &&
|
|
other.role == role &&
|
|
other.email == email &&
|
|
other.password == password &&
|
|
other.firstName == firstName &&
|
|
other.lastName == lastName &&
|
|
other.token == token &&
|
|
other.birthday == birthday &&
|
|
other.dateCreation == dateCreation &&
|
|
other.address == address &&
|
|
other.city == city &&
|
|
other.state == state &&
|
|
other.country == country &&
|
|
other.language == language &&
|
|
other.timeZone == timeZone &&
|
|
other.postalCode == postalCode &&
|
|
other.automations == automations &&
|
|
other.devices == devices &&
|
|
other.providers == providers &&
|
|
other.groups == groups &&
|
|
other.screenConfigurationIds == screenConfigurationIds &&
|
|
other.deviceIds == deviceIds;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
(id == null ? 0 : id.hashCode) +
|
|
(role == null ? 0 : role.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) +
|
|
(birthday == null ? 0 : birthday.hashCode) +
|
|
(dateCreation == null ? 0 : dateCreation.hashCode) +
|
|
(address == null ? 0 : address.hashCode) +
|
|
(city == null ? 0 : city.hashCode) +
|
|
(state == null ? 0 : state.hashCode) +
|
|
(country == null ? 0 : country.hashCode) +
|
|
(language == null ? 0 : language.hashCode) +
|
|
(timeZone == null ? 0 : timeZone.hashCode) +
|
|
(postalCode == null ? 0 : postalCode.hashCode) +
|
|
(automations == null ? 0 : automations.hashCode) +
|
|
(devices == null ? 0 : devices.hashCode) +
|
|
(providers == null ? 0 : providers.hashCode) +
|
|
(groups == null ? 0 : groups.hashCode) +
|
|
(screenConfigurationIds == null ? 0 : screenConfigurationIds.hashCode) +
|
|
(deviceIds == null ? 0 : deviceIds.hashCode);
|
|
|
|
@override
|
|
String toString() => 'UserInfo[id=$id, role=$role, email=$email, password=$password, firstName=$firstName, lastName=$lastName, token=$token, birthday=$birthday, dateCreation=$dateCreation, address=$address, city=$city, state=$state, country=$country, language=$language, timeZone=$timeZone, postalCode=$postalCode, automations=$automations, devices=$devices, providers=$providers, groups=$groups, screenConfigurationIds=$screenConfigurationIds, deviceIds=$deviceIds]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (id != null) {
|
|
json[r'id'] = id;
|
|
}
|
|
if (role != null) {
|
|
json[r'role'] = role;
|
|
}
|
|
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 (birthday != null) {
|
|
json[r'birthday'] = birthday.toUtc().toIso8601String();
|
|
}
|
|
if (dateCreation != null) {
|
|
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
|
|
}
|
|
if (address != null) {
|
|
json[r'address'] = address;
|
|
}
|
|
if (city != null) {
|
|
json[r'city'] = city;
|
|
}
|
|
if (state != null) {
|
|
json[r'state'] = state;
|
|
}
|
|
if (country != null) {
|
|
json[r'country'] = country;
|
|
}
|
|
if (language != null) {
|
|
json[r'language'] = language;
|
|
}
|
|
if (timeZone != null) {
|
|
json[r'timeZone'] = timeZone;
|
|
}
|
|
if (postalCode != null) {
|
|
json[r'postalCode'] = postalCode;
|
|
}
|
|
if (automations != null) {
|
|
json[r'automations'] = automations;
|
|
}
|
|
if (devices != null) {
|
|
json[r'devices'] = devices;
|
|
}
|
|
if (providers != null) {
|
|
json[r'providers'] = providers;
|
|
}
|
|
if (groups != null) {
|
|
json[r'groups'] = groups;
|
|
}
|
|
if (screenConfigurationIds != null) {
|
|
json[r'screenConfigurationIds'] = screenConfigurationIds;
|
|
}
|
|
if (deviceIds != null) {
|
|
json[r'deviceIds'] = deviceIds;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [UserInfo] instance and imports its values from
|
|
/// [json] if it's non-null, null if [json] is null.
|
|
static UserInfo fromJson(Map<String, dynamic> json) => json == null
|
|
? null
|
|
: UserInfo(
|
|
id: json[r'id'],
|
|
role: json[r'role'],
|
|
email: json[r'email'],
|
|
password: json[r'password'],
|
|
firstName: json[r'firstName'],
|
|
lastName: json[r'lastName'],
|
|
token: json[r'token'],
|
|
birthday: json[r'birthday'] == null
|
|
? null
|
|
: DateTime.parse(json[r'birthday']),
|
|
dateCreation: json[r'dateCreation'] == null
|
|
? null
|
|
: DateTime.parse(json[r'dateCreation']),
|
|
address: json[r'address'],
|
|
city: json[r'city'],
|
|
state: json[r'state'],
|
|
country: json[r'country'],
|
|
language: json[r'language'],
|
|
timeZone: json[r'timeZone'],
|
|
postalCode: json[r'postalCode'],
|
|
automations: Automation.listFromJson(json[r'automations']),
|
|
devices: Device.listFromJson(json[r'devices']),
|
|
providers: Provider.listFromJson(json[r'providers']),
|
|
groups: Group.listFromJson(json[r'groups']),
|
|
screenConfigurationIds: ScreenConfiguration.listFromJson(json[r'screenConfigurationIds']),
|
|
deviceIds: ScreenDevice.listFromJson(json[r'deviceIds']),
|
|
);
|
|
|
|
static List<UserInfo> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
|
json == null || json.isEmpty
|
|
? true == emptyIsNull ? null : <UserInfo>[]
|
|
: json.map((v) => UserInfo.fromJson(v)).toList(growable: true == growable);
|
|
|
|
static Map<String, UserInfo> mapFromJson(Map<String, dynamic> json) {
|
|
final map = <String, UserInfo>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) => map[key] = UserInfo.fromJson(v));
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of UserInfo-objects as value to a dart map
|
|
static Map<String, List<UserInfo>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
|
final map = <String, List<UserInfo>>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) {
|
|
map[key] = UserInfo.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
|
});
|
|
}
|
|
return map;
|
|
}
|
|
}
|
|
|