{-# 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.PolicySummary where
import qualified Amazonka.Core as Core
import Amazonka.FMS.Types.SecurityServiceType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PolicySummary = PolicySummary'
{
PolicySummary -> Maybe Text
policyName :: Prelude.Maybe Prelude.Text,
PolicySummary -> Maybe Bool
remediationEnabled :: Prelude.Maybe Prelude.Bool,
PolicySummary -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
PolicySummary -> Maybe Text
policyId :: Prelude.Maybe Prelude.Text,
PolicySummary -> Maybe Bool
deleteUnusedFMManagedResources :: Prelude.Maybe Prelude.Bool,
PolicySummary -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
PolicySummary -> Maybe SecurityServiceType
securityServiceType :: Prelude.Maybe SecurityServiceType
}
deriving (PolicySummary -> PolicySummary -> Bool
(PolicySummary -> PolicySummary -> Bool)
-> (PolicySummary -> PolicySummary -> Bool) -> Eq PolicySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicySummary -> PolicySummary -> Bool
$c/= :: PolicySummary -> PolicySummary -> Bool
== :: PolicySummary -> PolicySummary -> Bool
$c== :: PolicySummary -> PolicySummary -> Bool
Prelude.Eq, ReadPrec [PolicySummary]
ReadPrec PolicySummary
Int -> ReadS PolicySummary
ReadS [PolicySummary]
(Int -> ReadS PolicySummary)
-> ReadS [PolicySummary]
-> ReadPrec PolicySummary
-> ReadPrec [PolicySummary]
-> Read PolicySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicySummary]
$creadListPrec :: ReadPrec [PolicySummary]
readPrec :: ReadPrec PolicySummary
$creadPrec :: ReadPrec PolicySummary
readList :: ReadS [PolicySummary]
$creadList :: ReadS [PolicySummary]
readsPrec :: Int -> ReadS PolicySummary
$creadsPrec :: Int -> ReadS PolicySummary
Prelude.Read, Int -> PolicySummary -> ShowS
[PolicySummary] -> ShowS
PolicySummary -> String
(Int -> PolicySummary -> ShowS)
-> (PolicySummary -> String)
-> ([PolicySummary] -> ShowS)
-> Show PolicySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicySummary] -> ShowS
$cshowList :: [PolicySummary] -> ShowS
show :: PolicySummary -> String
$cshow :: PolicySummary -> String
showsPrec :: Int -> PolicySummary -> ShowS
$cshowsPrec :: Int -> PolicySummary -> ShowS
Prelude.Show, (forall x. PolicySummary -> Rep PolicySummary x)
-> (forall x. Rep PolicySummary x -> PolicySummary)
-> Generic PolicySummary
forall x. Rep PolicySummary x -> PolicySummary
forall x. PolicySummary -> Rep PolicySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicySummary x -> PolicySummary
$cfrom :: forall x. PolicySummary -> Rep PolicySummary x
Prelude.Generic)
newPolicySummary ::
PolicySummary
newPolicySummary :: PolicySummary
newPolicySummary =
PolicySummary' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary
PolicySummary'
{ $sel:policyName:PolicySummary' :: Maybe Text
policyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:remediationEnabled:PolicySummary' :: Maybe Bool
remediationEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:PolicySummary' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:policyId:PolicySummary' :: Maybe Text
policyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deleteUnusedFMManagedResources:PolicySummary' :: Maybe Bool
deleteUnusedFMManagedResources = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:policyArn:PolicySummary' :: Maybe Text
policyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:securityServiceType:PolicySummary' :: Maybe SecurityServiceType
securityServiceType = Maybe SecurityServiceType
forall a. Maybe a
Prelude.Nothing
}
policySummary_policyName :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Text)
policySummary_policyName :: (Maybe Text -> f (Maybe Text)) -> PolicySummary -> f PolicySummary
policySummary_policyName = (PolicySummary -> Maybe Text)
-> (PolicySummary -> Maybe Text -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Text
policyName :: Maybe Text
$sel:policyName:PolicySummary' :: PolicySummary -> Maybe Text
policyName} -> Maybe Text
policyName) (\s :: PolicySummary
s@PolicySummary' {} Maybe Text
a -> PolicySummary
s {$sel:policyName:PolicySummary' :: Maybe Text
policyName = Maybe Text
a} :: PolicySummary)
policySummary_remediationEnabled :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Bool)
policySummary_remediationEnabled :: (Maybe Bool -> f (Maybe Bool)) -> PolicySummary -> f PolicySummary
policySummary_remediationEnabled = (PolicySummary -> Maybe Bool)
-> (PolicySummary -> Maybe Bool -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Bool
remediationEnabled :: Maybe Bool
$sel:remediationEnabled:PolicySummary' :: PolicySummary -> Maybe Bool
remediationEnabled} -> Maybe Bool
remediationEnabled) (\s :: PolicySummary
s@PolicySummary' {} Maybe Bool
a -> PolicySummary
s {$sel:remediationEnabled:PolicySummary' :: Maybe Bool
remediationEnabled = Maybe Bool
a} :: PolicySummary)
policySummary_resourceType :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Text)
policySummary_resourceType :: (Maybe Text -> f (Maybe Text)) -> PolicySummary -> f PolicySummary
policySummary_resourceType = (PolicySummary -> Maybe Text)
-> (PolicySummary -> Maybe Text -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:PolicySummary' :: PolicySummary -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: PolicySummary
s@PolicySummary' {} Maybe Text
a -> PolicySummary
s {$sel:resourceType:PolicySummary' :: Maybe Text
resourceType = Maybe Text
a} :: PolicySummary)
policySummary_policyId :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Text)
policySummary_policyId :: (Maybe Text -> f (Maybe Text)) -> PolicySummary -> f PolicySummary
policySummary_policyId = (PolicySummary -> Maybe Text)
-> (PolicySummary -> Maybe Text -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Text
policyId :: Maybe Text
$sel:policyId:PolicySummary' :: PolicySummary -> Maybe Text
policyId} -> Maybe Text
policyId) (\s :: PolicySummary
s@PolicySummary' {} Maybe Text
a -> PolicySummary
s {$sel:policyId:PolicySummary' :: Maybe Text
policyId = Maybe Text
a} :: PolicySummary)
policySummary_deleteUnusedFMManagedResources :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Bool)
policySummary_deleteUnusedFMManagedResources :: (Maybe Bool -> f (Maybe Bool)) -> PolicySummary -> f PolicySummary
policySummary_deleteUnusedFMManagedResources = (PolicySummary -> Maybe Bool)
-> (PolicySummary -> Maybe Bool -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Bool
deleteUnusedFMManagedResources :: Maybe Bool
$sel:deleteUnusedFMManagedResources:PolicySummary' :: PolicySummary -> Maybe Bool
deleteUnusedFMManagedResources} -> Maybe Bool
deleteUnusedFMManagedResources) (\s :: PolicySummary
s@PolicySummary' {} Maybe Bool
a -> PolicySummary
s {$sel:deleteUnusedFMManagedResources:PolicySummary' :: Maybe Bool
deleteUnusedFMManagedResources = Maybe Bool
a} :: PolicySummary)
policySummary_policyArn :: Lens.Lens' PolicySummary (Prelude.Maybe Prelude.Text)
policySummary_policyArn :: (Maybe Text -> f (Maybe Text)) -> PolicySummary -> f PolicySummary
policySummary_policyArn = (PolicySummary -> Maybe Text)
-> (PolicySummary -> Maybe Text -> PolicySummary)
-> Lens PolicySummary PolicySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:PolicySummary' :: PolicySummary -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: PolicySummary
s@PolicySummary' {} Maybe Text
a -> PolicySummary
s {$sel:policyArn:PolicySummary' :: Maybe Text
policyArn = Maybe Text
a} :: PolicySummary)
policySummary_securityServiceType :: Lens.Lens' PolicySummary (Prelude.Maybe SecurityServiceType)
policySummary_securityServiceType :: (Maybe SecurityServiceType -> f (Maybe SecurityServiceType))
-> PolicySummary -> f PolicySummary
policySummary_securityServiceType = (PolicySummary -> Maybe SecurityServiceType)
-> (PolicySummary -> Maybe SecurityServiceType -> PolicySummary)
-> Lens
PolicySummary
PolicySummary
(Maybe SecurityServiceType)
(Maybe SecurityServiceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicySummary' {Maybe SecurityServiceType
securityServiceType :: Maybe SecurityServiceType
$sel:securityServiceType:PolicySummary' :: PolicySummary -> Maybe SecurityServiceType
securityServiceType} -> Maybe SecurityServiceType
securityServiceType) (\s :: PolicySummary
s@PolicySummary' {} Maybe SecurityServiceType
a -> PolicySummary
s {$sel:securityServiceType:PolicySummary' :: Maybe SecurityServiceType
securityServiceType = Maybe SecurityServiceType
a} :: PolicySummary)
instance Core.FromJSON PolicySummary where
parseJSON :: Value -> Parser PolicySummary
parseJSON =
String
-> (Object -> Parser PolicySummary)
-> Value
-> Parser PolicySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PolicySummary"
( \Object
x ->
Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary
PolicySummary'
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary)
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
"PolicyName")
Parser
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary)
forall (f :: * -> *) a b. Applicative f => 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
"RemediationEnabled")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary)
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 Text
-> Maybe Bool
-> Maybe Text
-> Maybe SecurityServiceType
-> PolicySummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Text -> Maybe SecurityServiceType -> PolicySummary)
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
"PolicyId")
Parser
(Maybe Bool
-> Maybe Text -> Maybe SecurityServiceType -> PolicySummary)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text -> Maybe SecurityServiceType -> PolicySummary)
forall (f :: * -> *) a b. Applicative f => 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
"DeleteUnusedFMManagedResources")
Parser (Maybe Text -> Maybe SecurityServiceType -> PolicySummary)
-> Parser (Maybe Text)
-> Parser (Maybe SecurityServiceType -> PolicySummary)
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
"PolicyArn")
Parser (Maybe SecurityServiceType -> PolicySummary)
-> Parser (Maybe SecurityServiceType) -> Parser PolicySummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SecurityServiceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityServiceType")
)
instance Prelude.Hashable PolicySummary
instance Prelude.NFData PolicySummary