{-# 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.Config.Types.RemediationParameterValue where
import Amazonka.Config.Types.ResourceValue
import Amazonka.Config.Types.StaticValue
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RemediationParameterValue = RemediationParameterValue'
{
RemediationParameterValue -> Maybe StaticValue
staticValue :: Prelude.Maybe StaticValue,
RemediationParameterValue -> Maybe ResourceValue
resourceValue :: Prelude.Maybe ResourceValue
}
deriving (RemediationParameterValue -> RemediationParameterValue -> Bool
(RemediationParameterValue -> RemediationParameterValue -> Bool)
-> (RemediationParameterValue -> RemediationParameterValue -> Bool)
-> Eq RemediationParameterValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemediationParameterValue -> RemediationParameterValue -> Bool
$c/= :: RemediationParameterValue -> RemediationParameterValue -> Bool
== :: RemediationParameterValue -> RemediationParameterValue -> Bool
$c== :: RemediationParameterValue -> RemediationParameterValue -> Bool
Prelude.Eq, ReadPrec [RemediationParameterValue]
ReadPrec RemediationParameterValue
Int -> ReadS RemediationParameterValue
ReadS [RemediationParameterValue]
(Int -> ReadS RemediationParameterValue)
-> ReadS [RemediationParameterValue]
-> ReadPrec RemediationParameterValue
-> ReadPrec [RemediationParameterValue]
-> Read RemediationParameterValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemediationParameterValue]
$creadListPrec :: ReadPrec [RemediationParameterValue]
readPrec :: ReadPrec RemediationParameterValue
$creadPrec :: ReadPrec RemediationParameterValue
readList :: ReadS [RemediationParameterValue]
$creadList :: ReadS [RemediationParameterValue]
readsPrec :: Int -> ReadS RemediationParameterValue
$creadsPrec :: Int -> ReadS RemediationParameterValue
Prelude.Read, Int -> RemediationParameterValue -> ShowS
[RemediationParameterValue] -> ShowS
RemediationParameterValue -> String
(Int -> RemediationParameterValue -> ShowS)
-> (RemediationParameterValue -> String)
-> ([RemediationParameterValue] -> ShowS)
-> Show RemediationParameterValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemediationParameterValue] -> ShowS
$cshowList :: [RemediationParameterValue] -> ShowS
show :: RemediationParameterValue -> String
$cshow :: RemediationParameterValue -> String
showsPrec :: Int -> RemediationParameterValue -> ShowS
$cshowsPrec :: Int -> RemediationParameterValue -> ShowS
Prelude.Show, (forall x.
RemediationParameterValue -> Rep RemediationParameterValue x)
-> (forall x.
Rep RemediationParameterValue x -> RemediationParameterValue)
-> Generic RemediationParameterValue
forall x.
Rep RemediationParameterValue x -> RemediationParameterValue
forall x.
RemediationParameterValue -> Rep RemediationParameterValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemediationParameterValue x -> RemediationParameterValue
$cfrom :: forall x.
RemediationParameterValue -> Rep RemediationParameterValue x
Prelude.Generic)
newRemediationParameterValue ::
RemediationParameterValue
newRemediationParameterValue :: RemediationParameterValue
newRemediationParameterValue =
RemediationParameterValue' :: Maybe StaticValue
-> Maybe ResourceValue -> RemediationParameterValue
RemediationParameterValue'
{ $sel:staticValue:RemediationParameterValue' :: Maybe StaticValue
staticValue =
Maybe StaticValue
forall a. Maybe a
Prelude.Nothing,
$sel:resourceValue:RemediationParameterValue' :: Maybe ResourceValue
resourceValue = Maybe ResourceValue
forall a. Maybe a
Prelude.Nothing
}
remediationParameterValue_staticValue :: Lens.Lens' RemediationParameterValue (Prelude.Maybe StaticValue)
remediationParameterValue_staticValue :: (Maybe StaticValue -> f (Maybe StaticValue))
-> RemediationParameterValue -> f RemediationParameterValue
remediationParameterValue_staticValue = (RemediationParameterValue -> Maybe StaticValue)
-> (RemediationParameterValue
-> Maybe StaticValue -> RemediationParameterValue)
-> Lens
RemediationParameterValue
RemediationParameterValue
(Maybe StaticValue)
(Maybe StaticValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationParameterValue' {Maybe StaticValue
staticValue :: Maybe StaticValue
$sel:staticValue:RemediationParameterValue' :: RemediationParameterValue -> Maybe StaticValue
staticValue} -> Maybe StaticValue
staticValue) (\s :: RemediationParameterValue
s@RemediationParameterValue' {} Maybe StaticValue
a -> RemediationParameterValue
s {$sel:staticValue:RemediationParameterValue' :: Maybe StaticValue
staticValue = Maybe StaticValue
a} :: RemediationParameterValue)
remediationParameterValue_resourceValue :: Lens.Lens' RemediationParameterValue (Prelude.Maybe ResourceValue)
remediationParameterValue_resourceValue :: (Maybe ResourceValue -> f (Maybe ResourceValue))
-> RemediationParameterValue -> f RemediationParameterValue
remediationParameterValue_resourceValue = (RemediationParameterValue -> Maybe ResourceValue)
-> (RemediationParameterValue
-> Maybe ResourceValue -> RemediationParameterValue)
-> Lens
RemediationParameterValue
RemediationParameterValue
(Maybe ResourceValue)
(Maybe ResourceValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationParameterValue' {Maybe ResourceValue
resourceValue :: Maybe ResourceValue
$sel:resourceValue:RemediationParameterValue' :: RemediationParameterValue -> Maybe ResourceValue
resourceValue} -> Maybe ResourceValue
resourceValue) (\s :: RemediationParameterValue
s@RemediationParameterValue' {} Maybe ResourceValue
a -> RemediationParameterValue
s {$sel:resourceValue:RemediationParameterValue' :: Maybe ResourceValue
resourceValue = Maybe ResourceValue
a} :: RemediationParameterValue)
instance Core.FromJSON RemediationParameterValue where
parseJSON :: Value -> Parser RemediationParameterValue
parseJSON =
String
-> (Object -> Parser RemediationParameterValue)
-> Value
-> Parser RemediationParameterValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RemediationParameterValue"
( \Object
x ->
Maybe StaticValue
-> Maybe ResourceValue -> RemediationParameterValue
RemediationParameterValue'
(Maybe StaticValue
-> Maybe ResourceValue -> RemediationParameterValue)
-> Parser (Maybe StaticValue)
-> Parser (Maybe ResourceValue -> RemediationParameterValue)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe StaticValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StaticValue")
Parser (Maybe ResourceValue -> RemediationParameterValue)
-> Parser (Maybe ResourceValue) -> Parser RemediationParameterValue
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceValue")
)
instance Prelude.Hashable RemediationParameterValue
instance Prelude.NFData RemediationParameterValue
instance Core.ToJSON RemediationParameterValue where
toJSON :: RemediationParameterValue -> Value
toJSON RemediationParameterValue' {Maybe ResourceValue
Maybe StaticValue
resourceValue :: Maybe ResourceValue
staticValue :: Maybe StaticValue
$sel:resourceValue:RemediationParameterValue' :: RemediationParameterValue -> Maybe ResourceValue
$sel:staticValue:RemediationParameterValue' :: RemediationParameterValue -> Maybe StaticValue
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"StaticValue" Text -> StaticValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (StaticValue -> Pair) -> Maybe StaticValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StaticValue
staticValue,
(Text
"ResourceValue" Text -> ResourceValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ResourceValue -> Pair) -> Maybe ResourceValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceValue
resourceValue
]
)