module TD.Data.SearchMessagesFilter
(SearchMessagesFilter(..)) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data SearchMessagesFilter
= SearchMessagesFilterEmpty
| SearchMessagesFilterAnimation
| SearchMessagesFilterAudio
| SearchMessagesFilterDocument
| SearchMessagesFilterPhoto
| SearchMessagesFilterVideo
| SearchMessagesFilterVoiceNote
| SearchMessagesFilterPhotoAndVideo
| SearchMessagesFilterUrl
| SearchMessagesFilterChatPhoto
| SearchMessagesFilterVideoNote
| SearchMessagesFilterVoiceAndVideoNote
| SearchMessagesFilterMention
| SearchMessagesFilterUnreadMention
| SearchMessagesFilterUnreadReaction
| SearchMessagesFilterFailedToSend
| SearchMessagesFilterPinned
deriving (SearchMessagesFilter -> SearchMessagesFilter -> Bool
(SearchMessagesFilter -> SearchMessagesFilter -> Bool)
-> (SearchMessagesFilter -> SearchMessagesFilter -> Bool)
-> Eq SearchMessagesFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchMessagesFilter -> SearchMessagesFilter -> Bool
== :: SearchMessagesFilter -> SearchMessagesFilter -> Bool
$c/= :: SearchMessagesFilter -> SearchMessagesFilter -> Bool
/= :: SearchMessagesFilter -> SearchMessagesFilter -> Bool
Eq, Int -> SearchMessagesFilter -> ShowS
[SearchMessagesFilter] -> ShowS
SearchMessagesFilter -> String
(Int -> SearchMessagesFilter -> ShowS)
-> (SearchMessagesFilter -> String)
-> ([SearchMessagesFilter] -> ShowS)
-> Show SearchMessagesFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchMessagesFilter -> ShowS
showsPrec :: Int -> SearchMessagesFilter -> ShowS
$cshow :: SearchMessagesFilter -> String
show :: SearchMessagesFilter -> String
$cshowList :: [SearchMessagesFilter] -> ShowS
showList :: [SearchMessagesFilter] -> ShowS
Show)
instance I.ShortShow SearchMessagesFilter where
shortShow :: SearchMessagesFilter -> String
shortShow SearchMessagesFilter
SearchMessagesFilterEmpty
= String
"SearchMessagesFilterEmpty"
shortShow SearchMessagesFilter
SearchMessagesFilterAnimation
= String
"SearchMessagesFilterAnimation"
shortShow SearchMessagesFilter
SearchMessagesFilterAudio
= String
"SearchMessagesFilterAudio"
shortShow SearchMessagesFilter
SearchMessagesFilterDocument
= String
"SearchMessagesFilterDocument"
shortShow SearchMessagesFilter
SearchMessagesFilterPhoto
= String
"SearchMessagesFilterPhoto"
shortShow SearchMessagesFilter
SearchMessagesFilterVideo
= String
"SearchMessagesFilterVideo"
shortShow SearchMessagesFilter
SearchMessagesFilterVoiceNote
= String
"SearchMessagesFilterVoiceNote"
shortShow SearchMessagesFilter
SearchMessagesFilterPhotoAndVideo
= String
"SearchMessagesFilterPhotoAndVideo"
shortShow SearchMessagesFilter
SearchMessagesFilterUrl
= String
"SearchMessagesFilterUrl"
shortShow SearchMessagesFilter
SearchMessagesFilterChatPhoto
= String
"SearchMessagesFilterChatPhoto"
shortShow SearchMessagesFilter
SearchMessagesFilterVideoNote
= String
"SearchMessagesFilterVideoNote"
shortShow SearchMessagesFilter
SearchMessagesFilterVoiceAndVideoNote
= String
"SearchMessagesFilterVoiceAndVideoNote"
shortShow SearchMessagesFilter
SearchMessagesFilterMention
= String
"SearchMessagesFilterMention"
shortShow SearchMessagesFilter
SearchMessagesFilterUnreadMention
= String
"SearchMessagesFilterUnreadMention"
shortShow SearchMessagesFilter
SearchMessagesFilterUnreadReaction
= String
"SearchMessagesFilterUnreadReaction"
shortShow SearchMessagesFilter
SearchMessagesFilterFailedToSend
= String
"SearchMessagesFilterFailedToSend"
shortShow SearchMessagesFilter
SearchMessagesFilterPinned
= String
"SearchMessagesFilterPinned"
instance AT.FromJSON SearchMessagesFilter where
parseJSON :: Value -> Parser SearchMessagesFilter
parseJSON (AT.Object Object
obj) = do
String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String
case String
t of
String
"searchMessagesFilterEmpty" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterEmpty
String
"searchMessagesFilterAnimation" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterAnimation
String
"searchMessagesFilterAudio" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterAudio
String
"searchMessagesFilterDocument" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterDocument
String
"searchMessagesFilterPhoto" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterPhoto
String
"searchMessagesFilterVideo" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterVideo
String
"searchMessagesFilterVoiceNote" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterVoiceNote
String
"searchMessagesFilterPhotoAndVideo" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterPhotoAndVideo
String
"searchMessagesFilterUrl" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterUrl
String
"searchMessagesFilterChatPhoto" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterChatPhoto
String
"searchMessagesFilterVideoNote" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterVideoNote
String
"searchMessagesFilterVoiceAndVideoNote" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterVoiceAndVideoNote
String
"searchMessagesFilterMention" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterMention
String
"searchMessagesFilterUnreadMention" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterUnreadMention
String
"searchMessagesFilterUnreadReaction" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterUnreadReaction
String
"searchMessagesFilterFailedToSend" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterFailedToSend
String
"searchMessagesFilterPinned" -> SearchMessagesFilter -> Parser SearchMessagesFilter
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SearchMessagesFilter
SearchMessagesFilterPinned
String
_ -> Parser SearchMessagesFilter
forall a. Monoid a => a
mempty
parseJSON Value
_ = Parser SearchMessagesFilter
forall a. Monoid a => a
mempty
instance AT.ToJSON SearchMessagesFilter where
toJSON :: SearchMessagesFilter -> Value
toJSON SearchMessagesFilter
SearchMessagesFilterEmpty
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterEmpty"
]
toJSON SearchMessagesFilter
SearchMessagesFilterAnimation
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterAnimation"
]
toJSON SearchMessagesFilter
SearchMessagesFilterAudio
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterAudio"
]
toJSON SearchMessagesFilter
SearchMessagesFilterDocument
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterDocument"
]
toJSON SearchMessagesFilter
SearchMessagesFilterPhoto
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterPhoto"
]
toJSON SearchMessagesFilter
SearchMessagesFilterVideo
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterVideo"
]
toJSON SearchMessagesFilter
SearchMessagesFilterVoiceNote
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterVoiceNote"
]
toJSON SearchMessagesFilter
SearchMessagesFilterPhotoAndVideo
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterPhotoAndVideo"
]
toJSON SearchMessagesFilter
SearchMessagesFilterUrl
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterUrl"
]
toJSON SearchMessagesFilter
SearchMessagesFilterChatPhoto
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterChatPhoto"
]
toJSON SearchMessagesFilter
SearchMessagesFilterVideoNote
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterVideoNote"
]
toJSON SearchMessagesFilter
SearchMessagesFilterVoiceAndVideoNote
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterVoiceAndVideoNote"
]
toJSON SearchMessagesFilter
SearchMessagesFilterMention
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterMention"
]
toJSON SearchMessagesFilter
SearchMessagesFilterUnreadMention
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterUnreadMention"
]
toJSON SearchMessagesFilter
SearchMessagesFilterUnreadReaction
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterUnreadReaction"
]
toJSON SearchMessagesFilter
SearchMessagesFilterFailedToSend
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterFailedToSend"
]
toJSON SearchMessagesFilter
SearchMessagesFilterPinned
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"searchMessagesFilterPinned"
]