fromJson static method
Returns a new MmEnvironmentConfigTeamSettings instance and imports its values from
value
if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static MmEnvironmentConfigTeamSettings? 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(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "MmEnvironmentConfigTeamSettings[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "MmEnvironmentConfigTeamSettings[$key]" has a null value in JSON.');
});
return true;
}());
return MmEnvironmentConfigTeamSettings(
siteName: mapValueOfType<bool>(json, r'SiteName'),
maxUsersPerTeam: mapValueOfType<bool>(json, r'MaxUsersPerTeam'),
enableTeamCreation: mapValueOfType<bool>(json, r'EnableTeamCreation'),
enableUserCreation: mapValueOfType<bool>(json, r'EnableUserCreation'),
enableOpenServer: mapValueOfType<bool>(json, r'EnableOpenServer'),
restrictCreationToDomains: mapValueOfType<bool>(json, r'RestrictCreationToDomains'),
enableCustomBrand: mapValueOfType<bool>(json, r'EnableCustomBrand'),
customBrandText: mapValueOfType<bool>(json, r'CustomBrandText'),
customDescriptionText: mapValueOfType<bool>(json, r'CustomDescriptionText'),
restrictDirectMessage: mapValueOfType<bool>(json, r'RestrictDirectMessage'),
restrictTeamInvite: mapValueOfType<bool>(json, r'RestrictTeamInvite'),
restrictPublicChannelManagement: mapValueOfType<bool>(json, r'RestrictPublicChannelManagement'),
restrictPrivateChannelManagement: mapValueOfType<bool>(json, r'RestrictPrivateChannelManagement'),
restrictPublicChannelCreation: mapValueOfType<bool>(json, r'RestrictPublicChannelCreation'),
restrictPrivateChannelCreation: mapValueOfType<bool>(json, r'RestrictPrivateChannelCreation'),
restrictPublicChannelDeletion: mapValueOfType<bool>(json, r'RestrictPublicChannelDeletion'),
restrictPrivateChannelDeletion: mapValueOfType<bool>(json, r'RestrictPrivateChannelDeletion'),
userStatusAwayTimeout: mapValueOfType<bool>(json, r'UserStatusAwayTimeout'),
maxChannelsPerTeam: mapValueOfType<bool>(json, r'MaxChannelsPerTeam'),
maxNotificationsPerChannel: mapValueOfType<bool>(json, r'MaxNotificationsPerChannel'),
);
}
return null;
}