{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.ChatBoostRemoved where

import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Time.Clock.POSIX (POSIXTime)
import GHC.Generics (Generic)

import Telegram.Bot.API.Internal.Utils
import Telegram.Bot.API.Types.Chat
import Telegram.Bot.API.Types.ChatBoostSource
import Telegram.Bot.API.Types.Common

-- ** 'ChatBoostRemoved'

-- | This object represents a boost removed from a chat.
data ChatBoostRemoved = ChatBoostRemoved
  { ChatBoostRemoved -> Chat
chatBoostRemovedChat :: Chat -- ^ Chat which was boosted.
  , ChatBoostRemoved -> BoostId
chatBoostRemovedBoostId :: BoostId -- ^ Unique identifier of the boost.
  , ChatBoostRemoved -> POSIXTime
chatBoostRemovedRemoveDate :: POSIXTime -- ^ Point in time (Unix timestamp) when the boost was removed.
  , ChatBoostRemoved -> ChatBoostSource
chatBoostRemovedSource :: ChatBoostSource -- ^ Source of the removed boost.
  }
  deriving ((forall x. ChatBoostRemoved -> Rep ChatBoostRemoved x)
-> (forall x. Rep ChatBoostRemoved x -> ChatBoostRemoved)
-> Generic ChatBoostRemoved
forall x. Rep ChatBoostRemoved x -> ChatBoostRemoved
forall x. ChatBoostRemoved -> Rep ChatBoostRemoved x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChatBoostRemoved -> Rep ChatBoostRemoved x
from :: forall x. ChatBoostRemoved -> Rep ChatBoostRemoved x
$cto :: forall x. Rep ChatBoostRemoved x -> ChatBoostRemoved
to :: forall x. Rep ChatBoostRemoved x -> ChatBoostRemoved
Generic, Int -> ChatBoostRemoved -> ShowS
[ChatBoostRemoved] -> ShowS
ChatBoostRemoved -> String
(Int -> ChatBoostRemoved -> ShowS)
-> (ChatBoostRemoved -> String)
-> ([ChatBoostRemoved] -> ShowS)
-> Show ChatBoostRemoved
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChatBoostRemoved -> ShowS
showsPrec :: Int -> ChatBoostRemoved -> ShowS
$cshow :: ChatBoostRemoved -> String
show :: ChatBoostRemoved -> String
$cshowList :: [ChatBoostRemoved] -> ShowS
showList :: [ChatBoostRemoved] -> ShowS
Show)

instance ToJSON   ChatBoostRemoved where toJSON :: ChatBoostRemoved -> Value
toJSON = ChatBoostRemoved -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON ChatBoostRemoved where parseJSON :: Value -> Parser ChatBoostRemoved
parseJSON = Value -> Parser ChatBoostRemoved
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON