{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | A job\'s shipping information, including inbound and outbound tracking
-- numbers and shipping speed options.
--
-- /See:/ 'newShippingDetails' smart constructor.
data ShippingDetails = ShippingDetails'
  { -- | The @Status@ and @TrackingNumber@ values for a Snow device being
    -- returned to Amazon Web Services for a particular job.
    ShippingDetails -> Maybe Shipment
inboundShipment :: Prelude.Maybe Shipment,
    -- | 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 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
  }
  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)

-- |
-- 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:
--
-- 'inboundShipment', 'shippingDetails_inboundShipment' - The @Status@ and @TrackingNumber@ values for a Snow device being
-- returned to Amazon Web Services for a particular job.
--
-- 'outboundShipment', 'shippingDetails_outboundShipment' - The @Status@ and @TrackingNumber@ values for a Snow device being
-- delivered to the address that you specified for a particular job.
--
-- '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.
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
    }

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

-- | 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 :: 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)

-- | 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 :: 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