maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult isInline(
    1. BotSettingIsInline value
    )?,
  2. TResult inlineQueryPlaceholder(
    1. BotSettingInlineQueryPlaceholder value
    )?,
  3. TResult needLocation(
    1. BotSettingNeedLocation value
    )?,
  4. TResult inlineFeedback(
    1. BotSettingInlineFeedback value
    )?,
  5. TResult canJoinGroups(
    1. BotSettingCanJoinGroups value
    )?,
  6. TResult canReadAllGroupMessages(
    1. BotSettingCanReadAllGroupMessages value
    )?,
  7. TResult canConnectToBusiness(
    1. BotSettingCanConnectToBusiness value
    )?,
  8. TResult canManageBots(
    1. BotSettingCanManageBots value
    )?,
  9. TResult supportsGuestQueries(
    1. BotSettingSupportsGuestQueries value
    )?,
  10. TResult isGuard(
    1. BotSettingIsGuard value
    )?,
  11. TResult hasTopics(
    1. BotSettingHasTopics value
    )?,
  12. TResult allowsUsersToCreateTopics(
    1. BotSettingAllowsUsersToCreateTopics value
    )?,
  13. TResult hasTopicSidebar(
    1. BotSettingHasTopicSidebar value
    )?,
  14. TResult canCommunicateWithBots(
    1. BotSettingCanCommunicateWithBots value
    )?,
  15. TResult callbackQueryMode(
    1. BotSettingCallbackQueryMode value
    )?,
  16. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(BotSettingIsInline value)? isInline,
  TResult Function(BotSettingInlineQueryPlaceholder value)?
      inlineQueryPlaceholder,
  TResult Function(BotSettingNeedLocation value)? needLocation,
  TResult Function(BotSettingInlineFeedback value)? inlineFeedback,
  TResult Function(BotSettingCanJoinGroups value)? canJoinGroups,
  TResult Function(BotSettingCanReadAllGroupMessages value)?
      canReadAllGroupMessages,
  TResult Function(BotSettingCanConnectToBusiness value)?
      canConnectToBusiness,
  TResult Function(BotSettingCanManageBots value)? canManageBots,
  TResult Function(BotSettingSupportsGuestQueries value)?
      supportsGuestQueries,
  TResult Function(BotSettingIsGuard value)? isGuard,
  TResult Function(BotSettingHasTopics value)? hasTopics,
  TResult Function(BotSettingAllowsUsersToCreateTopics value)?
      allowsUsersToCreateTopics,
  TResult Function(BotSettingHasTopicSidebar value)? hasTopicSidebar,
  TResult Function(BotSettingCanCommunicateWithBots value)?
      canCommunicateWithBots,
  TResult Function(BotSettingCallbackQueryMode value)? callbackQueryMode,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case BotSettingIsInline.constructor:
      if (isInline != null) {
        return isInline.call(this as BotSettingIsInline);
      }
      break;
    case BotSettingInlineQueryPlaceholder.constructor:
      if (inlineQueryPlaceholder != null) {
        return inlineQueryPlaceholder
            .call(this as BotSettingInlineQueryPlaceholder);
      }
      break;
    case BotSettingNeedLocation.constructor:
      if (needLocation != null) {
        return needLocation.call(this as BotSettingNeedLocation);
      }
      break;
    case BotSettingInlineFeedback.constructor:
      if (inlineFeedback != null) {
        return inlineFeedback.call(this as BotSettingInlineFeedback);
      }
      break;
    case BotSettingCanJoinGroups.constructor:
      if (canJoinGroups != null) {
        return canJoinGroups.call(this as BotSettingCanJoinGroups);
      }
      break;
    case BotSettingCanReadAllGroupMessages.constructor:
      if (canReadAllGroupMessages != null) {
        return canReadAllGroupMessages
            .call(this as BotSettingCanReadAllGroupMessages);
      }
      break;
    case BotSettingCanConnectToBusiness.constructor:
      if (canConnectToBusiness != null) {
        return canConnectToBusiness
            .call(this as BotSettingCanConnectToBusiness);
      }
      break;
    case BotSettingCanManageBots.constructor:
      if (canManageBots != null) {
        return canManageBots.call(this as BotSettingCanManageBots);
      }
      break;
    case BotSettingSupportsGuestQueries.constructor:
      if (supportsGuestQueries != null) {
        return supportsGuestQueries
            .call(this as BotSettingSupportsGuestQueries);
      }
      break;
    case BotSettingIsGuard.constructor:
      if (isGuard != null) {
        return isGuard.call(this as BotSettingIsGuard);
      }
      break;
    case BotSettingHasTopics.constructor:
      if (hasTopics != null) {
        return hasTopics.call(this as BotSettingHasTopics);
      }
      break;
    case BotSettingAllowsUsersToCreateTopics.constructor:
      if (allowsUsersToCreateTopics != null) {
        return allowsUsersToCreateTopics
            .call(this as BotSettingAllowsUsersToCreateTopics);
      }
      break;
    case BotSettingHasTopicSidebar.constructor:
      if (hasTopicSidebar != null) {
        return hasTopicSidebar.call(this as BotSettingHasTopicSidebar);
      }
      break;
    case BotSettingCanCommunicateWithBots.constructor:
      if (canCommunicateWithBots != null) {
        return canCommunicateWithBots
            .call(this as BotSettingCanCommunicateWithBots);
      }
      break;
    case BotSettingCallbackQueryMode.constructor:
      if (callbackQueryMode != null) {
        return callbackQueryMode.call(this as BotSettingCallbackQueryMode);
      }
      break;
  }
  return orElse.call();
}