{-# 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.AssessmentRunAgent where
import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types.AgentHealth
import Amazonka.Inspector.Types.AgentHealthCode
import Amazonka.Inspector.Types.TelemetryMetadata
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssessmentRunAgent = AssessmentRunAgent'
{
AssessmentRunAgent -> Maybe Text
autoScalingGroup :: Prelude.Maybe Prelude.Text,
AssessmentRunAgent -> Maybe Text
agentHealthDetails :: Prelude.Maybe Prelude.Text,
AssessmentRunAgent -> Text
agentId :: Prelude.Text,
AssessmentRunAgent -> Text
assessmentRunArn :: Prelude.Text,
AssessmentRunAgent -> AgentHealth
agentHealth :: AgentHealth,
AssessmentRunAgent -> AgentHealthCode
agentHealthCode :: AgentHealthCode,
AssessmentRunAgent -> [TelemetryMetadata]
telemetryMetadata :: [TelemetryMetadata]
}
deriving (AssessmentRunAgent -> AssessmentRunAgent -> Bool
(AssessmentRunAgent -> AssessmentRunAgent -> Bool)
-> (AssessmentRunAgent -> AssessmentRunAgent -> Bool)
-> Eq AssessmentRunAgent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssessmentRunAgent -> AssessmentRunAgent -> Bool
$c/= :: AssessmentRunAgent -> AssessmentRunAgent -> Bool
== :: AssessmentRunAgent -> AssessmentRunAgent -> Bool
$c== :: AssessmentRunAgent -> AssessmentRunAgent -> Bool
Prelude.Eq, ReadPrec [AssessmentRunAgent]
ReadPrec AssessmentRunAgent
Int -> ReadS AssessmentRunAgent
ReadS [AssessmentRunAgent]
(Int -> ReadS AssessmentRunAgent)
-> ReadS [AssessmentRunAgent]
-> ReadPrec AssessmentRunAgent
-> ReadPrec [AssessmentRunAgent]
-> Read AssessmentRunAgent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssessmentRunAgent]
$creadListPrec :: ReadPrec [AssessmentRunAgent]
readPrec :: ReadPrec AssessmentRunAgent
$creadPrec :: ReadPrec AssessmentRunAgent
readList :: ReadS [AssessmentRunAgent]
$creadList :: ReadS [AssessmentRunAgent]
readsPrec :: Int -> ReadS AssessmentRunAgent
$creadsPrec :: Int -> ReadS AssessmentRunAgent
Prelude.Read, Int -> AssessmentRunAgent -> ShowS
[AssessmentRunAgent] -> ShowS
AssessmentRunAgent -> String
(Int -> AssessmentRunAgent -> ShowS)
-> (AssessmentRunAgent -> String)
-> ([AssessmentRunAgent] -> ShowS)
-> Show AssessmentRunAgent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssessmentRunAgent] -> ShowS
$cshowList :: [AssessmentRunAgent] -> ShowS
show :: AssessmentRunAgent -> String
$cshow :: AssessmentRunAgent -> String
showsPrec :: Int -> AssessmentRunAgent -> ShowS
$cshowsPrec :: Int -> AssessmentRunAgent -> ShowS
Prelude.Show, (forall x. AssessmentRunAgent -> Rep AssessmentRunAgent x)
-> (forall x. Rep AssessmentRunAgent x -> AssessmentRunAgent)
-> Generic AssessmentRunAgent
forall x. Rep AssessmentRunAgent x -> AssessmentRunAgent
forall x. AssessmentRunAgent -> Rep AssessmentRunAgent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssessmentRunAgent x -> AssessmentRunAgent
$cfrom :: forall x. AssessmentRunAgent -> Rep AssessmentRunAgent x
Prelude.Generic)
newAssessmentRunAgent ::
Prelude.Text ->
Prelude.Text ->
AgentHealth ->
AgentHealthCode ->
AssessmentRunAgent
newAssessmentRunAgent :: Text
-> Text -> AgentHealth -> AgentHealthCode -> AssessmentRunAgent
newAssessmentRunAgent
Text
pAgentId_
Text
pAssessmentRunArn_
AgentHealth
pAgentHealth_
AgentHealthCode
pAgentHealthCode_ =
AssessmentRunAgent' :: Maybe Text
-> Maybe Text
-> Text
-> Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent
AssessmentRunAgent'
{ $sel:autoScalingGroup:AssessmentRunAgent' :: Maybe Text
autoScalingGroup =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:agentHealthDetails:AssessmentRunAgent' :: Maybe Text
agentHealthDetails = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:agentId:AssessmentRunAgent' :: Text
agentId = Text
pAgentId_,
$sel:assessmentRunArn:AssessmentRunAgent' :: Text
assessmentRunArn = Text
pAssessmentRunArn_,
$sel:agentHealth:AssessmentRunAgent' :: AgentHealth
agentHealth = AgentHealth
pAgentHealth_,
$sel:agentHealthCode:AssessmentRunAgent' :: AgentHealthCode
agentHealthCode = AgentHealthCode
pAgentHealthCode_,
$sel:telemetryMetadata:AssessmentRunAgent' :: [TelemetryMetadata]
telemetryMetadata = [TelemetryMetadata]
forall a. Monoid a => a
Prelude.mempty
}
assessmentRunAgent_autoScalingGroup :: Lens.Lens' AssessmentRunAgent (Prelude.Maybe Prelude.Text)
assessmentRunAgent_autoScalingGroup :: (Maybe Text -> f (Maybe Text))
-> AssessmentRunAgent -> f AssessmentRunAgent
assessmentRunAgent_autoScalingGroup = (AssessmentRunAgent -> Maybe Text)
-> (AssessmentRunAgent -> Maybe Text -> AssessmentRunAgent)
-> Lens
AssessmentRunAgent AssessmentRunAgent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunAgent' {Maybe Text
autoScalingGroup :: Maybe Text
$sel:autoScalingGroup:AssessmentRunAgent' :: AssessmentRunAgent -> Maybe Text
autoScalingGroup} -> Maybe Text
autoScalingGroup) (\s :: AssessmentRunAgent
s@AssessmentRunAgent' {} Maybe Text
a -> AssessmentRunAgent
s {$sel:autoScalingGroup:AssessmentRunAgent' :: Maybe Text
autoScalingGroup = Maybe Text
a} :: AssessmentRunAgent)
assessmentRunAgent_agentHealthDetails :: Lens.Lens' AssessmentRunAgent (Prelude.Maybe Prelude.Text)
assessmentRunAgent_agentHealthDetails :: (Maybe Text -> f (Maybe Text))
-> AssessmentRunAgent -> f AssessmentRunAgent
assessmentRunAgent_agentHealthDetails = (AssessmentRunAgent -> Maybe Text)
-> (AssessmentRunAgent -> Maybe Text -> AssessmentRunAgent)
-> Lens
AssessmentRunAgent AssessmentRunAgent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunAgent' {Maybe Text
agentHealthDetails :: Maybe Text
$sel:agentHealthDetails:AssessmentRunAgent' :: AssessmentRunAgent -> Maybe Text
agentHealthDetails} -> Maybe Text
agentHealthDetails) (\s :: AssessmentRunAgent
s@AssessmentRunAgent' {} Maybe Text
a -> AssessmentRunAgent
s {$sel:agentHealthDetails:AssessmentRunAgent' :: Maybe Text
agentHealthDetails = Maybe Text
a} :: AssessmentRunAgent)
assessmentRunAgent_agentId :: Lens.Lens' AssessmentRunAgent Prelude.Text
assessmentRunAgent_agentId :: (Text -> f Text) -> AssessmentRunAgent -> f AssessmentRunAgent
assessmentRunAgent_agentId = (AssessmentRunAgent -> Text)
-> (AssessmentRunAgent -> Text -> AssessmentRunAgent)
-> Lens AssessmentRunAgent AssessmentRunAgent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunAgent' {Text
agentId :: Text
$sel:agentId:AssessmentRunAgent' :: AssessmentRunAgent -> Text
agentId} -> Text
agentId) (\s :: AssessmentRunAgent
s@AssessmentRunAgent' {} Text
a -> AssessmentRunAgent
s {$sel:agentId:AssessmentRunAgent' :: Text
agentId = Text
a} :: AssessmentRunAgent)
assessmentRunAgent_assessmentRunArn :: Lens.Lens' AssessmentRunAgent Prelude.Text
assessmentRunAgent_assessmentRunArn :: (Text -> f Text) -> AssessmentRunAgent -> f AssessmentRunAgent
assessmentRunAgent_assessmentRunArn = (AssessmentRunAgent -> Text)
-> (AssessmentRunAgent -> Text -> AssessmentRunAgent)
-> Lens AssessmentRunAgent AssessmentRunAgent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunAgent' {Text
assessmentRunArn :: Text
$sel:assessmentRunArn:AssessmentRunAgent' :: AssessmentRunAgent -> Text
assessmentRunArn} -> Text
assessmentRunArn) (\s :: AssessmentRunAgent
s@AssessmentRunAgent' {} Text
a -> AssessmentRunAgent
s {$sel:assessmentRunArn:AssessmentRunAgent' :: Text
assessmentRunArn = Text
a} :: AssessmentRunAgent)
assessmentRunAgent_agentHealth :: Lens.Lens' AssessmentRunAgent AgentHealth
assessmentRunAgent_agentHealth :: (AgentHealth -> f AgentHealth)
-> AssessmentRunAgent -> f AssessmentRunAgent
assessmentRunAgent_agentHealth = (AssessmentRunAgent -> AgentHealth)
-> (AssessmentRunAgent -> AgentHealth -> AssessmentRunAgent)
-> Lens
AssessmentRunAgent AssessmentRunAgent AgentHealth AgentHealth
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunAgent' {AgentHealth
agentHealth :: AgentHealth
$sel:agentHealth:AssessmentRunAgent' :: AssessmentRunAgent -> AgentHealth
agentHealth} -> AgentHealth
agentHealth) (\s :: AssessmentRunAgent
s@AssessmentRunAgent' {} AgentHealth
a -> AssessmentRunAgent
s {$sel:agentHealth:AssessmentRunAgent' :: AgentHealth
agentHealth = AgentHealth
a} :: AssessmentRunAgent)
assessmentRunAgent_agentHealthCode :: Lens.Lens' AssessmentRunAgent AgentHealthCode
assessmentRunAgent_agentHealthCode :: (AgentHealthCode -> f AgentHealthCode)
-> AssessmentRunAgent -> f AssessmentRunAgent
assessmentRunAgent_agentHealthCode = (AssessmentRunAgent -> AgentHealthCode)
-> (AssessmentRunAgent -> AgentHealthCode -> AssessmentRunAgent)
-> Lens
AssessmentRunAgent
AssessmentRunAgent
AgentHealthCode
AgentHealthCode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunAgent' {AgentHealthCode
agentHealthCode :: AgentHealthCode
$sel:agentHealthCode:AssessmentRunAgent' :: AssessmentRunAgent -> AgentHealthCode
agentHealthCode} -> AgentHealthCode
agentHealthCode) (\s :: AssessmentRunAgent
s@AssessmentRunAgent' {} AgentHealthCode
a -> AssessmentRunAgent
s {$sel:agentHealthCode:AssessmentRunAgent' :: AgentHealthCode
agentHealthCode = AgentHealthCode
a} :: AssessmentRunAgent)
assessmentRunAgent_telemetryMetadata :: Lens.Lens' AssessmentRunAgent [TelemetryMetadata]
assessmentRunAgent_telemetryMetadata :: ([TelemetryMetadata] -> f [TelemetryMetadata])
-> AssessmentRunAgent -> f AssessmentRunAgent
assessmentRunAgent_telemetryMetadata = (AssessmentRunAgent -> [TelemetryMetadata])
-> (AssessmentRunAgent
-> [TelemetryMetadata] -> AssessmentRunAgent)
-> Lens
AssessmentRunAgent
AssessmentRunAgent
[TelemetryMetadata]
[TelemetryMetadata]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentRunAgent' {[TelemetryMetadata]
telemetryMetadata :: [TelemetryMetadata]
$sel:telemetryMetadata:AssessmentRunAgent' :: AssessmentRunAgent -> [TelemetryMetadata]
telemetryMetadata} -> [TelemetryMetadata]
telemetryMetadata) (\s :: AssessmentRunAgent
s@AssessmentRunAgent' {} [TelemetryMetadata]
a -> AssessmentRunAgent
s {$sel:telemetryMetadata:AssessmentRunAgent' :: [TelemetryMetadata]
telemetryMetadata = [TelemetryMetadata]
a} :: AssessmentRunAgent) (([TelemetryMetadata] -> f [TelemetryMetadata])
-> AssessmentRunAgent -> f AssessmentRunAgent)
-> (([TelemetryMetadata] -> f [TelemetryMetadata])
-> [TelemetryMetadata] -> f [TelemetryMetadata])
-> ([TelemetryMetadata] -> f [TelemetryMetadata])
-> AssessmentRunAgent
-> f AssessmentRunAgent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TelemetryMetadata] -> f [TelemetryMetadata])
-> [TelemetryMetadata] -> f [TelemetryMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON AssessmentRunAgent where
parseJSON :: Value -> Parser AssessmentRunAgent
parseJSON =
String
-> (Object -> Parser AssessmentRunAgent)
-> Value
-> Parser AssessmentRunAgent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssessmentRunAgent"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Text
-> Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent
AssessmentRunAgent'
(Maybe Text
-> Maybe Text
-> Text
-> Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Text
-> Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent)
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
"autoScalingGroup")
Parser
(Maybe Text
-> Text
-> Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent)
-> Parser (Maybe Text)
-> Parser
(Text
-> Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent)
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
"agentHealthDetails")
Parser
(Text
-> Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent)
-> Parser Text
-> Parser
(Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent)
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")
Parser
(Text
-> AgentHealth
-> AgentHealthCode
-> [TelemetryMetadata]
-> AssessmentRunAgent)
-> Parser Text
-> Parser
(AgentHealth
-> AgentHealthCode -> [TelemetryMetadata] -> AssessmentRunAgent)
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
"assessmentRunArn")
Parser
(AgentHealth
-> AgentHealthCode -> [TelemetryMetadata] -> AssessmentRunAgent)
-> Parser AgentHealth
-> Parser
(AgentHealthCode -> [TelemetryMetadata] -> AssessmentRunAgent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AgentHealth
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"agentHealth")
Parser
(AgentHealthCode -> [TelemetryMetadata] -> AssessmentRunAgent)
-> Parser AgentHealthCode
-> Parser ([TelemetryMetadata] -> AssessmentRunAgent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AgentHealthCode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"agentHealthCode")
Parser ([TelemetryMetadata] -> AssessmentRunAgent)
-> Parser [TelemetryMetadata] -> Parser AssessmentRunAgent
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [TelemetryMetadata])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"telemetryMetadata"
Parser (Maybe [TelemetryMetadata])
-> [TelemetryMetadata] -> Parser [TelemetryMetadata]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [TelemetryMetadata]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable AssessmentRunAgent
instance Prelude.NFData AssessmentRunAgent