{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Snowball.Types.ShippingDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | A job\'s shipping information, including inbound and outbound tracking
-- numbers and shipping speed options.
--
-- /See:/ 'newShippingDetails' smart constructor.
data ShippingDetails = ShippingDetails'
  { -- | The shipping speed for a particular job. This speed doesn\'t dictate how
    -- soon you\'ll get the Snow device from the job\'s creation date. This
    -- speed represents how quickly it moves to its destination while in
    -- transit. Regional shipping speeds are as follows:
    --
    -- -   In Australia, you have access to express shipping. Typically, Snow
    --     devices shipped express are delivered in about a day.
    --
    -- -   In the European Union (EU), you have access to express shipping.
    --     Typically, Snow devices shipped express are delivered in about a
    --     day. In addition, most countries in the EU have access to standard
    --     shipping, which typically takes less than a week, one way.
    --
    -- -   In India, Snow devices are delivered in one to seven days.
    --
    -- -   In the United States of America (US), you have access to one-day
    --     shipping and two-day shipping.
    ShippingDetails -> Maybe ShippingOption
shippingOption :: Prelude.Maybe ShippingOption,
    -- | The @Status@ and @TrackingNumber@ values for a Snow device being
    -- delivered to the address that you specified for a particular job.
    ShippingDetails -> Maybe Shipment
outboundShipment :: Prelude.Maybe Shipment,
    -- | The @Status@ and @TrackingNumber@ values for a Snow device being
    -- returned to AWS for a particular job.
    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)

-- |
-- Create a value of 'ShippingDetails' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'shippingOption', 'shippingDetails_shippingOption' - The shipping speed for a particular job. This speed doesn\'t dictate how
-- soon you\'ll get the Snow device from the job\'s creation date. This
-- speed represents how quickly it moves to its destination while in
-- transit. Regional shipping speeds are as follows:
--
-- -   In Australia, you have access to express shipping. Typically, Snow
--     devices shipped express are delivered in about a day.
--
-- -   In the European Union (EU), you have access to express shipping.
--     Typically, Snow devices shipped express are delivered in about a
--     day. In addition, most countries in the EU have access to standard
--     shipping, which typically takes less than a week, one way.
--
-- -   In India, Snow devices are delivered in one to seven days.
--
-- -   In the United States of America (US), you have access to one-day
--     shipping and two-day shipping.
--
-- 'outboundShipment', 'shippingDetails_outboundShipment' - The @Status@ and @TrackingNumber@ values for a Snow device being
-- delivered to the address that you specified for a particular job.
--
-- 'inboundShipment', 'shippingDetails_inboundShipment' - The @Status@ and @TrackingNumber@ values for a Snow device being
-- returned to AWS for a particular job.
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
    }

-- | The shipping speed for a particular job. This speed doesn\'t dictate how
-- soon you\'ll get the Snow device from the job\'s creation date. This
-- speed represents how quickly it moves to its destination while in
-- transit. Regional shipping speeds are as follows:
--
-- -   In Australia, you have access to express shipping. Typically, Snow
--     devices shipped express are delivered in about a day.
--
-- -   In the European Union (EU), you have access to express shipping.
--     Typically, Snow devices shipped express are delivered in about a
--     day. In addition, most countries in the EU have access to standard
--     shipping, which typically takes less than a week, one way.
--
-- -   In India, Snow devices are delivered in one to seven days.
--
-- -   In the United States of America (US), you have access to one-day
--     shipping and two-day shipping.
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)

-- | The @Status@ and @TrackingNumber@ values for a Snow device being
-- delivered to the address that you specified for a particular job.
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)

-- | The @Status@ and @TrackingNumber@ values for a Snow device being
-- returned to AWS for a particular job.
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