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

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

import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Types.LabeledPrice
import Telegram.Bot.API.Internal.Utils

-- ** 'ShippingOption'

-- | This object represents one shipping option.
data ShippingOption = ShippingOption
  { ShippingOption -> ShippingOptionId
shippingOptionId    :: ShippingOptionId -- ^ Shipping option identifier.
  , ShippingOption -> Text
shippingOptionTitle :: Text             -- ^ Option title.
  , ShippingOption -> [LabeledPrice]
shippingOptionPrice :: [LabeledPrice]   -- ^ List of price portions.
  }
  deriving (forall x. Rep ShippingOption x -> ShippingOption
forall x. ShippingOption -> Rep ShippingOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShippingOption x -> ShippingOption
$cfrom :: forall x. ShippingOption -> Rep ShippingOption x
Generic, Int -> ShippingOption -> ShowS
[ShippingOption] -> ShowS
ShippingOption -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShippingOption] -> ShowS
$cshowList :: [ShippingOption] -> ShowS
show :: ShippingOption -> String
$cshow :: ShippingOption -> String
showsPrec :: Int -> ShippingOption -> ShowS
$cshowsPrec :: Int -> ShippingOption -> ShowS
Show)

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