{-# 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.FMS.Types.PossibleRemediationActions
-- 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.FMS.Types.PossibleRemediationActions where

import qualified Amazonka.Core as Core
import Amazonka.FMS.Types.PossibleRemediationAction
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A list of possible remediation action lists. Each individual possible
-- remediation action is a list of individual remediation actions.
--
-- /See:/ 'newPossibleRemediationActions' smart constructor.
data PossibleRemediationActions = PossibleRemediationActions'
  { -- | Information about the actions.
    PossibleRemediationActions -> Maybe [PossibleRemediationAction]
actions :: Prelude.Maybe [PossibleRemediationAction],
    -- | A description of the possible remediation actions list.
    PossibleRemediationActions -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (PossibleRemediationActions -> PossibleRemediationActions -> Bool
(PossibleRemediationActions -> PossibleRemediationActions -> Bool)
-> (PossibleRemediationActions
    -> PossibleRemediationActions -> Bool)
-> Eq PossibleRemediationActions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PossibleRemediationActions -> PossibleRemediationActions -> Bool
$c/= :: PossibleRemediationActions -> PossibleRemediationActions -> Bool
== :: PossibleRemediationActions -> PossibleRemediationActions -> Bool
$c== :: PossibleRemediationActions -> PossibleRemediationActions -> Bool
Prelude.Eq, ReadPrec [PossibleRemediationActions]
ReadPrec PossibleRemediationActions
Int -> ReadS PossibleRemediationActions
ReadS [PossibleRemediationActions]
(Int -> ReadS PossibleRemediationActions)
-> ReadS [PossibleRemediationActions]
-> ReadPrec PossibleRemediationActions
-> ReadPrec [PossibleRemediationActions]
-> Read PossibleRemediationActions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PossibleRemediationActions]
$creadListPrec :: ReadPrec [PossibleRemediationActions]
readPrec :: ReadPrec PossibleRemediationActions
$creadPrec :: ReadPrec PossibleRemediationActions
readList :: ReadS [PossibleRemediationActions]
$creadList :: ReadS [PossibleRemediationActions]
readsPrec :: Int -> ReadS PossibleRemediationActions
$creadsPrec :: Int -> ReadS PossibleRemediationActions
Prelude.Read, Int -> PossibleRemediationActions -> ShowS
[PossibleRemediationActions] -> ShowS
PossibleRemediationActions -> String
(Int -> PossibleRemediationActions -> ShowS)
-> (PossibleRemediationActions -> String)
-> ([PossibleRemediationActions] -> ShowS)
-> Show PossibleRemediationActions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PossibleRemediationActions] -> ShowS
$cshowList :: [PossibleRemediationActions] -> ShowS
show :: PossibleRemediationActions -> String
$cshow :: PossibleRemediationActions -> String
showsPrec :: Int -> PossibleRemediationActions -> ShowS
$cshowsPrec :: Int -> PossibleRemediationActions -> ShowS
Prelude.Show, (forall x.
 PossibleRemediationActions -> Rep PossibleRemediationActions x)
-> (forall x.
    Rep PossibleRemediationActions x -> PossibleRemediationActions)
-> Generic PossibleRemediationActions
forall x.
Rep PossibleRemediationActions x -> PossibleRemediationActions
forall x.
PossibleRemediationActions -> Rep PossibleRemediationActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PossibleRemediationActions x -> PossibleRemediationActions
$cfrom :: forall x.
PossibleRemediationActions -> Rep PossibleRemediationActions x
Prelude.Generic)

-- |
-- Create a value of 'PossibleRemediationActions' 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:
--
-- 'actions', 'possibleRemediationActions_actions' - Information about the actions.
--
-- 'description', 'possibleRemediationActions_description' - A description of the possible remediation actions list.
newPossibleRemediationActions ::
  PossibleRemediationActions
newPossibleRemediationActions :: PossibleRemediationActions
newPossibleRemediationActions =
  PossibleRemediationActions' :: Maybe [PossibleRemediationAction]
