module TD.Query.GetExternalLinkInfo
(GetExternalLinkInfo(..)
) 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 GetExternalLinkInfo
= GetExternalLinkInfo
{ GetExternalLinkInfo -> Maybe Text
link :: Maybe T.Text
}
deriving (GetExternalLinkInfo -> GetExternalLinkInfo -> Bool
(GetExternalLinkInfo -> GetExternalLinkInfo -> Bool)
-> (GetExternalLinkInfo -> GetExternalLinkInfo -> Bool)
-> Eq GetExternalLinkInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetExternalLinkInfo -> GetExternalLinkInfo -> Bool
== :: GetExternalLinkInfo -> GetExternalLinkInfo -> Bool
$c/= :: GetExternalLinkInfo -> GetExternalLinkInfo -> Bool
/= :: GetExternalLinkInfo -> GetExternalLinkInfo -> Bool
Eq, Int -> GetExternalLinkInfo -> ShowS
[GetExternalLinkInfo] -> ShowS
GetExternalLinkInfo -> String
(Int -> GetExternalLinkInfo -> ShowS)
-> (GetExternalLinkInfo -> String)
-> ([GetExternalLinkInfo] -> ShowS)
-> Show GetExternalLinkInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetExternalLinkInfo -> ShowS
showsPrec :: Int -> GetExternalLinkInfo -> ShowS
$cshow :: GetExternalLinkInfo -> String
show :: GetExternalLinkInfo -> String
$cshowList :: [GetExternalLinkInfo] -> ShowS
showList :: [GetExternalLinkInfo] -> ShowS
Show)
instance I.ShortShow GetExternalLinkInfo where
shortShow :: GetExternalLinkInfo -> String
shortShow
GetExternalLinkInfo
{ link :: GetExternalLinkInfo -> Maybe Text
link = Maybe Text
link_
}
= String
"GetExternalLinkInfo"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"link" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
link_
]
instance AT.ToJSON GetExternalLinkInfo where
toJSON :: GetExternalLinkInfo -> Value
toJSON
GetExternalLinkInfo
{ link :: GetExternalLinkInfo -> Maybe Text
link = Maybe Text
link_
}
= [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
"getExternalLinkInfo"
, Key
"link" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
link_
]