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

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

import Telegram.Bot.API.Types.ShippingAddress
import Telegram.Bot.API.Internal.Utils

-- ** 'OrderInfo'

-- | This object represents information about an order.
data OrderInfo = OrderInfo
  { OrderInfo -> Maybe Text
orderInfoName            :: Maybe Text            -- ^ User name.
  , OrderInfo -> Maybe Text
orderInfoPhoneNumber     :: Maybe Text            -- ^ User's phone number.
  , OrderInfo -> Maybe Text
orderInfoEmail           :: Maybe Text            -- ^ User email.
  , OrderInfo -> Maybe ShippingAddress
orderInfoShippingAddress :: Maybe ShippingAddress -- ^ User shipping address.
  }
  deriving (forall x. Rep OrderInfo x -> OrderInfo
forall x. OrderInfo -> Rep OrderInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OrderInfo x -> OrderInfo
$cfrom :: forall x. OrderInfo -> Rep OrderInfo x
Generic, Int -> OrderInfo -> ShowS
[OrderInfo] -> ShowS
OrderInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrderInfo] -> ShowS
$cshowList :: [OrderInfo] -> ShowS
show :: OrderInfo -> String
$cshow :: OrderInfo -> String
showsPrec :: Int -> OrderInfo -> ShowS
$cshowsPrec :: Int -> OrderInfo -> ShowS
Show)

instance ToJSON   OrderInfo where toJSON :: OrderInfo -> 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 OrderInfo where parseJSON :: Value -> Parser OrderInfo
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON