ChatBoostSourcePatterns extension

Adds pattern-matching-related methods to ChatBoostSource.

on

Methods

map<TResult extends Object?>({required TResult premium(ChatBoostSourcePremium value), required TResult giftCode(ChatBoostSourceGiftCode value), required TResult giveaway(ChatBoostSourceGiveaway value)}) → TResult

Available on ChatBoostSource, provided by the ChatBoostSourcePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? premium(ChatBoostSourcePremium value)?, TResult? giftCode(ChatBoostSourceGiftCode value)?, TResult? giveaway(ChatBoostSourceGiveaway value)?}) → TResult?

Available on ChatBoostSource, provided by the ChatBoostSourcePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult premium(ChatBoostSourcePremium value)?, TResult giftCode(ChatBoostSourceGiftCode value)?, TResult giveaway(ChatBoostSourceGiveaway value)?, required TResult orElse()}) → TResult

Available on ChatBoostSource, provided by the ChatBoostSourcePatterns extension

A variant of map that fallback to returning orElse.