maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult showStatus(
    1. UserPrivacySettingShowStatus value
    )?,
  2. TResult showProfilePhoto(
    1. UserPrivacySettingShowProfilePhoto value
    )?,
  3. TResult showLinkInForwardedMessages(
    1. UserPrivacySettingShowLinkInForwardedMessages value
    )?,
  4. TResult showPhoneNumber(
    1. UserPrivacySettingShowPhoneNumber value
    )?,
  5. TResult showBio(
    1. UserPrivacySettingShowBio value
    )?,
  6. TResult showBirthdate(
    1. UserPrivacySettingShowBirthdate value
    )?,
  7. TResult showProfileAudio(
    1. UserPrivacySettingShowProfileAudio value
    )?,
  8. TResult allowChatInvites(
    1. UserPrivacySettingAllowChatInvites value
    )?,
  9. TResult allowCalls(
    1. UserPrivacySettingAllowCalls value
    )?,
  10. TResult allowPeerToPeerCalls(
    1. UserPrivacySettingAllowPeerToPeerCalls value
    )?,
  11. TResult allowFindingByPhoneNumber(
    1. UserPrivacySettingAllowFindingByPhoneNumber value
    )?,
  12. TResult allowPrivateVoiceAndVideoNoteMessages(
    1. UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages value
    )?,
  13. TResult autosaveGifts(
    1. UserPrivacySettingAutosaveGifts value
    )?,
  14. TResult allowUnpaidMessages(
    1. UserPrivacySettingAllowUnpaidMessages value
    )?,
  15. required TResult orElse(),
})

Implementation

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