{-# 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.LineItemAssetInformation
-- 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.LineItemAssetInformation 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 a line item asset.
--
-- /See:/ 'newLineItemAssetInformation' smart constructor.
data LineItemAssetInformation = LineItemAssetInformation'
  { -- | The ID of the asset.
    LineItemAssetInformation -> Maybe Text
assetId :: Prelude.Maybe Prelude.Text,
    -- | The MAC addresses of the asset.
    LineItemAssetInformation -> Maybe [Text]
macAddressList :: Prelude.Maybe [Prelude.Text]
  }
  deriving (LineItemAssetInformation -> LineItemAssetInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LineItemAssetInformation -> LineItemAssetInformation -> Bool
$c/= :: LineItemAssetInformation -> LineItemAssetInformation -> Bool
== :: LineItemAssetInformation -> LineItemAssetInformation -> Bool
$c== :: LineItemAssetInformation -> LineItemAssetInformation -> Bool
Prelude.Eq, ReadPrec [LineItemAssetInformation]
ReadPrec LineItemAssetInformation
Int -> ReadS LineItemAssetInformation
ReadS [LineItemAssetInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LineItemAssetInformation]
$creadListPrec :: ReadPrec [LineItemAssetInformation]
readPrec :: ReadPrec LineItemAssetInformation
$creadPrec :: ReadPrec LineItemAssetInformation
readList :: ReadS [LineItemAssetInformation]
$creadList :: ReadS [LineItemAssetInformation]
readsPrec :: Int -> ReadS LineItemAssetInformation
$creadsPrec :: Int -> ReadS LineItemAssetInformation
Prelude.Read, Int -> LineItemAssetInformation -> ShowS
[LineItemAssetInformation] -> ShowS
LineItemAssetInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LineItemAssetInformation] -> ShowS
$cshowList :: [LineItemAssetInformation] -> ShowS
show :: LineItemAssetInformation -> String
$cshow :: LineItemAssetInformation -> String
showsPrec :: Int -> LineItemAssetInformation -> ShowS
$cshowsPrec :: Int -> LineItemAssetInformation -> ShowS
Prelude.Show, forall x.
Rep LineItemAssetInformation x -> LineItemAssetInformation
forall x.
LineItemAssetInformation -> Rep LineItemAssetInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LineItemAssetInformation x -> LineItemAssetInformation
$cfrom :: forall x.
LineItemAssetInformation -> Rep LineItemAssetInformation x
Prelude.Generic)

-- |
-- Create a value of 'LineItemAssetInformation' 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:
--
-- 'assetId', 'lineItemAssetInformation_assetId' - The ID of the asset.
--
-- 'macAddressList', 'lineItemAssetInformation_macAddressList' - The MAC addresses of the asset.
newLineItemAssetInformation ::
  LineItemAssetInformation
newLineItemAssetInformation :: LineItemAssetInformation
newLineItemAssetInformation =
  LineItemAssetInformation'
    { $sel:assetId:LineItemAssetInformation' :: Maybe Text
assetId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:macAddressList:LineItemAssetInformation' :: Maybe [Text]
macAddressList = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the asset.
lineItemAssetInformation_assetId :: Lens.Lens' LineItemAssetInformation (Prelude.Maybe Prelude.Text)
lineItemAssetInformation_assetId :: Lens' LineItemAssetInformation (Maybe Text)
lineItemAssetInformation_assetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineItemAssetInformation' {Maybe Text
assetId :: Maybe Text
$sel:assetId:LineItemAssetInformation' :: LineItemAssetInformation -> Maybe Text
assetId} -> Maybe Text
assetId) (\s :: LineItemAssetInformation
s@LineItemAssetInformation' {} Maybe Text
a -> LineItemAssetInformation
s {$sel:assetId:LineItemAssetInformation' :: Maybe Text
assetId = Maybe Text
a} :: LineItemAssetInformation)

-- | The MAC addresses of the asset.
lineItemAssetInformation_macAddressList :: Lens.Lens' LineItemAssetInformation (Prelude.Maybe [Prelude.Text])
lineItemAssetInformation_macAddressList :: Lens' LineItemAssetInformation (Maybe [Text])
lineItemAssetInformation_macAddressList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LineItemAssetInformation' {Maybe [Text]
macAddressList :: Maybe [Text]
$sel:macAddressList:LineItemAssetInformation' :: LineItemAssetInformation -> Maybe [Text]
macAddressList} -> Maybe [Text]
macAddressList) (\s :: LineItemAssetInformation
s@LineItemAssetInformation' {} Maybe [Text]
a -> LineItemAssetInformation
s {$sel:macAddressList:LineItemAssetInformation' :: Maybe [Text]
macAddressList = Maybe [Text]
a} :: LineItemAssetInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON LineItemAssetInformation where
  parseJSON :: Value -> Parser LineItemAssetInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LineItemAssetInformation"
      ( \Object
x ->
          Maybe Text -> Maybe [Text] -> LineItemAssetInformation
LineItemAssetInformation'
            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
"AssetId")
            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
"MacAddressList"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable LineItemAssetInformation where
  hashWithSalt :: Int -> LineItemAssetInformation -> Int
hashWithSalt Int
_salt LineItemAssetInformation' {Maybe [Text]
Maybe Text
macAddressList :: Maybe [Text]
assetId :: Maybe Text
$sel:macAddressList:LineItemAssetInformation' :: LineItemAssetInformation -> Maybe [Text]
$sel:assetId:LineItemAssetInformation' :: LineItemAssetInformation -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
assetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
macAddressList

instance Prelude.NFData LineItemAssetInformation where
  rnf :: LineItemAssetInformation -> ()
rnf LineItemAssetInformation' {Maybe [Text]
Maybe Text
macAddressList :: Maybe [Text]
assetId :: Maybe Text
$sel:macAddressList:LineItemAssetInformation' :: LineItemAssetInformation -> Maybe [Text]
$sel:assetId:LineItemAssetInformation' :: LineItemAssetInformation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
assetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
macAddressList