| | | 1 | | namespace TeleFlow.Telegram.Internal.Handlers; |
| | | 2 | | |
| | | 3 | | internal sealed class TelegramFilterDescriptor |
| | | 4 | | { |
| | | 5 | | public TelegramFilterDescriptor( |
| | | 6 | | TelegramFilterKind kind, |
| | | 7 | | IReadOnlyList<string> stringValues, |
| | | 8 | | IReadOnlyList<long> longValues) |
| | | 9 | | { |
| | 587 | 10 | | ArgumentNullException.ThrowIfNull(stringValues); |
| | 587 | 11 | | ArgumentNullException.ThrowIfNull(longValues); |
| | | 12 | | |
| | 587 | 13 | | Kind = kind; |
| | | 14 | | StringValues = stringValues; |
| | | 15 | | LongValues = longValues; |
| | 587 | 16 | | } |
| | | 17 | | |
| | | 18 | | public TelegramFilterDescriptor(Type customFilterType) |
| | | 19 | | { |
| | 66 | 20 | | ArgumentNullException.ThrowIfNull(customFilterType); |
| | | 21 | | |
| | | 22 | | CustomFilterType = customFilterType; |
| | | 23 | | StringValues = []; |
| | | 24 | | LongValues = []; |
| | 66 | 25 | | } |
| | | 26 | | |
| | | 27 | | public TelegramFilterDescriptor( |
| | | 28 | | Type customFilterType, |
| | | 29 | | Type customFilterContextType) |
| | 25 | 30 | | : this(customFilterType) |
| | | 31 | | { |
| | 25 | 32 | | ArgumentNullException.ThrowIfNull(customFilterContextType); |
| | | 33 | | |
| | | 34 | | CustomFilterContextType = customFilterContextType; |
| | 25 | 35 | | } |
| | | 36 | | |
| | | 37 | | public TelegramFilterDescriptor( |
| | | 38 | | Type customFilterType, |
| | | 39 | | Attribute customFilterAttribute) |
| | 1 | 40 | | : this(customFilterType) |
| | | 41 | | { |
| | 1 | 42 | | ArgumentNullException.ThrowIfNull(customFilterAttribute); |
| | | 43 | | |
| | | 44 | | CustomFilterAttribute = customFilterAttribute; |
| | 1 | 45 | | } |
| | | 46 | | |
| | | 47 | | public TelegramFilterDescriptor( |
| | | 48 | | Type customFilterType, |
| | | 49 | | Type customFilterContextType, |
| | | 50 | | Attribute customFilterAttribute) |
| | 25 | 51 | | : this(customFilterType, customFilterContextType) |
| | | 52 | | { |
| | 25 | 53 | | ArgumentNullException.ThrowIfNull(customFilterAttribute); |
| | | 54 | | |
| | | 55 | | CustomFilterAttribute = customFilterAttribute; |
| | 25 | 56 | | } |
| | | 57 | | |
| | | 58 | | public TelegramFilterKind? Kind { get; } |
| | | 59 | | |
| | | 60 | | public Type? CustomFilterType { get; } |
| | | 61 | | |
| | | 62 | | public Type? CustomFilterContextType { get; } |
| | | 63 | | |
| | | 64 | | public Attribute? CustomFilterAttribute { get; } |
| | | 65 | | |
| | | 66 | | public IReadOnlyList<string> StringValues { get; } |
| | | 67 | | |
| | | 68 | | public IReadOnlyList<long> LongValues { get; } |
| | | 69 | | } |