{-# 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.Policy where
import qualified Amazonka.Core as Core
import Amazonka.FMS.Types.CustomerPolicyScopeIdType
import Amazonka.FMS.Types.ResourceTag
import Amazonka.FMS.Types.SecurityServicePolicyData
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Policy = Policy'
{
Policy -> Maybe Text
policyId :: Prelude.Maybe Prelude.Text,
Policy -> Maybe [Text]
resourceTypeList :: Prelude.Maybe [Prelude.Text],
Policy -> Maybe [ResourceTag]
resourceTags :: Prelude.Maybe [ResourceTag],
Policy -> Maybe Text
policyUpdateToken :: Prelude.Maybe Prelude.Text,
Policy -> Maybe Bool
deleteUnusedFMManagedResources :: Prelude.Maybe Prelude.Bool,
Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap :: Prelude.Maybe (Prelude.HashMap CustomerPolicyScopeIdType [Prelude.Text]),
Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap :: Prelude.Maybe (Prelude.HashMap CustomerPolicyScopeIdType [Prelude.Text]),
Policy -> Text
policyName :: Prelude.Text,
Policy -> SecurityServicePolicyData
securityServicePolicyData :: SecurityServicePolicyData,
Policy -> Text
resourceType :: Prelude.Text,
Policy -> Bool
excludeResourceTags :: Prelude.Bool,
Policy -> Bool
remediationEnabled :: Prelude.Bool
}
deriving (Policy -> Policy -> Bool
(Policy -> Policy -> Bool)
-> (Policy -> Policy -> Bool) -> Eq Policy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Policy -> Policy -> Bool
$c/= :: Policy -> Policy -> Bool
== :: Policy -> Policy -> Bool
$c== :: Policy -> Policy -> Bool
Prelude.Eq, ReadPrec [Policy]
ReadPrec Policy
Int -> ReadS Policy
ReadS [Policy]
(Int -> ReadS Policy)
-> ReadS [Policy]
-> ReadPrec Policy
-> ReadPrec [Policy]
-> Read Policy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Policy]
$creadListPrec :: ReadPrec [Policy]
readPrec :: ReadPrec Policy
$creadPrec :: ReadPrec Policy
readList :: ReadS [Policy]
$creadList :: ReadS [Policy]
readsPrec :: Int -> ReadS Policy
$creadsPrec :: Int -> ReadS Policy
Prelude.Read, Int -> Policy -> ShowS
[Policy] -> ShowS
Policy -> String
(Int -> Policy -> ShowS)
-> (Policy -> String) -> ([Policy] -> ShowS) -> Show Policy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Policy] -> ShowS
$cshowList :: [Policy] -> ShowS
show :: Policy -> String
$cshow :: Policy -> String
showsPrec :: Int -> Policy -> ShowS
$cshowsPrec :: Int -> Policy -> ShowS
Prelude.Show, (forall x. Policy -> Rep Policy x)
-> (forall x. Rep Policy x -> Policy) -> Generic Policy
forall x. Rep Policy x -> Policy
forall x. Policy -> Rep Policy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Policy x -> Policy
$cfrom :: forall x. Policy -> Rep Policy x
Prelude.Generic)
newPolicy ::
Prelude.Text ->
SecurityServicePolicyData ->
Prelude.Text ->
Prelude.Bool ->
Prelude.Bool ->
Policy
newPolicy :: Text -> SecurityServicePolicyData -> Text -> Bool -> Bool -> Policy
newPolicy
Text
pPolicyName_
SecurityServicePolicyData
pSecurityServicePolicyData_
Text
pResourceType_
Bool
pExcludeResourceTags_
Bool
pRemediationEnabled_ =
Policy' :: Maybe Text
-> Maybe [Text]
-> Maybe [ResourceTag]
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy
Policy'
{ $sel:policyId:Policy' :: Maybe Text
policyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceTypeList:Policy' :: Maybe [Text]
resourceTypeList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:resourceTags:Policy' :: Maybe [ResourceTag]
resourceTags = Maybe [ResourceTag]
forall a. Maybe a
Prelude.Nothing,
$sel:policyUpdateToken:Policy' :: Maybe Text
policyUpdateToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deleteUnusedFMManagedResources:Policy' :: Maybe Bool
deleteUnusedFMManagedResources = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:excludeMap:Policy' :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap = Maybe (HashMap CustomerPolicyScopeIdType [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:includeMap:Policy' :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap = Maybe (HashMap CustomerPolicyScopeIdType [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:policyName:Policy' :: Text
policyName = Text
pPolicyName_,
$sel:securityServicePolicyData:Policy' :: SecurityServicePolicyData
securityServicePolicyData =
SecurityServicePolicyData
pSecurityServicePolicyData_,
$sel:resourceType:Policy' :: Text
resourceType = Text
pResourceType_,
$sel:excludeResourceTags:Policy' :: Bool
excludeResourceTags = Bool
pExcludeResourceTags_,
$sel:remediationEnabled:Policy' :: Bool
remediationEnabled = Bool
pRemediationEnabled_
}
policy_policyId :: Lens.Lens' Policy (Prelude.Maybe Prelude.Text)
policy_policyId :: (Maybe Text -> f (Maybe Text)) -> Policy -> f Policy
policy_policyId = (Policy -> Maybe Text)
-> (Policy -> Maybe Text -> Policy)
-> Lens Policy Policy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe Text
policyId :: Maybe Text
$sel:policyId:Policy' :: Policy -> Maybe Text
policyId} -> Maybe Text
policyId) (\s :: Policy
s@Policy' {} Maybe Text
a -> Policy
s {$sel:policyId:Policy' :: Maybe Text
policyId = Maybe Text
a} :: Policy)
policy_resourceTypeList :: Lens.Lens' Policy (Prelude.Maybe [Prelude.Text])
policy_resourceTypeList :: (Maybe [Text] -> f (Maybe [Text])) -> Policy -> f Policy
policy_resourceTypeList = (Policy -> Maybe [Text])
-> (Policy -> Maybe [Text] -> Policy)
-> Lens Policy Policy (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe [Text]
resourceTypeList :: Maybe [Text]
$sel:resourceTypeList:Policy' :: Policy -> Maybe [Text]
resourceTypeList} -> Maybe [Text]
resourceTypeList) (\s :: Policy
s@Policy' {} Maybe [Text]
a -> Policy
s {$sel:resourceTypeList:Policy' :: Maybe [Text]
resourceTypeList = Maybe [Text]
a} :: Policy) ((Maybe [Text] -> f (Maybe [Text])) -> Policy -> f Policy)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Policy
-> f Policy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
policy_resourceTags :: Lens.Lens' Policy (Prelude.Maybe [ResourceTag])
policy_resourceTags :: (Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> Policy -> f Policy
policy_resourceTags = (Policy -> Maybe [ResourceTag])
-> (Policy -> Maybe [ResourceTag] -> Policy)
-> Lens Policy Policy (Maybe [ResourceTag]) (Maybe [ResourceTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe [ResourceTag]
resourceTags :: Maybe [ResourceTag]
$sel:resourceTags:Policy' :: Policy -> Maybe [ResourceTag]
resourceTags} -> Maybe [ResourceTag]
resourceTags) (\s :: Policy
s@Policy' {} Maybe [ResourceTag]
a -> Policy
s {$sel:resourceTags:Policy' :: Maybe [ResourceTag]
resourceTags = Maybe [ResourceTag]
a} :: Policy) ((Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> Policy -> f Policy)
-> ((Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> (Maybe [ResourceTag] -> f (Maybe [ResourceTag]))
-> Policy
-> f Policy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ResourceTag] [ResourceTag] [ResourceTag] [ResourceTag]
-> Iso
(Maybe [ResourceTag])
(Maybe [ResourceTag])
(Maybe [ResourceTag])
(Maybe [ResourceTag])
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 [ResourceTag] [ResourceTag] [ResourceTag] [ResourceTag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
policy_policyUpdateToken :: Lens.Lens' Policy (Prelude.Maybe Prelude.Text)
policy_policyUpdateToken :: (Maybe Text -> f (Maybe Text)) -> Policy -> f Policy
policy_policyUpdateToken = (Policy -> Maybe Text)
-> (Policy -> Maybe Text -> Policy)
-> Lens Policy Policy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe Text
policyUpdateToken :: Maybe Text
$sel:policyUpdateToken:Policy' :: Policy -> Maybe Text
policyUpdateToken} -> Maybe Text
policyUpdateToken) (\s :: Policy
s@Policy' {} Maybe Text
a -> Policy
s {$sel:policyUpdateToken:Policy' :: Maybe Text
policyUpdateToken = Maybe Text
a} :: Policy)
policy_deleteUnusedFMManagedResources :: Lens.Lens' Policy (Prelude.Maybe Prelude.Bool)
policy_deleteUnusedFMManagedResources :: (Maybe Bool -> f (Maybe Bool)) -> Policy -> f Policy
policy_deleteUnusedFMManagedResources = (Policy -> Maybe Bool)
-> (Policy -> Maybe Bool -> Policy)
-> Lens Policy Policy (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe Bool
deleteUnusedFMManagedResources :: Maybe Bool
$sel:deleteUnusedFMManagedResources:Policy' :: Policy -> Maybe Bool
deleteUnusedFMManagedResources} -> Maybe Bool
deleteUnusedFMManagedResources) (\s :: Policy
s@Policy' {} Maybe Bool
a -> Policy
s {$sel:deleteUnusedFMManagedResources:Policy' :: Maybe Bool
deleteUnusedFMManagedResources = Maybe Bool
a} :: Policy)
policy_excludeMap :: Lens.Lens' Policy (Prelude.Maybe (Prelude.HashMap CustomerPolicyScopeIdType [Prelude.Text]))
policy_excludeMap :: (Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Policy -> f Policy
policy_excludeMap = (Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text]))
-> (Policy
-> Maybe (HashMap CustomerPolicyScopeIdType [Text]) -> Policy)
-> Lens
Policy
Policy
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:excludeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap} -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap) (\s :: Policy
s@Policy' {} Maybe (HashMap CustomerPolicyScopeIdType [Text])
a -> Policy
s {$sel:excludeMap:Policy' :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap = Maybe (HashMap CustomerPolicyScopeIdType [Text])
a} :: Policy) ((Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Policy -> f Policy)
-> ((Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> (Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Policy
-> f Policy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
-> Iso
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
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
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
policy_includeMap :: Lens.Lens' Policy (Prelude.Maybe (Prelude.HashMap CustomerPolicyScopeIdType [Prelude.Text]))
policy_includeMap :: (Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Policy -> f Policy
policy_includeMap = (Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text]))
-> (Policy
-> Maybe (HashMap CustomerPolicyScopeIdType [Text]) -> Policy)
-> Lens
Policy
Policy
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:includeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap} -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap) (\s :: Policy
s@Policy' {} Maybe (HashMap CustomerPolicyScopeIdType [Text])
a -> Policy
s {$sel:includeMap:Policy' :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap = Maybe (HashMap CustomerPolicyScopeIdType [Text])
a} :: Policy) ((Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Policy -> f Policy)
-> ((Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> (Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> f (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Policy
-> f Policy
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
-> Iso
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
(Maybe (HashMap CustomerPolicyScopeIdType [Text]))
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
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
(HashMap CustomerPolicyScopeIdType [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
policy_policyName :: Lens.Lens' Policy Prelude.Text
policy_policyName :: (Text -> f Text) -> Policy -> f Policy
policy_policyName = (Policy -> Text)
-> (Policy -> Text -> Policy) -> Lens Policy Policy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Text
policyName :: Text
$sel:policyName:Policy' :: Policy -> Text
policyName} -> Text
policyName) (\s :: Policy
s@Policy' {} Text
a -> Policy
s {$sel:policyName:Policy' :: Text
policyName = Text
a} :: Policy)
policy_securityServicePolicyData :: Lens.Lens' Policy SecurityServicePolicyData
policy_securityServicePolicyData :: (SecurityServicePolicyData -> f SecurityServicePolicyData)
-> Policy -> f Policy
policy_securityServicePolicyData = (Policy -> SecurityServicePolicyData)
-> (Policy -> SecurityServicePolicyData -> Policy)
-> Lens
Policy Policy SecurityServicePolicyData SecurityServicePolicyData
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {SecurityServicePolicyData
securityServicePolicyData :: SecurityServicePolicyData
$sel:securityServicePolicyData:Policy' :: Policy -> SecurityServicePolicyData
securityServicePolicyData} -> SecurityServicePolicyData
securityServicePolicyData) (\s :: Policy
s@Policy' {} SecurityServicePolicyData
a -> Policy
s {$sel:securityServicePolicyData:Policy' :: SecurityServicePolicyData
securityServicePolicyData = SecurityServicePolicyData
a} :: Policy)
policy_resourceType :: Lens.Lens' Policy Prelude.Text
policy_resourceType :: (Text -> f Text) -> Policy -> f Policy
policy_resourceType = (Policy -> Text)
-> (Policy -> Text -> Policy) -> Lens Policy Policy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Text
resourceType :: Text
$sel:resourceType:Policy' :: Policy -> Text
resourceType} -> Text
resourceType) (\s :: Policy
s@Policy' {} Text
a -> Policy
s {$sel:resourceType:Policy' :: Text
resourceType = Text
a} :: Policy)
policy_excludeResourceTags :: Lens.Lens' Policy Prelude.Bool
policy_excludeResourceTags :: (Bool -> f Bool) -> Policy -> f Policy
policy_excludeResourceTags = (Policy -> Bool)
-> (Policy -> Bool -> Policy) -> Lens Policy Policy Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Bool
excludeResourceTags :: Bool
$sel:excludeResourceTags:Policy' :: Policy -> Bool
excludeResourceTags} -> Bool
excludeResourceTags) (\s :: Policy
s@Policy' {} Bool
a -> Policy
s {$sel:excludeResourceTags:Policy' :: Bool
excludeResourceTags = Bool
a} :: Policy)
policy_remediationEnabled :: Lens.Lens' Policy Prelude.Bool
policy_remediationEnabled :: (Bool -> f Bool) -> Policy -> f Policy
policy_remediationEnabled = (Policy -> Bool)
-> (Policy -> Bool -> Policy) -> Lens Policy Policy Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Policy' {Bool
remediationEnabled :: Bool
$sel:remediationEnabled:Policy' :: Policy -> Bool
remediationEnabled} -> Bool
remediationEnabled) (\s :: Policy
s@Policy' {} Bool
a -> Policy
s {$sel:remediationEnabled:Policy' :: Bool
remediationEnabled = Bool
a} :: Policy)
instance Core.FromJSON Policy where
parseJSON :: Value -> Parser Policy
parseJSON =
String -> (Object -> Parser Policy) -> Value -> Parser Policy
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Policy"
( \Object
x ->
Maybe Text
-> Maybe [Text]
-> Maybe [ResourceTag]
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy
Policy'
(Maybe Text
-> Maybe [Text]
-> Maybe [ResourceTag]
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe [ResourceTag]
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
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
"PolicyId")
Parser
(Maybe [Text]
-> Maybe [ResourceTag]
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
-> Parser (Maybe [Text])
-> Parser
(Maybe [ResourceTag]
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceTypeList"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [ResourceTag]
-> Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
-> Parser (Maybe [ResourceTag])
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ResourceTag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceTags" Parser (Maybe (Maybe [ResourceTag]))
-> Maybe [ResourceTag] -> Parser (Maybe [ResourceTag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ResourceTag]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
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
"PolicyUpdateToken")
Parser
(Maybe Bool
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
-> Parser (Maybe Bool)
-> Parser
(Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
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 (HashMap CustomerPolicyScopeIdType [Text])
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
-> Parser (Maybe (HashMap CustomerPolicyScopeIdType [Text]))
-> Parser
(Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser
(Maybe (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExcludeMap" Parser (Maybe (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Parser (Maybe (HashMap CustomerPolicyScopeIdType [Text]))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap CustomerPolicyScopeIdType [Text])
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Text
-> SecurityServicePolicyData
-> Text
-> Bool
-> Bool
-> Policy)
-> Parser (Maybe (HashMap CustomerPolicyScopeIdType [Text]))
-> Parser
(Text
-> SecurityServicePolicyData -> Text -> Bool -> Bool -> Policy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser
(Maybe (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IncludeMap" Parser (Maybe (Maybe (HashMap CustomerPolicyScopeIdType [Text])))
-> Maybe (HashMap CustomerPolicyScopeIdType [Text])
-> Parser (Maybe (HashMap CustomerPolicyScopeIdType [Text]))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap CustomerPolicyScopeIdType [Text])
forall a. Monoid a => a
Prelude.mempty)
Parser
(Text
-> SecurityServicePolicyData -> Text -> Bool -> Bool -> Policy)
-> Parser Text
-> Parser
(SecurityServicePolicyData -> Text -> Bool -> Bool -> Policy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"PolicyName")
Parser
(SecurityServicePolicyData -> Text -> Bool -> Bool -> Policy)
-> Parser SecurityServicePolicyData
-> Parser (Text -> Bool -> Bool -> Policy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SecurityServicePolicyData
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SecurityServicePolicyData")
Parser (Text -> Bool -> Bool -> Policy)
-> Parser Text -> Parser (Bool -> Bool -> Policy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ResourceType")
Parser (Bool -> Bool -> Policy)
-> Parser Bool -> Parser (Bool -> Policy)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ExcludeResourceTags")
Parser (Bool -> Policy) -> Parser Bool -> Parser Policy
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RemediationEnabled")
)
instance Prelude.Hashable Policy
instance Prelude.NFData Policy
instance Core.ToJSON Policy where
toJSON :: Policy -> Value
toJSON Policy' {Bool
Maybe Bool
Maybe [Text]
Maybe [ResourceTag]
Maybe Text
Maybe (HashMap CustomerPolicyScopeIdType [Text])
Text
SecurityServicePolicyData
remediationEnabled :: Bool
excludeResourceTags :: Bool
resourceType :: Text
securityServicePolicyData :: SecurityServicePolicyData
policyName :: Text
includeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap :: Maybe (HashMap CustomerPolicyScopeIdType [Text])
deleteUnusedFMManagedResources :: Maybe Bool
policyUpdateToken :: Maybe Text
resourceTags :: Maybe [ResourceTag]
resourceTypeList :: Maybe [Text]
policyId :: Maybe Text
$sel:remediationEnabled:Policy' :: Policy -> Bool
$sel:excludeResourceTags:Policy' :: Policy -> Bool
$sel:resourceType:Policy' :: Policy -> Text
$sel:securityServicePolicyData:Policy' :: Policy -> SecurityServicePolicyData
$sel:policyName:Policy' :: Policy -> Text
$sel:includeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:excludeMap:Policy' :: Policy -> Maybe (HashMap CustomerPolicyScopeIdType [Text])
$sel:deleteUnusedFMManagedResources:Policy' :: Policy -> Maybe Bool
$sel:policyUpdateToken:Policy' :: Policy -> Maybe Text
$sel:resourceTags:Policy' :: Policy -> Maybe [ResourceTag]
$sel:resourceTypeList:Policy' :: Policy -> Maybe [Text]
$sel:policyId:Policy' :: Policy -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PolicyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policyId,
(Text
"ResourceTypeList" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
resourceTypeList,
(Text
"ResourceTags" Text -> [ResourceTag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ResourceTag] -> Pair) -> Maybe [ResourceTag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResourceTag]
resourceTags,
(Text
"PolicyUpdateToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
policyUpdateToken,
(Text
"DeleteUnusedFMManagedResources" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteUnusedFMManagedResources,
(Text
"ExcludeMap" Text -> HashMap CustomerPolicyScopeIdType [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap CustomerPolicyScopeIdType [Text] -> Pair)
-> Maybe (HashMap CustomerPolicyScopeIdType [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap CustomerPolicyScopeIdType [Text])
excludeMap,
(Text
"IncludeMap" Text -> HashMap CustomerPolicyScopeIdType [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap CustomerPolicyScopeIdType [Text] -> Pair)
-> Maybe (HashMap CustomerPolicyScopeIdType [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap CustomerPolicyScopeIdType [Text])
includeMap,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PolicyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
policyName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"SecurityServicePolicyData"
Text -> SecurityServicePolicyData -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SecurityServicePolicyData
securityServicePolicyData
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ExcludeResourceTags" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
excludeResourceTags),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"RemediationEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
remediationEnabled)
]
)