module TD.Query.SetProfileAccentColor
(SetProfileAccentColor(..)
, defaultSetProfileAccentColor
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data SetProfileAccentColor
= SetProfileAccentColor
{ SetProfileAccentColor -> Maybe Int
profile_accent_color_id :: Maybe Int
, SetProfileAccentColor -> Maybe Int
profile_background_custom_emoji_id :: Maybe Int
}
deriving (SetProfileAccentColor -> SetProfileAccentColor -> Bool
(SetProfileAccentColor -> SetProfileAccentColor -> Bool)
-> (SetProfileAccentColor -> SetProfileAccentColor -> Bool)
-> Eq SetProfileAccentColor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetProfileAccentColor -> SetProfileAccentColor -> Bool
== :: SetProfileAccentColor -> SetProfileAccentColor -> Bool
$c/= :: SetProfileAccentColor -> SetProfileAccentColor -> Bool
/= :: SetProfileAccentColor -> SetProfileAccentColor -> Bool
Eq, Int -> SetProfileAccentColor -> ShowS
[SetProfileAccentColor] -> ShowS
SetProfileAccentColor -> String
(Int -> SetProfileAccentColor -> ShowS)
-> (SetProfileAccentColor -> String)
-> ([SetProfileAccentColor] -> ShowS)
-> Show SetProfileAccentColor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetProfileAccentColor -> ShowS
showsPrec :: Int -> SetProfileAccentColor -> ShowS
$cshow :: SetProfileAccentColor -> String
show :: SetProfileAccentColor -> String
$cshowList :: [SetProfileAccentColor] -> ShowS
showList :: [SetProfileAccentColor] -> ShowS
Show)
instance I.ShortShow SetProfileAccentColor where
shortShow :: SetProfileAccentColor -> String
shortShow
SetProfileAccentColor
{ profile_accent_color_id :: SetProfileAccentColor -> Maybe Int
profile_accent_color_id = Maybe Int
profile_accent_color_id_
, profile_background_custom_emoji_id :: SetProfileAccentColor -> Maybe Int
profile_background_custom_emoji_id = Maybe Int
profile_background_custom_emoji_id_
}
= String
"SetProfileAccentColor"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"profile_accent_color_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
profile_accent_color_id_
, String
"profile_background_custom_emoji_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
profile_background_custom_emoji_id_
]
instance AT.ToJSON SetProfileAccentColor where
toJSON :: SetProfileAccentColor -> Value
toJSON
SetProfileAccentColor
{ profile_accent_color_id :: SetProfileAccentColor -> Maybe Int
profile_accent_color_id = Maybe Int
profile_accent_color_id_
, profile_background_custom_emoji_id :: SetProfileAccentColor -> Maybe Int
profile_background_custom_emoji_id = Maybe Int
profile_background_custom_emoji_id_
}
= [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
"setProfileAccentColor"
, Key
"profile_accent_color_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
profile_accent_color_id_
, Key
"profile_background_custom_emoji_id" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (Int -> Value) -> Maybe Int -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Value
I.writeInt64 Maybe Int
profile_background_custom_emoji_id_
]
defaultSetProfileAccentColor :: SetProfileAccentColor
defaultSetProfileAccentColor :: SetProfileAccentColor
defaultSetProfileAccentColor =
SetProfileAccentColor
{ profile_accent_color_id :: Maybe Int
profile_accent_color_id = Maybe Int
forall a. Maybe a
Nothing
, profile_background_custom_emoji_id :: Maybe Int
profile_background_custom_emoji_id = Maybe Int
forall a. Maybe a
Nothing
}