{-# 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.ComplianceByConfigRule where
import Amazonka.Config.Types.Compliance
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComplianceByConfigRule = ComplianceByConfigRule'
{
ComplianceByConfigRule -> Maybe Compliance
compliance :: Prelude.Maybe Compliance,
ComplianceByConfigRule -> Maybe Text
configRuleName :: Prelude.Maybe Prelude.Text
}
deriving (ComplianceByConfigRule -> ComplianceByConfigRule -> Bool
(ComplianceByConfigRule -> ComplianceByConfigRule -> Bool)
-> (ComplianceByConfigRule -> ComplianceByConfigRule -> Bool)
-> Eq ComplianceByConfigRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComplianceByConfigRule -> ComplianceByConfigRule -> Bool
$c/= :: ComplianceByConfigRule -> ComplianceByConfigRule -> Bool
== :: ComplianceByConfigRule -> ComplianceByConfigRule -> Bool
$c== :: ComplianceByConfigRule -> ComplianceByConfigRule -> Bool
Prelude.Eq, ReadPrec [ComplianceByConfigRule]
ReadPrec ComplianceByConfigRule
Int -> ReadS ComplianceByConfigRule
ReadS [ComplianceByConfigRule]
(Int -> ReadS ComplianceByConfigRule)
-> ReadS [ComplianceByConfigRule]
-> ReadPrec ComplianceByConfigRule
-> ReadPrec [ComplianceByConfigRule]
-> Read ComplianceByConfigRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComplianceByConfigRule]
$creadListPrec :: ReadPrec [ComplianceByConfigRule]
readPrec :: ReadPrec ComplianceByConfigRule
$creadPrec :: ReadPrec ComplianceByConfigRule
readList :: ReadS [ComplianceByConfigRule]
$creadList :: ReadS [ComplianceByConfigRule]
readsPrec :: Int -> ReadS ComplianceByConfigRule
$creadsPrec :: Int -> ReadS ComplianceByConfigRule
Prelude.Read, Int -> ComplianceByConfigRule -> ShowS
[ComplianceByConfigRule] -> ShowS
ComplianceByConfigRule -> String
(Int -> ComplianceByConfigRule -> ShowS)
-> (ComplianceByConfigRule -> String)
-> ([ComplianceByConfigRule] -> ShowS)
-> Show ComplianceByConfigRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComplianceByConfigRule] -> ShowS
$cshowList :: [ComplianceByConfigRule] -> ShowS
show :: ComplianceByConfigRule -> String
$cshow :: ComplianceByConfigRule -> String
showsPrec :: Int -> ComplianceByConfigRule -> ShowS
$cshowsPrec :: Int -> ComplianceByConfigRule -> ShowS
Prelude.Show, (forall x. ComplianceByConfigRule -> Rep ComplianceByConfigRule x)
-> (forall x.
Rep ComplianceByConfigRule x -> ComplianceByConfigRule)
-> Generic ComplianceByConfigRule
forall x. Rep ComplianceByConfigRule x -> ComplianceByConfigRule
forall x. ComplianceByConfigRule -> Rep ComplianceByConfigRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComplianceByConfigRule x -> ComplianceByConfigRule
$cfrom :: forall x. ComplianceByConfigRule -> Rep ComplianceByConfigRule x
Prelude.Generic)
newComplianceByConfigRule ::
ComplianceByConfigRule
newComplianceByConfigRule :: ComplianceByConfigRule
newComplianceByConfigRule =
ComplianceByConfigRule' :: Maybe Compliance -> Maybe Text -> ComplianceByConfigRule
ComplianceByConfigRule'
{ $sel:compliance:ComplianceByConfigRule' :: Maybe Compliance
compliance =
Maybe Compliance
forall a. Maybe a
Prelude.Nothing,
$sel:configRuleName:ComplianceByConfigRule' :: Maybe Text
configRuleName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
complianceByConfigRule_compliance :: Lens.Lens' ComplianceByConfigRule (Prelude.Maybe Compliance)
complianceByConfigRule_compliance :: (Maybe Compliance -> f (Maybe Compliance))
-> ComplianceByConfigRule -> f ComplianceByConfigRule
complianceByConfigRule_compliance = (ComplianceByConfigRule -> Maybe Compliance)
-> (ComplianceByConfigRule
-> Maybe Compliance -> ComplianceByConfigRule)
-> Lens
ComplianceByConfigRule
ComplianceByConfigRule
(Maybe Compliance)
(Maybe Compliance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceByConfigRule' {Maybe Compliance
compliance :: Maybe Compliance
$sel:compliance:ComplianceByConfigRule' :: ComplianceByConfigRule -> Maybe Compliance
compliance} -> Maybe Compliance
compliance) (\s :: ComplianceByConfigRule
s@ComplianceByConfigRule' {} Maybe Compliance
a -> ComplianceByConfigRule
s {$sel:compliance:ComplianceByConfigRule' :: Maybe Compliance
compliance = Maybe Compliance
a} :: ComplianceByConfigRule)
complianceByConfigRule_configRuleName :: Lens.Lens' ComplianceByConfigRule (Prelude.Maybe Prelude.Text)
complianceByConfigRule_configRuleName :: (Maybe Text -> f (Maybe Text))
-> ComplianceByConfigRule -> f ComplianceByConfigRule
complianceByConfigRule_configRuleName = (ComplianceByConfigRule -> Maybe Text)
-> (ComplianceByConfigRule -> Maybe Text -> ComplianceByConfigRule)
-> Lens
ComplianceByConfigRule
ComplianceByConfigRule
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceByConfigRule' {Maybe Text
configRuleName :: Maybe Text
$sel:configRuleName:ComplianceByConfigRule' :: ComplianceByConfigRule -> Maybe Text
configRuleName} -> Maybe Text
configRuleName) (\s :: ComplianceByConfigRule
s@ComplianceByConfigRule' {} Maybe Text
a -> ComplianceByConfigRule
s {$sel:configRuleName:ComplianceByConfigRule' :: Maybe Text
configRuleName = Maybe Text
a} :: ComplianceByConfigRule)
instance Core.FromJSON ComplianceByConfigRule where
parseJSON :: Value -> Parser ComplianceByConfigRule
parseJSON =
String
-> (Object -> Parser ComplianceByConfigRule)
-> Value
-> Parser ComplianceByConfigRule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComplianceByConfigRule"
( \Object
x ->
Maybe Compliance -> Maybe Text -> ComplianceByConfigRule
ComplianceByConfigRule'
(Maybe Compliance -> Maybe Text -> ComplianceByConfigRule)
-> Parser (Maybe Compliance)
-> Parser (Maybe Text -> ComplianceByConfigRule)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Compliance)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Compliance")
Parser (Maybe Text -> ComplianceByConfigRule)
-> Parser (Maybe Text) -> Parser ComplianceByConfigRule
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
"ConfigRuleName")
)
instance Prelude.Hashable ComplianceByConfigRule
instance Prelude.NFData ComplianceByConfigRule