{-# 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.Inspector.Types.AgentPreview where
import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types.AgentHealth
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AgentPreview = AgentPreview'
{
AgentPreview -> Maybe Text
hostname :: Prelude.Maybe Prelude.Text,
AgentPreview -> Maybe Text
autoScalingGroup :: Prelude.Maybe Prelude.Text,
AgentPreview -> Maybe Text
operatingSystem :: Prelude.Maybe Prelude.Text,
AgentPreview -> Maybe Text
agentVersion :: Prelude.Maybe Prelude.Text,
AgentPreview -> Maybe Text
kernelVersion :: Prelude.Maybe Prelude.Text,
AgentPreview -> Maybe AgentHealth
agentHealth :: Prelude.Maybe AgentHealth,
AgentPreview -> Maybe Text
ipv4Address :: Prelude.Maybe Prelude.Text,
AgentPreview -> Text
agentId :: Prelude.Text
}
deriving (AgentPreview -> AgentPreview -> Bool
(AgentPreview -> AgentPreview -> Bool)
-> (AgentPreview -> AgentPreview -> Bool) -> Eq AgentPreview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AgentPreview -> AgentPreview -> Bool
$c/= :: AgentPreview -> AgentPreview -> Bool
== :: AgentPreview -> AgentPreview -> Bool
$c== :: AgentPreview -> AgentPreview -> Bool
Prelude.Eq, ReadPrec [AgentPreview]
ReadPrec AgentPreview
Int -> ReadS AgentPreview
ReadS [AgentPreview]
(Int -> ReadS AgentPreview)
-> ReadS [AgentPreview]
-> ReadPrec AgentPreview
-> ReadPrec [AgentPreview]
-> Read AgentPreview
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AgentPreview]
$creadListPrec :: ReadPrec [AgentPreview]
readPrec :: ReadPrec AgentPreview
$creadPrec :: ReadPrec AgentPreview
readList :: ReadS [AgentPreview]
$creadList :: ReadS [AgentPreview]
readsPrec :: Int -> ReadS AgentPreview
$creadsPrec :: Int -> ReadS AgentPreview
Prelude.Read, Int -> AgentPreview -> ShowS
[AgentPreview] -> ShowS
AgentPreview -> String
(Int -> AgentPreview -> ShowS)
-> (AgentPreview -> String)
-> ([AgentPreview] -> ShowS)
-> Show AgentPreview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AgentPreview] -> ShowS
$cshowList :: [AgentPreview] -> ShowS
show :: AgentPreview -> String
$cshow :: AgentPreview -> String
showsPrec :: Int -> AgentPreview -> ShowS
$cshowsPrec :: Int -> AgentPreview -> ShowS
Prelude.Show, (forall x. AgentPreview -> Rep AgentPreview x)
-> (forall x. Rep AgentPreview x -> AgentPreview)
-> Generic AgentPreview
forall x. Rep AgentPreview x -> AgentPreview
forall x. AgentPreview -> Rep AgentPreview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AgentPreview x -> AgentPreview
$cfrom :: forall x. AgentPreview -> Rep AgentPreview x
Prelude.Generic)
newAgentPreview ::
Prelude.Text ->
AgentPreview
newAgentPreview :: Text -> AgentPreview
newAgentPreview Text
pAgentId_ =
AgentPreview' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview
AgentPreview'
{ $sel:hostname:AgentPreview' :: Maybe Text
hostname = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroup:AgentPreview' :: Maybe Text
autoScalingGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:operatingSystem:AgentPreview' :: Maybe Text
operatingSystem = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:agentVersion:AgentPreview' :: Maybe Text
agentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:kernelVersion:AgentPreview' :: Maybe Text
kernelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:agentHealth:AgentPreview' :: Maybe AgentHealth
agentHealth = Maybe AgentHealth
forall a. Maybe a
Prelude.Nothing,
$sel:ipv4Address:AgentPreview' :: Maybe Text
ipv4Address = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:agentId:AgentPreview' :: Text
agentId = Text
pAgentId_
}
agentPreview_hostname :: Lens.Lens' AgentPreview (Prelude.Maybe Prelude.Text)
agentPreview_hostname :: (Maybe Text -> f (Maybe Text)) -> AgentPreview -> f AgentPreview
agentPreview_hostname = (AgentPreview -> Maybe Text)
-> (AgentPreview -> Maybe Text -> AgentPreview)
-> Lens AgentPreview AgentPreview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentPreview' {Maybe Text
hostname :: Maybe Text
$sel:hostname:AgentPreview' :: AgentPreview -> Maybe Text
hostname} -> Maybe Text
hostname) (\s :: AgentPreview
s@AgentPreview' {} Maybe Text
a -> AgentPreview
s {$sel:hostname:AgentPreview' :: Maybe Text
hostname = Maybe Text
a} :: AgentPreview)
agentPreview_autoScalingGroup :: Lens.Lens' AgentPreview (Prelude.Maybe Prelude.Text)
agentPreview_autoScalingGroup :: (Maybe Text -> f (Maybe Text)) -> AgentPreview -> f AgentPreview
agentPreview_autoScalingGroup = (AgentPreview -> Maybe Text)
-> (AgentPreview -> Maybe Text -> AgentPreview)
-> Lens AgentPreview AgentPreview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentPreview' {Maybe Text
autoScalingGroup :: Maybe Text
$sel:autoScalingGroup:AgentPreview' :: AgentPreview -> Maybe Text
autoScalingGroup} -> Maybe Text
autoScalingGroup) (\s :: AgentPreview
s@AgentPreview' {} Maybe Text
a -> AgentPreview
s {$sel:autoScalingGroup:AgentPreview' :: Maybe Text
autoScalingGroup = Maybe Text
a} :: AgentPreview)
agentPreview_operatingSystem :: Lens.Lens' AgentPreview (Prelude.Maybe Prelude.Text)
agentPreview_operatingSystem :: (Maybe Text -> f (Maybe Text)) -> AgentPreview -> f AgentPreview
agentPreview_operatingSystem = (AgentPreview -> Maybe Text)
-> (AgentPreview -> Maybe Text -> AgentPreview)
-> Lens AgentPreview AgentPreview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentPreview' {Maybe Text
operatingSystem :: Maybe Text
$sel:operatingSystem:AgentPreview' :: AgentPreview -> Maybe Text
operatingSystem} -> Maybe Text
operatingSystem) (\s :: AgentPreview
s@AgentPreview' {} Maybe Text
a -> AgentPreview
s {$sel:operatingSystem:AgentPreview' :: Maybe Text
operatingSystem = Maybe Text
a} :: AgentPreview)
agentPreview_agentVersion :: Lens.Lens' AgentPreview (Prelude.Maybe Prelude.Text)
agentPreview_agentVersion :: (Maybe Text -> f (Maybe Text)) -> AgentPreview -> f AgentPreview
agentPreview_agentVersion = (AgentPreview -> Maybe Text)
-> (AgentPreview -> Maybe Text -> AgentPreview)
-> Lens AgentPreview AgentPreview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentPreview' {Maybe Text
agentVersion :: Maybe Text
$sel:agentVersion:AgentPreview' :: AgentPreview -> Maybe Text
agentVersion} -> Maybe Text
agentVersion) (\s :: AgentPreview
s@AgentPreview' {} Maybe Text
a -> AgentPreview
s {$sel:agentVersion:AgentPreview' :: Maybe Text
agentVersion = Maybe Text
a} :: AgentPreview)
agentPreview_kernelVersion :: Lens.Lens' AgentPreview (Prelude.Maybe Prelude.Text)
agentPreview_kernelVersion :: (Maybe Text -> f (Maybe Text)) -> AgentPreview -> f AgentPreview
agentPreview_kernelVersion = (AgentPreview -> Maybe Text)
-> (AgentPreview -> Maybe Text -> AgentPreview)
-> Lens AgentPreview AgentPreview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentPreview' {Maybe Text
kernelVersion :: Maybe Text
$sel:kernelVersion:AgentPreview' :: AgentPreview -> Maybe Text
kernelVersion} -> Maybe Text
kernelVersion) (\s :: AgentPreview
s@AgentPreview' {} Maybe Text
a -> AgentPreview
s {$sel:kernelVersion:AgentPreview' :: Maybe Text
kernelVersion = Maybe Text
a} :: AgentPreview)
agentPreview_agentHealth :: Lens.Lens' AgentPreview (Prelude.Maybe AgentHealth)
agentPreview_agentHealth :: (Maybe AgentHealth -> f (Maybe AgentHealth))
-> AgentPreview -> f AgentPreview
agentPreview_agentHealth = (AgentPreview -> Maybe AgentHealth)
-> (AgentPreview -> Maybe AgentHealth -> AgentPreview)
-> Lens
AgentPreview AgentPreview (Maybe AgentHealth) (Maybe AgentHealth)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentPreview' {Maybe AgentHealth
agentHealth :: Maybe AgentHealth
$sel:agentHealth:AgentPreview' :: AgentPreview -> Maybe AgentHealth
agentHealth} -> Maybe AgentHealth
agentHealth) (\s :: AgentPreview
s@AgentPreview' {} Maybe AgentHealth
a -> AgentPreview
s {$sel:agentHealth:AgentPreview' :: Maybe AgentHealth
agentHealth = Maybe AgentHealth
a} :: AgentPreview)
agentPreview_ipv4Address :: Lens.Lens' AgentPreview (Prelude.Maybe Prelude.Text)
agentPreview_ipv4Address :: (Maybe Text -> f (Maybe Text)) -> AgentPreview -> f AgentPreview
agentPreview_ipv4Address = (AgentPreview -> Maybe Text)
-> (AgentPreview -> Maybe Text -> AgentPreview)
-> Lens AgentPreview AgentPreview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentPreview' {Maybe Text
ipv4Address :: Maybe Text
$sel:ipv4Address:AgentPreview' :: AgentPreview -> Maybe Text
ipv4Address} -> Maybe Text
ipv4Address) (\s :: AgentPreview
s@AgentPreview' {} Maybe Text
a -> AgentPreview
s {$sel:ipv4Address:AgentPreview' :: Maybe Text
ipv4Address = Maybe Text
a} :: AgentPreview)
agentPreview_agentId :: Lens.Lens' AgentPreview Prelude.Text
agentPreview_agentId :: (Text -> f Text) -> AgentPreview -> f AgentPreview
agentPreview_agentId = (AgentPreview -> Text)
-> (AgentPreview -> Text -> AgentPreview)
-> Lens AgentPreview AgentPreview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AgentPreview' {Text
agentId :: Text
$sel:agentId:AgentPreview' :: AgentPreview -> Text
agentId} -> Text
agentId) (\s :: AgentPreview
s@AgentPreview' {} Text
a -> AgentPreview
s {$sel:agentId:AgentPreview' :: Text
agentId = Text
a} :: AgentPreview)
instance Core.FromJSON AgentPreview where
parseJSON :: Value -> Parser AgentPreview
parseJSON =
String
-> (Object -> Parser AgentPreview) -> Value -> Parser AgentPreview
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AgentPreview"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview
AgentPreview'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview)
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
"hostname")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview)
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
"autoScalingGroup")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview)
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
"operatingSystem")
Parser
(Maybe Text
-> Maybe Text
-> Maybe AgentHealth
-> Maybe Text
-> Text
-> AgentPreview)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe AgentHealth -> Maybe Text -> Text -> AgentPreview)
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
"agentVersion")
Parser
(Maybe Text
-> Maybe AgentHealth -> Maybe Text -> Text -> AgentPreview)
-> Parser (Maybe Text)
-> Parser (Maybe AgentHealth -> Maybe Text -> Text -> AgentPreview)
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
"kernelVersion")
Parser (Maybe AgentHealth -> Maybe Text -> Text -> AgentPreview)
-> Parser (Maybe AgentHealth)
-> Parser (Maybe Text -> Text -> AgentPreview)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AgentHealth)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"agentHealth")
Parser (Maybe Text -> Text -> AgentPreview)
-> Parser (Maybe Text) -> Parser (Text -> AgentPreview)
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
"ipv4Address")
Parser (Text -> AgentPreview) -> Parser Text -> Parser AgentPreview
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"agentId")
)
instance Prelude.Hashable AgentPreview
instance Prelude.NFData AgentPreview