{-# 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.Outposts.Types.ShipmentInformation
-- 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.Outposts.Types.ShipmentInformation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Outposts.Types.ShipmentCarrier
import qualified Amazonka.Prelude as Prelude

-- | Information about a line item shipment.
--
-- /See:/ 'newShipmentInformation' smart constructor.
data ShipmentInformation = ShipmentInformation'
  { -- | The carrier of the shipment.
    ShipmentInformation -> Maybe ShipmentCarrier
shipmentCarrier :: Prelude.Maybe ShipmentCarrier,
    -- | The tracking number of the shipment.
    ShipmentInformation -> Maybe Text
shipmentTrackingNumber :: Prelude.Maybe Prelude.Text
  }
  deriving (ShipmentInformation -> ShipmentInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShipmentInformation -> ShipmentInformation -> Bool
$c/= :: ShipmentInformation -> ShipmentInformation -> Bool
== :: ShipmentInformation -> ShipmentInformation -> Bool
$c== :: ShipmentInformation -> ShipmentInformation -> Bool
Prelude.Eq, ReadPrec [ShipmentInformation]
ReadPrec ShipmentInformation
Int -> ReadS ShipmentInformation
ReadS [ShipmentInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShipmentInformation]
$creadListPrec :: ReadPrec [ShipmentInformation]
readPrec :: ReadPrec ShipmentInformation
$creadPrec :: ReadPrec ShipmentInformation
readList :: ReadS [ShipmentInformation]
$creadList :: ReadS [ShipmentInformation]
readsPrec :: Int -> ReadS ShipmentInformation
$creadsPrec :: Int -> ReadS ShipmentInformation
Prelude.Read, Int -> ShipmentInformation -> ShowS
[ShipmentInformation] -> ShowS
ShipmentInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShipmentInformation] -> ShowS
$cshowList :: [ShipmentInformation] -> ShowS
show :: ShipmentInformation -> String
$cshow :: ShipmentInformation -> String
showsPrec :: Int -> ShipmentInformation -> ShowS
$cshowsPrec :: Int -> ShipmentInformation -> ShowS
Prelude.Show, forall x. Rep ShipmentInformation x -> ShipmentInformation
forall x. ShipmentInformation -> Rep ShipmentInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShipmentInformation x -> ShipmentInformation
$cfrom :: forall x. ShipmentInformation -> Rep ShipmentInformation x
Prelude.Generic)

-- |
-- Create a value of 'ShipmentInformation' 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:
--
-- 'shipmentCarrier', 'shipmentInformation_shipmentCarrier' - The carrier of the shipment.
--
-- 'shipmentTrackingNumber', 'shipmentInformation_shipmentTrackingNumber' - The tracking number of the shipment.
newShipmentInformation ::
  ShipmentInformation
newShipmentInformation :: ShipmentInformation
newShipmentInformation =
  ShipmentInformation'
    { $sel:shipmentCarrier:ShipmentInformation' :: Maybe ShipmentCarrier
shipmentCarrier =
        forall a. Maybe a
Prelude.Nothing,
      $sel:shipmentTrackingNumber:ShipmentInformation' :: Maybe Text
shipmentTrackingNumber = forall a. Maybe a
Prelude.Nothing
    }

-- | The carrier of the shipment.
shipmentInformation_shipmentCarrier :: Lens.Lens' ShipmentInformation (Prelude.Maybe ShipmentCarrier)
shipmentInformation_shipmentCarrier :: Lens' ShipmentInformation (Maybe ShipmentCarrier)
shipmentInformation_shipmentCarrier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShipmentInformation' {Maybe ShipmentCarrier
shipmentCarrier :: Maybe ShipmentCarrier
$sel:shipmentCarrier:ShipmentInformation' :: ShipmentInformation -> Maybe ShipmentCarrier
shipmentCarrier} -> Maybe ShipmentCarrier
shipmentCarrier) (\s :: ShipmentInformation
s@ShipmentInformation' {} Maybe ShipmentCarrier
a -> ShipmentInformation
s {$sel:shipmentCarrier:ShipmentInformation' :: Maybe ShipmentCarrier
shipmentCarrier = Maybe ShipmentCarrier
a} :: ShipmentInformation)

-- | The tracking number of the shipment.
shipmentInformation_shipmentTrackingNumber :: Lens.Lens' ShipmentInformation (Prelude.Maybe Prelude.Text)
shipmentInformation_shipmentTrackingNumber :: Lens' ShipmentInformation (Maybe Text)
shipmentInformation_shipmentTrackingNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShipmentInformation' {Maybe Text
shipmentTrackingNumber :: Maybe Text
$sel:shipmentTrackingNumber:ShipmentInformation' :: ShipmentInformation -> Maybe Text
shipmentTrackingNumber} -> Maybe Text
shipmentTrackingNumber) (\s :: ShipmentInformation
s@ShipmentInformation' {} Maybe Text
a -> ShipmentInformation
s {$sel:shipmentTrackingNumber:ShipmentInformation' :: Maybe Text
shipmentTrackingNumber = Maybe Text
a} :: ShipmentInformation)

instance Data.FromJSON ShipmentInformation where
  parseJSON :: Value -> Parser ShipmentInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ShipmentInformation"
      ( \Object
x ->
          Maybe ShipmentCarrier -> Maybe Text -> ShipmentInformation
ShipmentInformation'
            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
"ShipmentCarrier")
            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
"ShipmentTrackingNumber")
      )

instance Prelude.Hashable ShipmentInformation where
  hashWithSalt :: Int -> ShipmentInformation -> Int
hashWithSalt Int
_salt ShipmentInformation' {Maybe Text
Maybe ShipmentCarrier
shipmentTrackingNumber :: Maybe Text
shipmentCarrier :: Maybe ShipmentCarrier
$sel:shipmentTrackingNumber:ShipmentInformation' :: ShipmentInformation -> Maybe Text
$sel:shipmentCarrier:ShipmentInformation' :: ShipmentInformation -> Maybe ShipmentCarrier
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ShipmentCarrier
shipmentCarrier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
shipmentTrackingNumber

instance Prelude.NFData ShipmentInformation where
  rnf :: ShipmentInformation -> ()
rnf ShipmentInformation' {Maybe Text
Maybe ShipmentCarrier
shipmentTrackingNumber :: Maybe Text
shipmentCarrier :: Maybe ShipmentCarrier
$sel:shipmentTrackingNumber:ShipmentInformation' :: ShipmentInformation -> Maybe Text
$sel:shipmentCarrier:ShipmentInformation' :: ShipmentInformation -> Maybe ShipmentCarrier
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ShipmentCarrier
shipmentCarrier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
shipmentTrackingNumber