module TD.Query.GetPassportAuthorizationForm
(GetPassportAuthorizationForm(..)
, defaultGetPassportAuthorizationForm
) 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 GetPassportAuthorizationForm
= GetPassportAuthorizationForm
{ GetPassportAuthorizationForm -> Maybe Int
bot_user_id :: Maybe Int
, GetPassportAuthorizationForm -> Maybe Text
scope :: Maybe T.Text
, GetPassportAuthorizationForm -> Maybe Text
public_key :: Maybe T.Text
, GetPassportAuthorizationForm -> Maybe Text
nonce :: Maybe T.Text
}
deriving (GetPassportAuthorizationForm
-> GetPassportAuthorizationForm -> Bool
(GetPassportAuthorizationForm
-> GetPassportAuthorizationForm -> Bool)
-> (GetPassportAuthorizationForm
-> GetPassportAuthorizationForm -> Bool)
-> Eq GetPassportAuthorizationForm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetPassportAuthorizationForm
-> GetPassportAuthorizationForm -> Bool
== :: GetPassportAuthorizationForm
-> GetPassportAuthorizationForm -> Bool
$c/= :: GetPassportAuthorizationForm
-> GetPassportAuthorizationForm -> Bool
/= :: GetPassportAuthorizationForm
-> GetPassportAuthorizationForm -> Bool
Eq, Int -> GetPassportAuthorizationForm -> ShowS
[GetPassportAuthorizationForm] -> ShowS
GetPassportAuthorizationForm -> String
(Int -> GetPassportAuthorizationForm -> ShowS)
-> (GetPassportAuthorizationForm -> String)
-> ([GetPassportAuthorizationForm] -> ShowS)
-> Show GetPassportAuthorizationForm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetPassportAuthorizationForm -> ShowS
showsPrec :: Int -> GetPassportAuthorizationForm -> ShowS
$cshow :: GetPassportAuthorizationForm -> String
show :: GetPassportAuthorizationForm -> String
$cshowList :: [GetPassportAuthorizationForm] -> ShowS
showList :: [GetPassportAuthorizationForm] -> ShowS
Show)
instance I.ShortShow GetPassportAuthorizationForm where
shortShow :: GetPassportAuthorizationForm -> String
shortShow
GetPassportAuthorizationForm
{ bot_user_id :: GetPassportAuthorizationForm -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, scope :: GetPassportAuthorizationForm -> Maybe Text
scope = Maybe Text
scope_
, public_key :: GetPassportAuthorizationForm -> Maybe Text
public_key = Maybe Text
public_key_
, nonce :: GetPassportAuthorizationForm -> Maybe Text
nonce = Maybe Text
nonce_
}
= String
"GetPassportAuthorizationForm"
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
"scope" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
scope_
, String
"public_key" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
public_key_
, String
"nonce" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
nonce_
]
instance AT.ToJSON GetPassportAuthorizationForm where
toJSON :: GetPassportAuthorizationForm -> Value
toJSON
GetPassportAuthorizationForm
{ bot_user_id :: GetPassportAuthorizationForm -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, scope :: GetPassportAuthorizationForm -> Maybe Text
scope = Maybe Text
scope_
, public_key :: GetPassportAuthorizationForm -> Maybe Text
public_key = Maybe Text
public_key_
, nonce :: GetPassportAuthorizationForm -> Maybe Text
nonce = Maybe Text
nonce_
}
= [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
"getPassportAuthorizationForm"
, 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
"scope" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
scope_
, Key
"public_key" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
public_key_
, Key
"nonce" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
nonce_
]
defaultGetPassportAuthorizationForm :: GetPassportAuthorizationForm
defaultGetPassportAuthorizationForm :: GetPassportAuthorizationForm
defaultGetPassportAuthorizationForm =
GetPassportAuthorizationForm
{ bot_user_id :: Maybe Int
bot_user_id = Maybe Int
forall a. Maybe a
Nothing
, scope :: Maybe Text
scope = Maybe Text
forall a. Maybe a
Nothing
, public_key :: Maybe Text
public_key = Maybe Text
forall a. Maybe a
Nothing
, nonce :: Maybe Text
nonce = Maybe Text
forall a. Maybe a
Nothing
}