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

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

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

-- ** 'ShippingQuery'

-- | This object contains information about an incoming shipping query.
data ShippingQuery = ShippingQuery
  { ShippingQuery -> Text
shippingQueryId              :: Text            -- ^ Unique query identifier.
  , ShippingQuery -> User
shippingQueryFrom            :: User            -- ^ User who sent the query.
  , ShippingQuery -> Text
shippingQueryInvoicePayload  :: Text            -- ^ Bot specified invoice payload.
  , ShippingQuery -> ShippingAddress
shippingQueryShippingAddress :: ShippingAddress -- ^ User specified shipping address.
  }
  deriving ((forall x. ShippingQuery -> Rep ShippingQuery x)
-> (forall x. Rep ShippingQuery x -> ShippingQuery)
-> Generic ShippingQuery
forall x. Rep ShippingQuery x -> ShippingQuery
forall x. ShippingQuery -> Rep ShippingQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ShippingQuery -> Rep ShippingQuery x
from :: forall x. ShippingQuery -> Rep ShippingQuery x
$cto :: forall x. Rep ShippingQuery x -> ShippingQuery
to :: forall x. Rep ShippingQuery x -> ShippingQuery
Generic, Int -> ShippingQuery -> ShowS
[ShippingQuery] -> ShowS
ShippingQuery -> String
(Int -> ShippingQuery -> ShowS)
-> (ShippingQuery -> String)
-> ([ShippingQuery] -> ShowS)
-> Show ShippingQuery
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ShippingQuery -> ShowS
showsPrec :: Int -> ShippingQuery -> ShowS
$cshow :: ShippingQuery -> String
show :: ShippingQuery -> String
$cshowList :: [ShippingQuery] -> ShowS
showList :: [ShippingQuery] -> ShowS
Show)

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