{-# 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.FMS.Types.PossibleRemediationAction where
import qualified Amazonka.Core as Core
import Amazonka.FMS.Types.RemediationActionWithOrder
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PossibleRemediationAction = PossibleRemediationAction'
{
PossibleRemediationAction -> Maybe Bool
isDefaultAction :: Prelude.Maybe Prelude.Bool,
PossibleRemediationAction -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
PossibleRemediationAction -> [RemediationActionWithOrder]
orderedRemediationActions :: [RemediationActionWithOrder]
}
deriving (PossibleRemediationAction -> PossibleRemediationAction -> Bool
(PossibleRemediationAction -> PossibleRemediationAction -> Bool)
-> (PossibleRemediationAction -> PossibleRemediationAction -> Bool)
-> Eq PossibleRemediationAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PossibleRemediationAction -> PossibleRemediationAction -> Bool
$c/= :: PossibleRemediationAction -> PossibleRemediationAction -> Bool
== :: PossibleRemediationAction -> PossibleRemediationAction -> Bool
$c== :: PossibleRemediationAction -> PossibleRemediationAction -> Bool
Prelude.Eq, ReadPrec [PossibleRemediationAction]
ReadPrec PossibleRemediationAction
Int -> ReadS PossibleRemediationAction
ReadS [PossibleRemediationAction]
(Int -> ReadS PossibleRemediationAction)
-> ReadS [PossibleRemediationAction]
-> ReadPrec PossibleRemediationAction
-> ReadPrec [PossibleRemediationAction]
-> Read PossibleRemediationAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PossibleRemediationAction]
$creadListPrec :: ReadPrec [PossibleRemediationAction]
readPrec :: ReadPrec PossibleRemediationAction
$creadPrec :: ReadPrec PossibleRemediationAction
readList :: ReadS [PossibleRemediationAction]
$creadList :: ReadS [PossibleRemediationAction]
readsPrec :: Int -> ReadS PossibleRemediationAction
$creadsPrec :: Int -> ReadS PossibleRemediationAction
Prelude.Read, Int -> PossibleRemediationAction -> ShowS
[PossibleRemediationAction] -> ShowS
PossibleRemediationAction -> String
(Int -> PossibleRemediationAction -> ShowS)
-> (PossibleRemediationAction -> String)
-> ([PossibleRemediationAction] -> ShowS)
-> Show PossibleRemediationAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PossibleRemediationAction] -> ShowS
$cshowList :: [PossibleRemediationAction] -> ShowS
show :: PossibleRemediationAction -> String
$cshow :: PossibleRemediationAction -> String
showsPrec :: Int -> PossibleRemediationAction -> ShowS
$cshowsPrec :: Int -> PossibleRemediationAction -> ShowS
Prelude.Show, (forall x.
PossibleRemediationAction -> Rep PossibleRemediationAction x)
-> (forall x.
Rep PossibleRemediationAction x -> PossibleRemediationAction)
-> Generic PossibleRemediationAction
forall x.
Rep PossibleRemediationAction x -> PossibleRemediationAction
forall x.
PossibleRemediationAction -> Rep PossibleRemediationAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PossibleRemediationAction x -> PossibleRemediationAction
$cfrom :: forall x.
PossibleRemediationAction -> Rep PossibleRemediationAction x
Prelude.Generic)
newPossibleRemediationAction ::
PossibleRemediationAction
newPossibleRemediationAction :: PossibleRemediationAction
newPossibleRemediationAction =
PossibleRemediationAction' :: Maybe Bool
-> Maybe Text
-> [RemediationActionWithOrder]
-> PossibleRemediationAction
PossibleRemediationAction'
{ $sel:isDefaultAction:PossibleRemediationAction' :: Maybe Bool
isDefaultAction =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:description:PossibleRemediationAction' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:orderedRemediationActions:PossibleRemediationAction' :: [RemediationActionWithOrder]
orderedRemediationActions = [RemediationActionWithOrder]
forall a. Monoid a => a
Prelude.mempty
}
possibleRemediationAction_isDefaultAction :: Lens.Lens' PossibleRemediationAction (Prelude.Maybe Prelude.Bool)
possibleRemediationAction_isDefaultAction :: (Maybe Bool -> f (Maybe Bool))
-> PossibleRemediationAction -> f PossibleRemediationAction
possibleRemediationAction_isDefaultAction = (PossibleRemediationAction -> Maybe Bool)
-> (PossibleRemediationAction
-> Maybe Bool -> PossibleRemediationAction)
-> Lens
PossibleRemediationAction
PossibleRemediationAction
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PossibleRemediationAction' {Maybe Bool
isDefaultAction :: Maybe Bool
$sel:isDefaultAction:PossibleRemediationAction' :: PossibleRemediationAction -> Maybe Bool
isDefaultAction} -> Maybe Bool
isDefaultAction) (\s :: PossibleRemediationAction
s@PossibleRemediationAction' {} Maybe Bool
a -> PossibleRemediationAction
s {$sel:isDefaultAction:PossibleRemediationAction' :: Maybe Bool
isDefaultAction = Maybe Bool
a} :: PossibleRemediationAction)
possibleRemediationAction_description :: Lens.Lens' PossibleRemediationAction (Prelude.Maybe Prelude.Text)
possibleRemediationAction_description :: (Maybe Text -> f (Maybe Text))
-> PossibleRemediationAction -> f PossibleRemediationAction
possibleRemediationAction_description = (PossibleRemediationAction -> Maybe Text)
-> (PossibleRemediationAction
-> Maybe Text -> PossibleRemediationAction)
-> Lens
PossibleRemediationAction
PossibleRemediationAction
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PossibleRemediationAction' {Maybe Text
description :: Maybe Text
$sel:description:PossibleRemediationAction' :: PossibleRemediationAction -> Maybe Text
description} -> Maybe Text
description) (\s :: PossibleRemediationAction
s@PossibleRemediationAction' {} Maybe Text
a -> PossibleRemediationAction
s {$sel:description:PossibleRemediationAction' :: Maybe Text
description = Maybe Text
a} :: PossibleRemediationAction)
possibleRemediationAction_orderedRemediationActions :: Lens.Lens' PossibleRemediationAction [RemediationActionWithOrder]
possibleRemediationAction_orderedRemediationActions :: ([RemediationActionWithOrder] -> f [RemediationActionWithOrder])
-> PossibleRemediationAction -> f PossibleRemediationAction
possibleRemediationAction_orderedRemediationActions = (PossibleRemediationAction -> [RemediationActionWithOrder])
-> (PossibleRemediationAction
-> [RemediationActionWithOrder] -> PossibleRemediationAction)
-> Lens
PossibleRemediationAction
PossibleRemediationAction
[RemediationActionWithOrder]
[RemediationActionWithOrder]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PossibleRemediationAction' {[RemediationActionWithOrder]
orderedRemediationActions :: [RemediationActionWithOrder]
$sel:orderedRemediationActions:PossibleRemediationAction' :: PossibleRemediationAction -> [RemediationActionWithOrder]
orderedRemediationActions} -> [RemediationActionWithOrder]
orderedRemediationActions) (\s :: PossibleRemediationAction
s@PossibleRemediationAction' {} [RemediationActionWithOrder]
a -> PossibleRemediationAction
s {$sel:orderedRemediationActions:PossibleRemediationAction' :: [RemediationActionWithOrder]
orderedRemediationActions = [RemediationActionWithOrder]
a} :: PossibleRemediationAction) (([RemediationActionWithOrder] -> f [RemediationActionWithOrder])
-> PossibleRemediationAction -> f PossibleRemediationAction)
-> (([RemediationActionWithOrder]
-> f [RemediationActionWithOrder])
-> [RemediationActionWithOrder] -> f [RemediationActionWithOrder])
-> ([RemediationActionWithOrder] -> f [RemediationActionWithOrder])
-> PossibleRemediationAction
-> f PossibleRemediationAction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RemediationActionWithOrder] -> f [RemediationActionWithOrder])
-> [RemediationActionWithOrder] -> f [RemediationActionWithOrder]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON PossibleRemediationAction where
parseJSON :: Value -> Parser PossibleRemediationAction
parseJSON =
String
-> (Object -> Parser PossibleRemediationAction)
-> Value
-> Parser PossibleRemediationAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PossibleRemediationAction"
( \Object
x ->
Maybe Bool
-> Maybe Text
-> [RemediationActionWithOrder]
-> PossibleRemediationAction
PossibleRemediationAction'
(Maybe Bool
-> Maybe Text
-> [RemediationActionWithOrder]
-> PossibleRemediationAction)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> [RemediationActionWithOrder] -> PossibleRemediationAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsDefaultAction")
Parser
(Maybe Text
-> [RemediationActionWithOrder] -> PossibleRemediationAction)
-> Parser (Maybe Text)
-> Parser
([RemediationActionWithOrder] -> PossibleRemediationAction)
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
"Description")
Parser ([RemediationActionWithOrder] -> PossibleRemediationAction)
-> Parser [RemediationActionWithOrder]
-> Parser PossibleRemediationAction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [RemediationActionWithOrder])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OrderedRemediationActions"
Parser (Maybe [RemediationActionWithOrder])
-> [RemediationActionWithOrder]
-> Parser [RemediationActionWithOrder]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [RemediationActionWithOrder]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable PossibleRemediationAction
instance Prelude.NFData PossibleRemediationAction