{-# 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.Discovery.Types.AgentNetworkInfo
-- 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.Discovery.Types.AgentNetworkInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Network details about the host where the agent\/connector resides.
--
-- /See:/ 'newAgentNetworkInfo' smart constructor.
data AgentNetworkInfo = AgentNetworkInfo'
  { -- | The IP address for the host where the agent\/connector resides.
    AgentNetworkInfo -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | The MAC address for the host where the agent\/connector resides.
    AgentNetworkInfo -> Maybe Text
macAddress :: Prelude.Maybe Prelude.Text
  }
  deriving (AgentNetworkInfo -> AgentNetworkInfo -> Bool
(AgentNetworkInfo -> AgentNetworkInfo -> Bool)
-> (AgentNetworkInfo -> AgentNetworkInfo -> Bool)
-> Eq AgentNetworkInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AgentNetworkInfo -> AgentNetworkInfo -> Bool
$c/= :: AgentNetworkInfo -> AgentNetworkInfo -> Bool
== :: AgentNetworkInfo -> AgentNetworkInfo -> Bool
$c== :: AgentNetworkInfo -> AgentNetworkInfo -> Bool
Prelude.Eq, ReadPrec [AgentNetworkInfo]
ReadPrec AgentNetworkInfo
Int -> ReadS AgentNetworkInfo
ReadS [AgentNetworkInfo]
(Int -> ReadS AgentNetworkInfo)
-> ReadS [AgentNetworkInfo]
-> ReadPrec AgentNetworkInfo
-> ReadPrec [AgentNetworkInfo]
-> Read AgentNetworkInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AgentNetworkInfo]
$creadListPrec :: ReadPrec [AgentNetworkInfo]
readPrec :: ReadPrec AgentNetworkInfo
$creadPrec :: ReadPrec AgentNetworkInfo
readList :: ReadS [AgentNetworkInfo]
$creadList :: ReadS [AgentNetworkInfo]
readsPrec :: Int -> ReadS AgentNetworkInfo
$creadsPrec :: Int -> ReadS AgentNetworkInfo
Prelude.Read, Int -> AgentNetworkInfo -> ShowS
[AgentNetworkInfo] -> ShowS
AgentNetworkInfo -> String
(Int -> AgentNetworkInfo -> ShowS)
-> (AgentNetworkInfo -> String)
-> ([AgentNetworkInfo] -> ShowS)
-> Show AgentNetworkInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AgentNetworkInfo] -> ShowS
$cshowList :: [AgentNetworkInfo] -> ShowS
show :: AgentNetworkInfo -> String
$cshow :: AgentNetworkInfo -> String
showsPrec :: Int -> AgentNetworkInfo -> ShowS
$cshowsPrec :: Int -> AgentNetworkInfo -> ShowS
Prelude.Show, (forall x. AgentNetworkInfo -> Rep AgentNetworkInfo x)
-> (forall x. Rep AgentNetworkInfo x -> AgentNetworkInfo)
-> Generic AgentNetworkInfo
forall x. Rep AgentNetworkInfo x -> AgentNetworkInfo
forall x. AgentNetworkInfo -> Rep AgentNetworkInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AgentNetworkInfo x -> AgentNetworkInfo
$cfrom :: forall x. AgentNetworkInfo -> Rep AgentNetworkInfo x
Prelude.Generic)

-- |
-- Create a value of 'AgentNetworkInfo' 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:
--
-- 'ipAddress', 'agentNetworkInfo_ipAddress' - The IP address for the host where the agent\/connector resides.
--
-- 'macAddress', 'agentNetworkInfo_macAddress' - The MAC address for the host where the agent\/connector resides.
newAgentNetworkInfo ::
  AgentNetworkInfo
newAgentNetworkInfo :: AgentNetworkInfo
newAgentNetworkInfo =
  AgentNetworkInfo' :: Maybe Text -> Maybe Text -> AgentNetworkInfo
AgentNetworkInfo'
    { $sel:ipAddress:AgentNetworkInfo' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:macAddress:AgentNetworkInfo' :: Maybe Text
macAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The IP address for the host where the agent\/connector resides.
agentNetworkInfo_ipAddress :: Lens.Lens' AgentNetworkInfo (Prelude.Maybe Prelude.Text)
agentNetworkInfo_ipAddress :: (Maybe Text -> f (Maybe Text))
-> AgentNetworkInfo -> f AgentNetworkInfo
agentNetworkInfo_ipAddress = (AgentNetworkInfo -> Maybe Text)
-> (AgentNetworkInfo -> Maybe Text -> AgentNetworkInfo)
-> Lens AgentNetworkInfo AgentNetworkInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentNetworkInfo' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:AgentNetworkInfo' :: AgentNetworkInfo -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: AgentNetworkInfo
s@AgentNetworkInfo' {} Maybe Text
a -> AgentNetworkInfo
s {$sel:ipAddress:AgentNetworkInfo' :: Maybe Text
ipAddress = Maybe Text
a} :: AgentNetworkInfo)

-- | The MAC address for the host where the agent\/connector resides.
agentNetworkInfo_macAddress :: Lens.Lens' AgentNetworkInfo (Prelude.Maybe Prelude.Text)
agentNetworkInfo_macAddress :: (Maybe Text -> f (Maybe Text))
-> AgentNetworkInfo -> f AgentNetworkInfo
agentNetworkInfo_macAddress = (AgentNetworkInfo -> Maybe Text)
-> (AgentNetworkInfo -> Maybe Text -> AgentNetworkInfo)
-> Lens AgentNetworkInfo AgentNetworkInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentNetworkInfo' {Maybe Text
macAddress :: Maybe Text
$sel:macAddress:AgentNetworkInfo' :: AgentNetworkInfo -> Maybe Text
macAddress} -> Maybe Text
macAddress) (\s :: AgentNetworkInfo
s@AgentNetworkInfo' {} Maybe Text
a -> AgentNetworkInfo
s {$sel:macAddress:AgentNetworkInfo' :: Maybe Text
macAddress = Maybe Text
a} :: AgentNetworkInfo)

instance Core.FromJSON AgentNetworkInfo where
  parseJSON :: Value -> Parser AgentNetworkInfo
parseJSON =
    String
-> (Object -> Parser AgentNetworkInfo)
-> Value
-> Parser AgentNetworkInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AgentNetworkInfo"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> AgentNetworkInfo
AgentNetworkInfo'
            (Maybe Text -> Maybe Text -> AgentNetworkInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AgentNetworkInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ipAddress")
            Parser (Maybe Text -> AgentNetworkInfo)
-> Parser (Maybe Text) -> Parser AgentNetworkInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"macAddress")
      )

instance Prelude.Hashable AgentNetworkInfo

instance Prelude.NFData AgentNetworkInfo