fromJson static method
Inherited by: UserPrivacySettingRuleAllowAll UserPrivacySettingRuleAllowBots UserPrivacySettingRuleAllowChatMembers UserPrivacySettingRuleAllowContacts UserPrivacySettingRuleAllowPremiumUsers UserPrivacySettingRuleAllowUsers UserPrivacySettingRuleRestrictAll UserPrivacySettingRuleRestrictBots UserPrivacySettingRuleRestrictChatMembers UserPrivacySettingRuleRestrictContacts UserPrivacySettingRuleRestrictUsers
Implementation
static UserPrivacySettingRule? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
switch (json['@type']) {
case UserPrivacySettingRuleAllowAll.constructor:
return UserPrivacySettingRuleAllowAll.fromJson(json);
case UserPrivacySettingRuleAllowBots.constructor:
return UserPrivacySettingRuleAllowBots.fromJson(json);
case UserPrivacySettingRuleAllowChatMembers.constructor:
return UserPrivacySettingRuleAllowChatMembers.fromJson(json);
case UserPrivacySettingRuleAllowContacts.constructor:
return UserPrivacySettingRuleAllowContacts.fromJson(json);
case UserPrivacySettingRuleAllowPremiumUsers.constructor:
return UserPrivacySettingRuleAllowPremiumUsers.fromJson(json);
case UserPrivacySettingRuleAllowUsers.constructor:
return UserPrivacySettingRuleAllowUsers.fromJson(json);
case UserPrivacySettingRuleRestrictAll.constructor:
return UserPrivacySettingRuleRestrictAll.fromJson(json);
case UserPrivacySettingRuleRestrictBots.constructor:
return UserPrivacySettingRuleRestrictBots.fromJson(json);
case UserPrivacySettingRuleRestrictChatMembers.constructor:
return UserPrivacySettingRuleRestrictChatMembers.fromJson(json);
case UserPrivacySettingRuleRestrictContacts.constructor:
return UserPrivacySettingRuleRestrictContacts.fromJson(json);
case UserPrivacySettingRuleRestrictUsers.constructor:
return UserPrivacySettingRuleRestrictUsers.fromJson(json);
default:
return null;
}
}