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