map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult allowAll(
    1. UserPrivacySettingRuleAllowAll value
    ),
  2. required TResult allowBots(
    1. UserPrivacySettingRuleAllowBots value
    ),
  3. required TResult allowChatMembers(
    1. UserPrivacySettingRuleAllowChatMembers value
    ),
  4. required TResult allowContacts(
    1. UserPrivacySettingRuleAllowContacts value
    ),
  5. required TResult allowPremiumUsers(
    1. UserPrivacySettingRuleAllowPremiumUsers value
    ),
  6. required TResult allowUsers(
    1. UserPrivacySettingRuleAllowUsers value
    ),
  7. required TResult restrictAll(
    1. UserPrivacySettingRuleRestrictAll value
    ),
  8. required TResult restrictBots(
    1. UserPrivacySettingRuleRestrictBots value
    ),
  9. required TResult restrictChatMembers(
    1. UserPrivacySettingRuleRestrictChatMembers value
    ),
  10. required TResult restrictContacts(
    1. UserPrivacySettingRuleRestrictContacts value
    ),
  11. required TResult restrictUsers(
    1. UserPrivacySettingRuleRestrictUsers value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(UserPrivacySettingRuleAllowAll value) allowAll,
  required TResult Function(UserPrivacySettingRuleAllowBots value) allowBots,
  required TResult Function(UserPrivacySettingRuleAllowChatMembers value)
  allowChatMembers,
  required TResult Function(UserPrivacySettingRuleAllowContacts value)
  allowContacts,
  required TResult Function(UserPrivacySettingRuleAllowPremiumUsers value)
  allowPremiumUsers,
  required TResult Function(UserPrivacySettingRuleAllowUsers value)
  allowUsers,
  required TResult Function(UserPrivacySettingRuleRestrictAll value)
  restrictAll,
  required TResult Function(UserPrivacySettingRuleRestrictBots value)
  restrictBots,
  required TResult Function(UserPrivacySettingRuleRestrictChatMembers value)
  restrictChatMembers,
  required TResult Function(UserPrivacySettingRuleRestrictContacts value)
  restrictContacts,
  required TResult Function(UserPrivacySettingRuleRestrictUsers value)
  restrictUsers,
}) {
  switch (getConstructor()) {
    case UserPrivacySettingRuleAllowAll.constructor:
      return allowAll.call(this as UserPrivacySettingRuleAllowAll);
    case UserPrivacySettingRuleAllowBots.constructor:
      return allowBots.call(this as UserPrivacySettingRuleAllowBots);
    case UserPrivacySettingRuleAllowChatMembers.constructor:
      return allowChatMembers.call(
        this as UserPrivacySettingRuleAllowChatMembers,
      );
    case UserPrivacySettingRuleAllowContacts.constructor:
      return allowContacts.call(this as UserPrivacySettingRuleAllowContacts);
    case UserPrivacySettingRuleAllowPremiumUsers.constructor:
      return allowPremiumUsers.call(
        this as UserPrivacySettingRuleAllowPremiumUsers,
      );
    case UserPrivacySettingRuleAllowUsers.constructor:
      return allowUsers.call(this as UserPrivacySettingRuleAllowUsers);
    case UserPrivacySettingRuleRestrictAll.constructor:
      return restrictAll.call(this as UserPrivacySettingRuleRestrictAll);
    case UserPrivacySettingRuleRestrictBots.constructor:
      return restrictBots.call(this as UserPrivacySettingRuleRestrictBots);
    case UserPrivacySettingRuleRestrictChatMembers.constructor:
      return restrictChatMembers.call(
        this as UserPrivacySettingRuleRestrictChatMembers,
      );
    case UserPrivacySettingRuleRestrictContacts.constructor:
      return restrictContacts.call(
        this as UserPrivacySettingRuleRestrictContacts,
      );
    case UserPrivacySettingRuleRestrictUsers.constructor:
      return restrictUsers.call(this as UserPrivacySettingRuleRestrictUsers);
  }
  throw StateError('not handled type Generator');
}