fromJson static method
Returns a new MmEnvironmentConfigEmailSettings instance and imports its values from
value
if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static MmEnvironmentConfigEmailSettings? 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 "MmEnvironmentConfigEmailSettings[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "MmEnvironmentConfigEmailSettings[$key]" has a null value in JSON.');
});
return true;
}());
return MmEnvironmentConfigEmailSettings(
enableSignUpWithEmail: mapValueOfType<bool>(json, r'EnableSignUpWithEmail'),
enableSignInWithEmail: mapValueOfType<bool>(json, r'EnableSignInWithEmail'),
enableSignInWithUsername: mapValueOfType<bool>(json, r'EnableSignInWithUsername'),
sendEmailNotifications: mapValueOfType<bool>(json, r'SendEmailNotifications'),
requireEmailVerification: mapValueOfType<bool>(json, r'RequireEmailVerification'),
feedbackName: mapValueOfType<bool>(json, r'FeedbackName'),
feedbackEmail: mapValueOfType<bool>(json, r'FeedbackEmail'),
feedbackOrganization: mapValueOfType<bool>(json, r'FeedbackOrganization'),
sMTPUsername: mapValueOfType<bool>(json, r'SMTPUsername'),
sMTPPassword: mapValueOfType<bool>(json, r'SMTPPassword'),
sMTPServer: mapValueOfType<bool>(json, r'SMTPServer'),
sMTPPort: mapValueOfType<bool>(json, r'SMTPPort'),
connectionSecurity: mapValueOfType<bool>(json, r'ConnectionSecurity'),
inviteSalt: mapValueOfType<bool>(json, r'InviteSalt'),
passwordResetSalt: mapValueOfType<bool>(json, r'PasswordResetSalt'),
sendPushNotifications: mapValueOfType<bool>(json, r'SendPushNotifications'),
pushNotificationServer: mapValueOfType<bool>(json, r'PushNotificationServer'),
pushNotificationContents: mapValueOfType<bool>(json, r'PushNotificationContents'),
enableEmailBatching: mapValueOfType<bool>(json, r'EnableEmailBatching'),
emailBatchingBufferSize: mapValueOfType<bool>(json, r'EmailBatchingBufferSize'),
emailBatchingInterval: mapValueOfType<bool>(json, r'EmailBatchingInterval'),
);
}
return null;
}