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