module TD.Query.GetWebAppLinkUrl
(GetWebAppLinkUrl(..)
, defaultGetWebAppLinkUrl
) 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 GetWebAppLinkUrl
= GetWebAppLinkUrl
{ GetWebAppLinkUrl -> Maybe Int
chat_id :: Maybe Int
, GetWebAppLinkUrl -> Maybe Int
bot_user_id :: Maybe Int
, GetWebAppLinkUrl -> Maybe Text
web_app_short_name :: Maybe T.Text
, GetWebAppLinkUrl -> Maybe Text
start_parameter :: Maybe T.Text
, GetWebAppLinkUrl -> Maybe Bool
allow_write_access :: Maybe Bool
, GetWebAppLinkUrl -> Maybe WebAppOpenParameters
parameters :: Maybe WebAppOpenParameters.WebAppOpenParameters
}
deriving (GetWebAppLinkUrl -> GetWebAppLinkUrl -> Bool
(GetWebAppLinkUrl -> GetWebAppLinkUrl -> Bool)
-> (GetWebAppLinkUrl -> GetWebAppLinkUrl -> Bool)
-> Eq GetWebAppLinkUrl
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetWebAppLinkUrl -> GetWebAppLinkUrl -> Bool
== :: GetWebAppLinkUrl -> GetWebAppLinkUrl -> Bool
$c/= :: GetWebAppLinkUrl -> GetWebAppLinkUrl -> Bool
/= :: GetWebAppLinkUrl -> GetWebAppLinkUrl -> Bool
Eq, Int -> GetWebAppLinkUrl -> ShowS
[GetWebAppLinkUrl] -> ShowS
GetWebAppLinkUrl -> String
(Int -> GetWebAppLinkUrl -> ShowS)
-> (GetWebAppLinkUrl -> String)
-> ([GetWebAppLinkUrl] -> ShowS)
-> Show GetWebAppLinkUrl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetWebAppLinkUrl -> ShowS
showsPrec :: Int -> GetWebAppLinkUrl -> ShowS
$cshow :: GetWebAppLinkUrl -> String
show :: GetWebAppLinkUrl -> String
$cshowList :: [GetWebAppLinkUrl] -> ShowS
showList :: [GetWebAppLinkUrl] -> ShowS
Show)
instance I.ShortShow GetWebAppLinkUrl where
shortShow :: GetWebAppLinkUrl -> String
shortShow
GetWebAppLinkUrl
{ chat_id :: GetWebAppLinkUrl -> Maybe Int
chat_id = Maybe Int
chat_id_
, bot_user_id :: GetWebAppLinkUrl -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, web_app_short_name :: GetWebAppLinkUrl -> Maybe Text
web_app_short_name = Maybe Text
web_app_short_name_
, start_parameter :: GetWebAppLinkUrl -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, allow_write_access :: GetWebAppLinkUrl -> Maybe Bool
allow_write_access = Maybe Bool
allow_write_access_
, parameters :: GetWebAppLinkUrl -> Maybe WebAppOpenParameters
parameters = Maybe WebAppOpenParameters
parameters_
}
= String
"GetWebAppLinkUrl"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
bot_user_id_
, String
"web_app_short_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
web_app_short_name_
, String
"start_parameter" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
start_parameter_
, String
"allow_write_access" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
allow_write_access_
, String
"parameters" String -> Maybe WebAppOpenParameters -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe WebAppOpenParameters
parameters_
]
instance AT.ToJSON GetWebAppLinkUrl where
toJSON :: GetWebAppLinkUrl -> Value
toJSON
GetWebAppLinkUrl
{ chat_id :: GetWebAppLinkUrl -> Maybe Int
chat_id = Maybe Int
chat_id_
, bot_user_id :: GetWebAppLinkUrl -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, web_app_short_name :: GetWebAppLinkUrl -> Maybe Text
web_app_short_name = Maybe Text
web_app_short_name_
, start_parameter :: GetWebAppLinkUrl -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, allow_write_access :: GetWebAppLinkUrl -> Maybe Bool
allow_write_access = Maybe Bool
allow_write_access_
, parameters :: GetWebAppLinkUrl -> 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
"getWebAppLinkUrl"
, Key
"chat_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
chat_id_
, 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
"web_app_short_name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
web_app_short_name_
, Key
"start_parameter" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
start_parameter_
, 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_
, 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_
]
defaultGetWebAppLinkUrl :: GetWebAppLinkUrl
defaultGetWebAppLinkUrl :: GetWebAppLinkUrl
defaultGetWebAppLinkUrl =
GetWebAppLinkUrl
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, bot_user_id :: Maybe Int
bot_user_id = Maybe Int
forall a. Maybe a
Nothing
, web_app_short_name :: Maybe Text
web_app_short_name = Maybe Text
forall a. Maybe a
Nothing
, start_parameter :: Maybe Text
start_parameter = Maybe Text
forall a. Maybe a
Nothing
, allow_write_access :: Maybe Bool
allow_write_access = Maybe Bool
forall a. Maybe a
Nothing
, parameters :: Maybe WebAppOpenParameters
parameters = Maybe WebAppOpenParameters
forall a. Maybe a
Nothing
}