{-# 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.PrivateNetworks.Types.TrackingInformation
-- 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.PrivateNetworks.Types.TrackingInformation 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

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

-- |
-- Create a value of 'TrackingInformation' 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:
--
-- 'trackingNumber', 'trackingInformation_trackingNumber' - The tracking number of the shipment.
newTrackingInformation ::
  TrackingInformation
newTrackingInformation :: TrackingInformation
newTrackingInformation =
  TrackingInformation'
    { $sel:trackingNumber:TrackingInformation' :: Maybe Text
trackingNumber =
        forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Prelude.Hashable TrackingInformation where
  hashWithSalt :: Int -> TrackingInformation -> Int
hashWithSalt Int
_salt TrackingInformation' {Maybe Text
trackingNumber :: Maybe Text
$sel:trackingNumber:TrackingInformation' :: TrackingInformation -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
trackingNumber

instance Prelude.NFData TrackingInformation where
  rnf :: TrackingInformation -> ()
rnf TrackingInformation' {Maybe Text
trackingNumber :: Maybe Text
$sel:trackingNumber:TrackingInformation' :: TrackingInformation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
trackingNumber