{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.LoginUrl where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import GHC.Generics (Generic)
import Telegram.Bot.API.Internal.Utils
data LoginUrl = LoginUrl
{ LoginUrl -> Text
loginUrlUrl :: Text
, LoginUrl -> Maybe Text
loginUrlForwardText :: Maybe Text
, LoginUrl -> Maybe Text
loginUrlBotUsername :: Maybe Text
, LoginUrl -> Maybe Bool
loginUrlRequestWriteAccess :: Maybe Bool
}
deriving ((forall x. LoginUrl -> Rep LoginUrl x)
-> (forall x. Rep LoginUrl x -> LoginUrl) -> Generic LoginUrl
forall x. Rep LoginUrl x -> LoginUrl
forall x. LoginUrl -> Rep LoginUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoginUrl x -> LoginUrl
$cfrom :: forall x. LoginUrl -> Rep LoginUrl x
Generic, Int -> LoginUrl -> ShowS
[LoginUrl] -> ShowS
LoginUrl -> String
(Int -> LoginUrl -> ShowS)
-> (LoginUrl -> String) -> ([LoginUrl] -> ShowS) -> Show LoginUrl
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoginUrl] -> ShowS
$cshowList :: [LoginUrl] -> ShowS
show :: LoginUrl -> String
$cshow :: LoginUrl -> String
showsPrec :: Int -> LoginUrl -> ShowS
$cshowsPrec :: Int -> LoginUrl -> ShowS
Show)
instance ToJSON LoginUrl where toJSON :: LoginUrl -> Value
toJSON = LoginUrl -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON LoginUrl where parseJSON :: Value -> Parser LoginUrl
parseJSON = Value -> Parser LoginUrl
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON