{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Snowball.Types.Shipment
import Amazonka.Snowball.Types.ShippingOption
data ShippingDetails = ShippingDetails'
{
ShippingDetails -> Maybe Shipment
inboundShipment :: Prelude.Maybe Shipment,
ShippingDetails -> Maybe Shipment
outboundShipment :: Prelude.Maybe Shipment,
ShippingDetails -> Maybe ShippingOption
shippingOption :: Prelude.Maybe ShippingOption
}
deriving (ShippingDetails -> ShippingDetails -> Bool
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]
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
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. 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'
{ $sel:inboundShipment:ShippingDetails' :: Maybe Shipment
inboundShipment = forall a. Maybe a
Prelude.Nothing,
$sel:outboundShipment:ShippingDetails' :: Maybe Shipment
outboundShipment = forall a. Maybe a
Prelude.Nothing,
$sel:shippingOption:ShippingDetails' :: Maybe ShippingOption
shippingOption = forall a. Maybe a
Prelude.Nothing
}
shippingDetails_inboundShipment :: Lens.Lens' ShippingDetails (Prelude.Maybe Shipment)
shippingDetails_inboundShipment :: Lens' ShippingDetails (Maybe Shipment)
shippingDetails_inboundShipment = 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)
shippingDetails_outboundShipment :: Lens.Lens' ShippingDetails (Prelude.Maybe Shipment)
shippingDetails_outboundShipment :: Lens' ShippingDetails (Maybe Shipment)
shippingDetails_outboundShipment = 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_shippingOption :: Lens.Lens' ShippingDetails (Prelude.Maybe ShippingOption)
shippingDetails_shippingOption :: Lens' ShippingDetails (Maybe ShippingOption)
shippingDetails_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)
instance Data.FromJSON ShippingDetails where
parseJSON :: Value -> Parser ShippingDetails
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ShippingDetails"
( \Object
x ->
Maybe Shipment
-> Maybe Shipment -> Maybe ShippingOption -> ShippingDetails
ShippingDetails'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InboundShipment")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OutboundShipment")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ShippingOption")
)
instance Prelude.Hashable ShippingDetails where
hashWithSalt :: Int -> ShippingDetails -> Int
hashWithSalt Int
_salt ShippingDetails' {Maybe Shipment
Maybe ShippingOption
shippingOption :: Maybe ShippingOption
outboundShipment :: Maybe Shipment
inboundShipment :: Maybe Shipment
$sel:shippingOption:ShippingDetails' :: ShippingDetails -> Maybe ShippingOption
$sel:outboundShipment:ShippingDetails' :: ShippingDetails -> Maybe Shipment
$sel:inboundShipment:ShippingDetails' :: ShippingDetails -> Maybe Shipment
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Shipment
inboundShipment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Shipment
outboundShipment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ShippingOption
shippingOption
instance Prelude.NFData ShippingDetails where
rnf :: ShippingDetails -> ()
rnf ShippingDetails' {Maybe Shipment
Maybe ShippingOption
shippingOption :: Maybe ShippingOption
outboundShipment :: Maybe Shipment
inboundShipment :: Maybe Shipment
$sel:shippingOption:ShippingDetails' :: ShippingDetails -> Maybe ShippingOption
$sel:outboundShipment:ShippingDetails' :: ShippingDetails -> Maybe Shipment
$sel:inboundShipment:ShippingDetails' :: ShippingDetails -> Maybe Shipment
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Shipment
inboundShipment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Shipment
outboundShipment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ShippingOption
shippingOption