{-# 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.ComplianceByResource 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 ComplianceByResource = ComplianceByResource'
{
ComplianceByResource -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
ComplianceByResource -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
ComplianceByResource -> Maybe Compliance
compliance :: Prelude.Maybe Compliance
}
deriving (ComplianceByResource -> ComplianceByResource -> Bool
(ComplianceByResource -> ComplianceByResource -> Bool)
-> (ComplianceByResource -> ComplianceByResource -> Bool)
-> Eq ComplianceByResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComplianceByResource -> ComplianceByResource -> Bool
$c/= :: ComplianceByResource -> ComplianceByResource -> Bool
== :: ComplianceByResource -> ComplianceByResource -> Bool
$c== :: ComplianceByResource -> ComplianceByResource -> Bool
Prelude.Eq, ReadPrec [ComplianceByResource]
ReadPrec ComplianceByResource
Int -> ReadS ComplianceByResource
ReadS [ComplianceByResource]
(Int -> ReadS ComplianceByResource)
-> ReadS [ComplianceByResource]
-> ReadPrec ComplianceByResource
-> ReadPrec [ComplianceByResource]
-> Read ComplianceByResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComplianceByResource]
$creadListPrec :: ReadPrec [ComplianceByResource]
readPrec :: ReadPrec ComplianceByResource
$creadPrec :: ReadPrec ComplianceByResource
readList :: ReadS [ComplianceByResource]
$creadList :: ReadS [ComplianceByResource]
readsPrec :: Int -> ReadS ComplianceByResource
$creadsPrec :: Int -> ReadS ComplianceByResource
Prelude.Read, Int -> ComplianceByResource -> ShowS
[ComplianceByResource] -> ShowS
ComplianceByResource -> String
(Int -> ComplianceByResource -> ShowS)
-> (ComplianceByResource -> String)
-> ([ComplianceByResource] -> ShowS)
-> Show ComplianceByResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComplianceByResource] -> ShowS
$cshowList :: [ComplianceByResource] -> ShowS
show :: ComplianceByResource -> String
$cshow :: ComplianceByResource -> String
showsPrec :: Int -> ComplianceByResource -> ShowS
$cshowsPrec :: Int -> ComplianceByResource -> ShowS
Prelude.Show, (forall x. ComplianceByResource -> Rep ComplianceByResource x)
-> (forall x. Rep ComplianceByResource x -> ComplianceByResource)
-> Generic ComplianceByResource
forall x. Rep ComplianceByResource x -> ComplianceByResource
forall x. ComplianceByResource -> Rep ComplianceByResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComplianceByResource x -> ComplianceByResource
$cfrom :: forall x. ComplianceByResource -> Rep ComplianceByResource x
Prelude.Generic)
newComplianceByResource ::
ComplianceByResource
newComplianceByResource :: ComplianceByResource
newComplianceByResource =
ComplianceByResource' :: Maybe Text
-> Maybe Text -> Maybe Compliance -> ComplianceByResource
ComplianceByResource'
{ $sel:resourceId:ComplianceByResource' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:ComplianceByResource' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:compliance:ComplianceByResource' :: Maybe Compliance
compliance = Maybe Compliance
forall a. Maybe a
Prelude.Nothing
}
complianceByResource_resourceId :: Lens.Lens' ComplianceByResource (Prelude.Maybe Prelude.Text)
complianceByResource_resourceId :: (Maybe Text -> f (Maybe Text))
-> ComplianceByResource -> f ComplianceByResource
complianceByResource_resourceId = (ComplianceByResource -> Maybe Text)
-> (ComplianceByResource -> Maybe Text -> ComplianceByResource)
-> Lens
ComplianceByResource ComplianceByResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceByResource' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:ComplianceByResource' :: ComplianceByResource -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: ComplianceByResource
s@ComplianceByResource' {} Maybe Text
a -> ComplianceByResource
s {$sel:resourceId:ComplianceByResource' :: Maybe Text
resourceId = Maybe Text
a} :: ComplianceByResource)
complianceByResource_resourceType :: Lens.Lens' ComplianceByResource (Prelude.Maybe Prelude.Text)
complianceByResource_resourceType :: (Maybe Text -> f (Maybe Text))
-> ComplianceByResource -> f ComplianceByResource
complianceByResource_resourceType = (ComplianceByResource -> Maybe Text)
-> (ComplianceByResource -> Maybe Text -> ComplianceByResource)
-> Lens
ComplianceByResource ComplianceByResource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceByResource' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:ComplianceByResource' :: ComplianceByResource -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: ComplianceByResource
s@ComplianceByResource' {} Maybe Text
a -> ComplianceByResource
s {$sel:resourceType:ComplianceByResource' :: Maybe Text
resourceType = Maybe Text
a} :: ComplianceByResource)
complianceByResource_compliance :: Lens.Lens' ComplianceByResource (Prelude.Maybe Compliance)
complianceByResource_compliance :: (Maybe Compliance -> f (Maybe Compliance))
-> ComplianceByResource -> f ComplianceByResource
complianceByResource_compliance = (ComplianceByResource -> Maybe Compliance)
-> (ComplianceByResource
-> Maybe Compliance -> ComplianceByResource)
-> Lens
ComplianceByResource
ComplianceByResource
(Maybe Compliance)
(Maybe Compliance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceByResource' {Maybe Compliance
compliance :: Maybe Compliance
$sel:compliance:ComplianceByResource' :: ComplianceByResource -> Maybe Compliance
compliance} -> Maybe Compliance
compliance) (\s :: ComplianceByResource
s@ComplianceByResource' {} Maybe Compliance
a -> ComplianceByResource
s {$sel:compliance:ComplianceByResource' :: Maybe Compliance
compliance = Maybe Compliance
a} :: ComplianceByResource)
instance Core.FromJSON ComplianceByResource where
parseJSON :: Value -> Parser ComplianceByResource
parseJSON =
String
-> (Object -> Parser ComplianceByResource)
-> Value
-> Parser ComplianceByResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComplianceByResource"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Compliance -> ComplianceByResource
ComplianceByResource'
(Maybe Text
-> Maybe Text -> Maybe Compliance -> ComplianceByResource)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Compliance -> ComplianceByResource)
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
"ResourceId")
Parser (Maybe Text -> Maybe Compliance -> ComplianceByResource)
-> Parser (Maybe Text)
-> Parser (Maybe Compliance -> ComplianceByResource)
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
"ResourceType")
Parser (Maybe Compliance -> ComplianceByResource)
-> Parser (Maybe Compliance) -> Parser ComplianceByResource
forall (f :: * -> *) a b. Applicative f => 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")
)
instance Prelude.Hashable ComplianceByResource
instance Prelude.NFData ComplianceByResource