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

import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text
import GHC.Generics (Generic)

import Telegram.Bot.API.Internal.Utils

-- ** 'WriteAccessAllowed'

-- | This object represents a service message about a user allowing a bot added to the attachment menu to write messages. Currently holds no information.
newtype WriteAccessAllowed = WriteAccessAllowed
  { WriteAccessAllowed -> Maybe Text
writeAccessAllowedWebAppName :: Maybe Text -- ^ Name of the Web App which was launched from a link.
  }
  deriving (forall x. Rep WriteAccessAllowed x -> WriteAccessAllowed
forall x. WriteAccessAllowed -> Rep WriteAccessAllowed x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WriteAccessAllowed x -> WriteAccessAllowed
$cfrom :: forall x. WriteAccessAllowed -> Rep WriteAccessAllowed x
Generic, Int -> WriteAccessAllowed -> ShowS
[WriteAccessAllowed] -> ShowS
WriteAccessAllowed -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WriteAccessAllowed] -> ShowS
$cshowList :: [WriteAccessAllowed] -> ShowS
show :: WriteAccessAllowed -> String
$cshow :: WriteAccessAllowed -> String
showsPrec :: Int -> WriteAccessAllowed -> ShowS
$cshowsPrec :: Int -> WriteAccessAllowed -> ShowS
Show)

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