module TD.Query.GetMessageLinkInfo
(GetMessageLinkInfo(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
data GetMessageLinkInfo
= GetMessageLinkInfo
{ GetMessageLinkInfo -> Maybe Text
url :: Maybe T.Text
}
deriving (GetMessageLinkInfo -> GetMessageLinkInfo -> Bool
(GetMessageLinkInfo -> GetMessageLinkInfo -> Bool)
-> (GetMessageLinkInfo -> GetMessageLinkInfo -> Bool)
-> Eq GetMessageLinkInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetMessageLinkInfo -> GetMessageLinkInfo -> Bool
== :: GetMessageLinkInfo -> GetMessageLinkInfo -> Bool
$c/= :: GetMessageLinkInfo -> GetMessageLinkInfo -> Bool
/= :: GetMessageLinkInfo -> GetMessageLinkInfo -> Bool
Eq, Int -> GetMessageLinkInfo -> ShowS
[GetMessageLinkInfo] -> ShowS
GetMessageLinkInfo -> String
(Int -> GetMessageLinkInfo -> ShowS)
-> (GetMessageLinkInfo -> String)
-> ([GetMessageLinkInfo] -> ShowS)
-> Show GetMessageLinkInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetMessageLinkInfo -> ShowS
showsPrec :: Int -> GetMessageLinkInfo -> ShowS
$cshow :: GetMessageLinkInfo -> String
show :: GetMessageLinkInfo -> String
$cshowList :: [GetMessageLinkInfo] -> ShowS
showList :: [GetMessageLinkInfo] -> ShowS
Show)
instance I.ShortShow GetMessageLinkInfo where
shortShow :: GetMessageLinkInfo -> String
shortShow
GetMessageLinkInfo
{ url :: GetMessageLinkInfo -> Maybe Text
url = Maybe Text
url_
}
= String
"GetMessageLinkInfo"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
]
instance AT.ToJSON GetMessageLinkInfo where
toJSON :: GetMessageLinkInfo -> Value
toJSON
GetMessageLinkInfo
{ url :: GetMessageLinkInfo -> Maybe Text
url = Maybe Text
url_
}
= [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
"getMessageLinkInfo"
, Key
"url" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
]