maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult allowAll()?,
- TResult allowBots()?,
- TResult allowChatMembers()?,
- TResult allowContacts()?,
- TResult allowPremiumUsers()?,
- TResult allowUsers()?,
- TResult restrictAll()?,
- TResult restrictBots()?,
- TResult restrictChatMembers()?,
- TResult restrictContacts()?,
- TResult restrictUsers()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(UserPrivacySettingRuleAllowAll value)? allowAll,
TResult Function(UserPrivacySettingRuleAllowBots value)? allowBots,
TResult Function(UserPrivacySettingRuleAllowChatMembers value)?
allowChatMembers,
TResult Function(UserPrivacySettingRuleAllowContacts value)? allowContacts,
TResult Function(UserPrivacySettingRuleAllowPremiumUsers value)?
allowPremiumUsers,
TResult Function(UserPrivacySettingRuleAllowUsers value)? allowUsers,
TResult Function(UserPrivacySettingRuleRestrictAll value)? restrictAll,
TResult Function(UserPrivacySettingRuleRestrictBots value)? restrictBots,
TResult Function(UserPrivacySettingRuleRestrictChatMembers value)?
restrictChatMembers,
TResult Function(UserPrivacySettingRuleRestrictContacts value)?
restrictContacts,
TResult Function(UserPrivacySettingRuleRestrictUsers value)? restrictUsers,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case UserPrivacySettingRuleAllowAll.constructor:
if (allowAll != null) {
return allowAll.call(this as UserPrivacySettingRuleAllowAll);
}
break;
case UserPrivacySettingRuleAllowBots.constructor:
if (allowBots != null) {
return allowBots.call(this as UserPrivacySettingRuleAllowBots);
}
break;
case UserPrivacySettingRuleAllowChatMembers.constructor:
if (allowChatMembers != null) {
return allowChatMembers.call(
this as UserPrivacySettingRuleAllowChatMembers,
);
}
break;
case UserPrivacySettingRuleAllowContacts.constructor:
if (allowContacts != null) {
return allowContacts.call(
this as UserPrivacySettingRuleAllowContacts,
);
}
break;
case UserPrivacySettingRuleAllowPremiumUsers.constructor:
if (allowPremiumUsers != null) {
return allowPremiumUsers.call(
this as UserPrivacySettingRuleAllowPremiumUsers,
);
}
break;
case UserPrivacySettingRuleAllowUsers.constructor:
if (allowUsers != null) {
return allowUsers.call(this as UserPrivacySettingRuleAllowUsers);
}
break;
case UserPrivacySettingRuleRestrictAll.constructor:
if (restrictAll != null) {
return restrictAll.call(this as UserPrivacySettingRuleRestrictAll);
}
break;
case UserPrivacySettingRuleRestrictBots.constructor:
if (restrictBots != null) {
return restrictBots.call(this as UserPrivacySettingRuleRestrictBots);
}
break;
case UserPrivacySettingRuleRestrictChatMembers.constructor:
if (restrictChatMembers != null) {
return restrictChatMembers.call(
this as UserPrivacySettingRuleRestrictChatMembers,
);
}
break;
case UserPrivacySettingRuleRestrictContacts.constructor:
if (restrictContacts != null) {
return restrictContacts.call(
this as UserPrivacySettingRuleRestrictContacts,
);
}
break;
case UserPrivacySettingRuleRestrictUsers.constructor:
if (restrictUsers != null) {
return restrictUsers.call(
this as UserPrivacySettingRuleRestrictUsers,
);
}
break;
}
return orElse.call();
}