fromJson static method
Returns a new UpdateTenantUserBody instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static UpdateTenantUserBody? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
return true;
}());
return UpdateTenantUserBody(
username: mapValueOfType<String>(json, r'username'),
displayName: mapValueOfType<String>(json, r'displayName'),
websiteUrl: mapValueOfType<String>(json, r'websiteUrl'),
email: mapValueOfType<String>(json, r'email'),
signUpDate: mapValueOfType<double>(json, r'signUpDate'),
verified: mapValueOfType<bool>(json, r'verified'),
loginCount: mapValueOfType<double>(json, r'loginCount'),
optedInNotifications: mapValueOfType<bool>(json, r'optedInNotifications'),
optedInTenantNotifications: mapValueOfType<bool>(json, r'optedInTenantNotifications'),
hideAccountCode: mapValueOfType<bool>(json, r'hideAccountCode'),
avatarSrc: mapValueOfType<String>(json, r'avatarSrc'),
isHelpRequestAdmin: mapValueOfType<bool>(json, r'isHelpRequestAdmin'),
isAccountOwner: mapValueOfType<bool>(json, r'isAccountOwner'),
isAdminAdmin: mapValueOfType<bool>(json, r'isAdminAdmin'),
isBillingAdmin: mapValueOfType<bool>(json, r'isBillingAdmin'),
isAnalyticsAdmin: mapValueOfType<bool>(json, r'isAnalyticsAdmin'),
isCustomizationAdmin: mapValueOfType<bool>(json, r'isCustomizationAdmin'),
isManageDataAdmin: mapValueOfType<bool>(json, r'isManageDataAdmin'),
isCommentModeratorAdmin: mapValueOfType<bool>(json, r'isCommentModeratorAdmin'),
isAPIAdmin: mapValueOfType<bool>(json, r'isAPIAdmin'),
moderatorIds: json[r'moderatorIds'] is Iterable
? (json[r'moderatorIds'] as Iterable).cast<String>().toList(growable: false)
: const [],
locale: mapValueOfType<String>(json, r'locale'),
digestEmailFrequency: mapValueOfType<double>(json, r'digestEmailFrequency'),
displayLabel: mapValueOfType<String>(json, r'displayLabel'),
);
}
return null;
}