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

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

import Telegram.Bot.API.Internal.Utils

-- ** 'ShippingAddress'

-- | This object represents a shipping address.
data ShippingAddress = ShippingAddress
  { ShippingAddress -> Text
shippingAddressCountryCode :: Text -- ^ ISO 3166-1 alpha-2 country code.
  , ShippingAddress -> Text
shippingAddressState       :: Text -- ^ State, if applicable.
  , ShippingAddress -> Text
shippingAddressCity        :: Text -- ^ City.
  , ShippingAddress -> Text
shippingAddressStreetLine1 :: Text -- ^ First line for the address.
  , ShippingAddress -> Text
shippingAddressStreetLine2 :: Text -- ^ Second line for the address.
  , ShippingAddress -> Text
shippingAddressPostCode    :: Text -- ^ Address post code.
  }
  deriving (forall x. Rep ShippingAddress x -> ShippingAddress
forall x. ShippingAddress -> Rep ShippingAddress x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShippingAddress x -> ShippingAddress
$cfrom :: forall x. ShippingAddress -> Rep ShippingAddress x
Generic, Int -> ShippingAddress -> ShowS
[ShippingAddress] -> ShowS
ShippingAddress -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShippingAddress] -> ShowS
$cshowList :: [ShippingAddress] -> ShowS
show :: ShippingAddress -> String
$cshow :: ShippingAddress -> String
showsPrec :: Int -> ShippingAddress -> ShowS
$cshowsPrec :: Int -> ShippingAddress -> ShowS
Show)

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