module TD.Query.SetProfilePhoto
(SetProfilePhoto(..)
, defaultSetProfilePhoto
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.InputChatPhoto as InputChatPhoto
data SetProfilePhoto
= SetProfilePhoto
{ SetProfilePhoto -> Maybe InputChatPhoto
photo :: Maybe InputChatPhoto.InputChatPhoto
, SetProfilePhoto -> Maybe Bool
is_public :: Maybe Bool
}
deriving (SetProfilePhoto -> SetProfilePhoto -> Bool
(SetProfilePhoto -> SetProfilePhoto -> Bool)
-> (SetProfilePhoto -> SetProfilePhoto -> Bool)
-> Eq SetProfilePhoto
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetProfilePhoto -> SetProfilePhoto -> Bool
== :: SetProfilePhoto -> SetProfilePhoto -> Bool
$c/= :: SetProfilePhoto -> SetProfilePhoto -> Bool
/= :: SetProfilePhoto -> SetProfilePhoto -> Bool
Eq, Int -> SetProfilePhoto -> ShowS
[SetProfilePhoto] -> ShowS
SetProfilePhoto -> String
(Int -> SetProfilePhoto -> ShowS)
-> (SetProfilePhoto -> String)
-> ([SetProfilePhoto] -> ShowS)
-> Show SetProfilePhoto
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetProfilePhoto -> ShowS
showsPrec :: Int -> SetProfilePhoto -> ShowS
$cshow :: SetProfilePhoto -> String
show :: SetProfilePhoto -> String
$cshowList :: [SetProfilePhoto] -> ShowS
showList :: [SetProfilePhoto] -> ShowS
Show)
instance I.ShortShow SetProfilePhoto where
shortShow :: SetProfilePhoto -> String
shortShow
SetProfilePhoto
{ photo :: SetProfilePhoto -> Maybe InputChatPhoto
photo = Maybe InputChatPhoto
photo_
, is_public :: SetProfilePhoto -> Maybe Bool
is_public = Maybe Bool
is_public_
}
= String
"SetProfilePhoto"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"photo" String -> Maybe InputChatPhoto -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputChatPhoto
photo_
, String
"is_public" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_public_
]
instance AT.ToJSON SetProfilePhoto where
toJSON :: SetProfilePhoto -> Value
toJSON
SetProfilePhoto
{ photo :: SetProfilePhoto -> Maybe InputChatPhoto
photo = Maybe InputChatPhoto
photo_
, is_public :: SetProfilePhoto -> Maybe Bool
is_public = Maybe Bool
is_public_
}
= [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
"setProfilePhoto"
, Key
"photo" Key -> Maybe InputChatPhoto -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputChatPhoto
photo_
, Key
"is_public" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_public_
]
defaultSetProfilePhoto :: SetProfilePhoto
defaultSetProfilePhoto :: SetProfilePhoto
defaultSetProfilePhoto =
SetProfilePhoto
{ photo :: Maybe InputChatPhoto
photo = Maybe InputChatPhoto
forall a. Maybe a
Nothing
, is_public :: Maybe Bool
is_public = Maybe Bool
forall a. Maybe a
Nothing
}