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

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

import Telegram.Bot.API.Internal.Utils

-- ** 'LabeledPrice'

-- | This object represents a portion of the price for goods or services.
data LabeledPrice = LabelPrice
  { LabeledPrice -> Text
labeledPriceLabel  :: Text  -- ^ Portion label.
  , LabeledPrice -> Int
labeledPriceAmount :: Int -- ^ Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
  }
  deriving (forall x. Rep LabeledPrice x -> LabeledPrice
forall x. LabeledPrice -> Rep LabeledPrice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabeledPrice x -> LabeledPrice
$cfrom :: forall x. LabeledPrice -> Rep LabeledPrice x
Generic, Int -> LabeledPrice -> ShowS
[LabeledPrice] -> ShowS
LabeledPrice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabeledPrice] -> ShowS
$cshowList :: [LabeledPrice] -> ShowS
show :: LabeledPrice -> String
$cshow :: LabeledPrice -> String
showsPrec :: Int -> LabeledPrice -> ShowS
$cshowsPrec :: Int -> LabeledPrice -> ShowS
Show)

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