-> Maybe Text -> PossibleRemediationActions
PossibleRemediationActions'
    { $sel:actions:PossibleRemediationActions' :: Maybe [PossibleRemediationAction]
actions =
        Maybe [PossibleRemediationAction]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:PossibleRemediationActions' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the actions.
possibleRemediationActions_actions :: Lens.Lens' PossibleRemediationActions (Prelude.Maybe [PossibleRemediationAction])
possibleRemediationActions_actions :: (Maybe [PossibleRemediationAction]
 -> f (Maybe [PossibleRemediationAction]))
-> PossibleRemediationActions -> f PossibleRemediationActions
possibleRemediationActions_actions = (PossibleRemediationActions -> Maybe [PossibleRemediationAction])
-> (PossibleRemediationActions
    -> Maybe [PossibleRemediationAction] -> PossibleRemediationActions)
-> Lens
     PossibleRemediationActions
     PossibleRemediationActions
     (Maybe [PossibleRemediationAction])
     (Maybe [PossibleRemediationAction])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PossibleRemediationActions' {Maybe [PossibleRemediationAction]
actions :: Maybe [PossibleRemediationAction]
$sel:actions:PossibleRemediationActions' :: PossibleRemediationActions -> Maybe [PossibleRemediationAction]
actions} -> Maybe [PossibleRemediationAction]
actions) (\s :: PossibleRemediationActions
s@PossibleRemediationActions' {} Maybe [PossibleRemediationAction]
a -> PossibleRemediationActions
s {$sel:actions:PossibleRemediationActions' :: Maybe [PossibleRemediationAction]
actions = Maybe [PossibleRemediationAction]
a} :: PossibleRemediationActions) ((Maybe [PossibleRemediationAction]
  -> f (Maybe [PossibleRemediationAction]))
 -> PossibleRemediationActions -> f PossibleRemediationActions)
-> ((Maybe [PossibleRemediationAction]
     -> f (Maybe [PossibleRemediationAction]))
    -> Maybe [PossibleRemediationAction]
    -> f (Maybe [PossibleRemediationAction]))
-> (Maybe [PossibleRemediationAction]
    -> f (Maybe [PossibleRemediationAction]))
-> PossibleRemediationActions
-> f PossibleRemediationActions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PossibleRemediationAction]
  [PossibleRemediationAction]
  [PossibleRemediationAction]
  [PossibleRemediationAction]
-> Iso
     (Maybe [PossibleRemediationAction])
     (Maybe [PossibleRemediationAction])
     (Maybe [PossibleRemediationAction])
     (Maybe [PossibleRemediationAction])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [PossibleRemediationAction]
  [PossibleRemediationAction]
  [PossibleRemediationAction]
  [PossibleRemediationAction]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A description of the possible remediation actions list.
possibleRemediationActions_description :: Lens.Lens' PossibleRemediationActions (Prelude.Maybe Prelude.Text)
possibleRemediationActions_description :: (Maybe Text -> f (Maybe Text))
-> PossibleRemediationActions -> f PossibleRemediationActions
possibleRemediationActions_description = (PossibleRemediationActions -> Maybe Text)
-> (PossibleRemediationActions
    -> Maybe Text -> PossibleRemediationActions)
-> Lens
     PossibleRemediationActions
     PossibleRemediationActions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PossibleRemediationActions' {Maybe Text
description :: Maybe Text
$sel:description:PossibleRemediationActions' :: PossibleRemediationActions -> Maybe Text
description} -> Maybe Text
description) (\s :: PossibleRemediationActions
s@PossibleRemediationActions' {} Maybe Text
a -> PossibleRemediationActions
s {$sel:description:PossibleRemediationActions' :: Maybe Text
description = Maybe Text
a} :: PossibleRemediationActions)

instance Core.FromJSON PossibleRemediationActions where
  parseJSON :: Value -> Parser PossibleRemediationActions
parseJSON =
    String
-> (Object -> Parser PossibleRemediationActions)
-> Value
-> Parser PossibleRemediationActions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PossibleRemediationActions"
      ( \Object
x ->
          Maybe [PossibleRemediationAction]
-> Maybe Text -> PossibleRemediationActions
PossibleRemediationActions'
            (Maybe [PossibleRemediationAction]
 -> Maybe Text -> PossibleRemediationActions)
-> Parser (Maybe [PossibleRemediationAction])
-> Parser (Maybe Text -> PossibleRemediationActions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe (Maybe [PossibleRemediationAction]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Actions" Parser (Maybe (Maybe [PossibleRemediationAction]))
-> Maybe [PossibleRemediationAction]
-> Parser (Maybe [PossibleRemediationAction])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PossibleRemediationAction]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Text -> PossibleRemediationActions)
-> Parser (Maybe Text) -> Parser PossibleRemediationActions
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")
      )

instance Prelude.Hashable PossibleRemediationActions

instance Prelude.NFData PossibleRemediationActions