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