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