{-# 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 #-}
module Amazonka.Discovery.Types.AgentNetworkInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AgentNetworkInfo = AgentNetworkInfo'
{
AgentNetworkInfo -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
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)
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
}
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)
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