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