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