maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult allowCalls()?,
- TResult allowChatInvites()?,
- TResult allowFindingByPhoneNumber()?,
- TResult allowPeerToPeerCalls()?,
- TResult allowPrivateVoiceAndVideoNoteMessages()?,
- TResult allowUnpaidMessages()?,
- TResult autosaveGifts()?,
- TResult showBio()?,
- TResult showBirthdate()?,
- TResult showLinkInForwardedMessages()?,
- TResult showPhoneNumber()?,
- TResult showProfileAudio()?,
- TResult showProfilePhoto()?,
- TResult showStatus()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(UserPrivacySettingAllowCalls value)? allowCalls,
TResult Function(UserPrivacySettingAllowChatInvites value)?
allowChatInvites,
TResult Function(UserPrivacySettingAllowFindingByPhoneNumber value)?
allowFindingByPhoneNumber,
TResult Function(UserPrivacySettingAllowPeerToPeerCalls value)?
allowPeerToPeerCalls,
TResult Function(
UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages value,
)?
allowPrivateVoiceAndVideoNoteMessages,
TResult Function(UserPrivacySettingAllowUnpaidMessages value)?
allowUnpaidMessages,
TResult Function(UserPrivacySettingAutosaveGifts value)? autosaveGifts,
TResult Function(UserPrivacySettingShowBio value)? showBio,
TResult Function(UserPrivacySettingShowBirthdate value)? showBirthdate,
TResult Function(UserPrivacySettingShowLinkInForwardedMessages value)?
showLinkInForwardedMessages,
TResult Function(UserPrivacySettingShowPhoneNumber value)? showPhoneNumber,
TResult Function(UserPrivacySettingShowProfileAudio value)?
showProfileAudio,
TResult Function(UserPrivacySettingShowProfilePhoto value)?
showProfilePhoto,
TResult Function(UserPrivacySettingShowStatus value)? showStatus,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case UserPrivacySettingAllowCalls.constructor:
if (allowCalls != null) {
return allowCalls.call(this as UserPrivacySettingAllowCalls);
}
break;
case UserPrivacySettingAllowChatInvites.constructor:
if (allowChatInvites != null) {
return allowChatInvites.call(
this as UserPrivacySettingAllowChatInvites,
);
}
break;
case UserPrivacySettingAllowFindingByPhoneNumber.constructor:
if (allowFindingByPhoneNumber != null) {
return allowFindingByPhoneNumber.call(
this as UserPrivacySettingAllowFindingByPhoneNumber,
);
}
break;
case UserPrivacySettingAllowPeerToPeerCalls.constructor:
if (allowPeerToPeerCalls != null) {
return allowPeerToPeerCalls.call(
this as UserPrivacySettingAllowPeerToPeerCalls,
);
}
break;
case UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages.constructor:
if (allowPrivateVoiceAndVideoNoteMessages != null) {
return allowPrivateVoiceAndVideoNoteMessages.call(
this as UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages,
);
}
break;
case UserPrivacySettingAllowUnpaidMessages.constructor:
if (allowUnpaidMessages != null) {
return allowUnpaidMessages.call(
this as UserPrivacySettingAllowUnpaidMessages,
);
}
break;
case UserPrivacySettingAutosaveGifts.constructor:
if (autosaveGifts != null) {
return autosaveGifts.call(this as UserPrivacySettingAutosaveGifts);
}
break;
case UserPrivacySettingShowBio.constructor:
if (showBio != null) {
return showBio.call(this as UserPrivacySettingShowBio);
}
break;
case UserPrivacySettingShowBirthdate.constructor:
if (showBirthdate != null) {
return showBirthdate.call(this as UserPrivacySettingShowBirthdate);
}
break;
case UserPrivacySettingShowLinkInForwardedMessages.constructor:
if (showLinkInForwardedMessages != null) {
return showLinkInForwardedMessages.call(
this as UserPrivacySettingShowLinkInForwardedMessages,
);
}
break;
case UserPrivacySettingShowPhoneNumber.constructor:
if (showPhoneNumber != null) {
return showPhoneNumber.call(
this as UserPrivacySettingShowPhoneNumber,
);
}
break;
case UserPrivacySettingShowProfileAudio.constructor:
if (showProfileAudio != null) {
return showProfileAudio.call(
this as UserPrivacySettingShowProfileAudio,
);
}
break;
case UserPrivacySettingShowProfilePhoto.constructor:
if (showProfilePhoto != null) {
return showProfilePhoto.call(
this as UserPrivacySettingShowProfilePhoto,
);
}
break;
case UserPrivacySettingShowStatus.constructor:
if (showStatus != null) {
return showStatus.call(this as UserPrivacySettingShowStatus);
}
break;
}
return orElse.call();
}