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