{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Snowball.Types.ShippingDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Snowball.Types.Shipment
import Amazonka.Snowball.Types.ShippingOption
data ShippingDetails = ShippingDetails'
{
ShippingDetails -> Maybe ShippingOption
shippingOption :: Prelude.Maybe ShippingOption,
ShippingDetails -> Maybe Shipment
outboundShipment :: Prelude.Maybe Shipment,
ShippingDetails -> Maybe Shipment
inboundShipment :: Prelude.Maybe Shipment
}
deriving (ShippingDetails -> ShippingDetails -> Bool
(ShippingDetails -> ShippingDetails -> Bool)
-> (ShippingDetails -> ShippingDetails -> Bool)
-> Eq ShippingDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShippingDetails -> ShippingDetails -> Bool
$c/= :: ShippingDetails -> ShippingDetails -> Bool
== :: ShippingDetails -> ShippingDetails -> Bool
$c== :: ShippingDetails -> ShippingDetails -> Bool
Prelude.Eq, ReadPrec [ShippingDetails]
ReadPrec ShippingDetails
Int -> ReadS ShippingDetails
ReadS [ShippingDetails]
(Int -> ReadS ShippingDetails)
-> ReadS [ShippingDetails]
-> ReadPrec ShippingDetails
-> ReadPrec [ShippingDetails]
-> Read ShippingDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShippingDetails]
$creadListPrec :: ReadPrec [ShippingDetails]
readPrec :: ReadPrec ShippingDetails
$creadPrec :: ReadPrec ShippingDetails
readList :: ReadS [ShippingDetails]
$creadList :: ReadS [ShippingDetails]
readsPrec :: Int -> ReadS ShippingDetails
$creadsPrec :: Int -> ReadS ShippingDetails
Prelude.Read, Int -> ShippingDetails -> ShowS
[ShippingDetails] -> ShowS
ShippingDetails -> String
(Int -> ShippingDetails -> ShowS)
-> (ShippingDetails -> String)
-> ([ShippingDetails] -> ShowS)
-> Show ShippingDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShippingDetails] -> ShowS
$cshowList :: [ShippingDetails] -> ShowS
show :: ShippingDetails -> String
$cshow :: ShippingDetails -> String
showsPrec :: Int -> ShippingDetails -> ShowS
$cshowsPrec :: Int -> ShippingDetails -> ShowS
Prelude.Show, (forall x. ShippingDetails -> Rep ShippingDetails x)
-> (forall x. Rep ShippingDetails x -> ShippingDetails)
-> Generic ShippingDetails
forall x. Rep ShippingDetails x -> ShippingDetails
forall x. ShippingDetails -> Rep ShippingDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShippingDetails x -> ShippingDetails
$cfrom :: forall x. ShippingDetails -> Rep ShippingDetails x
Prelude.Generic)
newShippingDetails ::
ShippingDetails
newShippingDetails :: ShippingDetails
newShippingDetails =
ShippingDetails' :: Maybe ShippingOption
-> Maybe Shipment -> Maybe Shipment -> ShippingDetails
ShippingDetails'
{ $sel:shippingOption:ShippingDetails' :: Maybe ShippingOption
shippingOption = Maybe ShippingOption
forall a. Maybe a
Prelude.Nothing,
$sel:outboundShipment:ShippingDetails' :: Maybe Shipment
outboundShipment = Maybe Shipment
forall a. Maybe a
Prelude.Nothing,
$sel:inboundShipment:ShippingDetails' :: Maybe Shipment
inboundShipment = Maybe Shipment
forall a. Maybe a
Prelude.Nothing
}
shippingDetails_shippingOption :: Lens.Lens' ShippingDetails (Prelude.Maybe ShippingOption)
shippingDetails_shippingOption :: (Maybe ShippingOption -> f (Maybe ShippingOption))
-> ShippingDetails -> f ShippingDetails
shippingDetails_shippingOption = (ShippingDetails -> Maybe ShippingOption)
-> (ShippingDetails -> Maybe ShippingOption -> ShippingDetails)
-> Lens
ShippingDetails
ShippingDetails
(Maybe ShippingOption)
(Maybe ShippingOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShippingDetails' {Maybe ShippingOption
shippingOption :: Maybe ShippingOption
$sel:shippingOption:ShippingDetails' :: ShippingDetails -> Maybe ShippingOption
shippingOption} -> Maybe ShippingOption
shippingOption) (\s :: ShippingDetails
s@ShippingDetails' {} Maybe ShippingOption
a -> ShippingDetails
s {$sel:shippingOption:ShippingDetails' :: Maybe ShippingOption
shippingOption = Maybe ShippingOption
a} :: ShippingDetails)
shippingDetails_outboundShipment :: Lens.Lens' ShippingDetails (Prelude.Maybe Shipment)
shippingDetails_outboundShipment :: (Maybe Shipment -> f (Maybe Shipment))
-> ShippingDetails -> f ShippingDetails
shippingDetails_outboundShipment = (ShippingDetails -> Maybe Shipment)
-> (ShippingDetails -> Maybe Shipment -> ShippingDetails)
-> Lens
ShippingDetails ShippingDetails (Maybe Shipment) (Maybe Shipment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShippingDetails' {Maybe Shipment
outboundShipment :: Maybe Shipment
$sel:outboundShipment:ShippingDetails' :: ShippingDetails -> Maybe Shipment
outboundShipment} -> Maybe Shipment
outboundShipment) (\s :: ShippingDetails
s@ShippingDetails' {} Maybe Shipment
a -> ShippingDetails
s {$sel:outboundShipment:ShippingDetails' :: Maybe Shipment
outboundShipment = Maybe Shipment
a} :: ShippingDetails)
shippingDetails_inboundShipment :: Lens.Lens' ShippingDetails (Prelude.Maybe Shipment)
shippingDetails_inboundShipment :: (Maybe Shipment -> f (Maybe Shipment))
-> ShippingDetails -> f ShippingDetails
shippingDetails_inboundShipment = (ShippingDetails -> Maybe Shipment)
-> (ShippingDetails -> Maybe Shipment -> ShippingDetails)
-> Lens
ShippingDetails ShippingDetails (Maybe Shipment) (Maybe Shipment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShippingDetails' {Maybe Shipment
inboundShipment :: Maybe Shipment
$sel:inboundShipment:ShippingDetails' :: ShippingDetails -> Maybe Shipment
inboundShipment} -> Maybe Shipment
inboundShipment) (\s :: ShippingDetails
s@ShippingDetails' {} Maybe Shipment
a -> ShippingDetails
s {$sel:inboundShipment:ShippingDetails' :: Maybe Shipment
inboundShipment = Maybe Shipment
a} :: ShippingDetails)
instance Core.FromJSON ShippingDetails where
parseJSON :: Value -> Parser ShippingDetails
parseJSON =
String
-> (Object -> Parser ShippingDetails)
-> Value
-> Parser ShippingDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ShippingDetails"
( \Object
x ->
Maybe ShippingOption
-> Maybe Shipment -> Maybe Shipment -> ShippingDetails
ShippingDetails'
(Maybe ShippingOption
-> Maybe Shipment -> Maybe Shipment -> ShippingDetails)
-> Parser (Maybe ShippingOption)
-> Parser (Maybe Shipment -> Maybe Shipment -> ShippingDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ShippingOption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShippingOption")
Parser (Maybe Shipment -> Maybe Shipment -> ShippingDetails)
-> Parser (Maybe Shipment)
-> Parser (Maybe Shipment -> ShippingDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Shipment)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OutboundShipment")
Parser (Maybe Shipment -> ShippingDetails)
-> Parser (Maybe Shipment) -> Parser ShippingDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Shipment)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InboundShipment")
)
instance Prelude.Hashable ShippingDetails
instance Prelude.NFData ShippingDetails