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

import Data.Aeson
import GHC.Generics (Generic)

import Telegram.Bot.API.Internal.Utils

-- ** 'VideoChatStarted'

-- | This object represents a service message about a video chat started in the chat. Currently holds no information.
data VideoChatStarted = VideoChatStarted
  deriving ((forall x. VideoChatStarted -> Rep VideoChatStarted x)
-> (forall x. Rep VideoChatStarted x -> VideoChatStarted)
-> Generic VideoChatStarted
forall x. Rep VideoChatStarted x -> VideoChatStarted
forall x. VideoChatStarted -> Rep VideoChatStarted x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. VideoChatStarted -> Rep VideoChatStarted x
from :: forall x. VideoChatStarted -> Rep VideoChatStarted x
$cto :: forall x. Rep VideoChatStarted x -> VideoChatStarted
to :: forall x. Rep VideoChatStarted x -> VideoChatStarted
Generic, Int -> VideoChatStarted -> ShowS
[VideoChatStarted] -> ShowS
VideoChatStarted -> String
(Int -> VideoChatStarted -> ShowS)
-> (VideoChatStarted -> String)
-> ([VideoChatStarted] -> ShowS)
-> Show VideoChatStarted
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VideoChatStarted -> ShowS
showsPrec :: Int -> VideoChatStarted -> ShowS
$cshow :: VideoChatStarted -> String
show :: VideoChatStarted -> String
$cshowList :: [VideoChatStarted] -> ShowS
showList :: [VideoChatStarted] -> ShowS
Show)

instance ToJSON VideoChatStarted where
  toJSON :: VideoChatStarted -> Value
toJSON = VideoChatStarted -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON

instance FromJSON VideoChatStarted where
  parseJSON :: Value -> Parser VideoChatStarted
parseJSON (Object Object
_) = VideoChatStarted -> Parser VideoChatStarted
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure VideoChatStarted
VideoChatStarted
  parseJSON Value
_ = String -> Parser VideoChatStarted
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"Unable to parse VideoChatStarted: expected an empty object"