{-# 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.QuickSight.Types.IAMPolicyAssignment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.AssignmentStatus
data IAMPolicyAssignment = IAMPolicyAssignment'
{
IAMPolicyAssignment -> Maybe Text
assignmentName :: Prelude.Maybe Prelude.Text,
IAMPolicyAssignment -> Maybe Text
awsAccountId :: Prelude.Maybe Prelude.Text,
IAMPolicyAssignment -> Maybe AssignmentStatus
assignmentStatus :: Prelude.Maybe AssignmentStatus,
IAMPolicyAssignment -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
IAMPolicyAssignment -> Maybe (HashMap Text [Text])
identities :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
IAMPolicyAssignment -> Maybe Text
assignmentId :: Prelude.Maybe Prelude.Text
}
deriving (IAMPolicyAssignment -> IAMPolicyAssignment -> Bool
(IAMPolicyAssignment -> IAMPolicyAssignment -> Bool)
-> (IAMPolicyAssignment -> IAMPolicyAssignment -> Bool)
-> Eq IAMPolicyAssignment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IAMPolicyAssignment -> IAMPolicyAssignment -> Bool
$c/= :: IAMPolicyAssignment -> IAMPolicyAssignment -> Bool
== :: IAMPolicyAssignment -> IAMPolicyAssignment -> Bool
$c== :: IAMPolicyAssignment -> IAMPolicyAssignment -> Bool
Prelude.Eq, ReadPrec [IAMPolicyAssignment]
ReadPrec IAMPolicyAssignment
Int -> ReadS IAMPolicyAssignment
ReadS [IAMPolicyAssignment]
(Int -> ReadS IAMPolicyAssignment)
-> ReadS [IAMPolicyAssignment]
-> ReadPrec IAMPolicyAssignment
-> ReadPrec [IAMPolicyAssignment]
-> Read IAMPolicyAssignment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IAMPolicyAssignment]
$creadListPrec :: ReadPrec [IAMPolicyAssignment]
readPrec :: ReadPrec IAMPolicyAssignment
$creadPrec :: ReadPrec IAMPolicyAssignment
readList :: ReadS [IAMPolicyAssignment]
$creadList :: ReadS [IAMPolicyAssignment]
readsPrec :: Int -> ReadS IAMPolicyAssignment
$creadsPrec :: Int -> ReadS IAMPolicyAssignment
Prelude.Read, Int -> IAMPolicyAssignment -> ShowS
[IAMPolicyAssignment] -> ShowS
IAMPolicyAssignment -> String
(Int -> IAMPolicyAssignment -> ShowS)
-> (IAMPolicyAssignment -> String)
-> ([IAMPolicyAssignment] -> ShowS)
-> Show IAMPolicyAssignment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IAMPolicyAssignment] -> ShowS
$cshowList :: [IAMPolicyAssignment] -> ShowS
show :: IAMPolicyAssignment -> String
$cshow :: IAMPolicyAssignment -> String
showsPrec :: Int -> IAMPolicyAssignment -> ShowS
$cshowsPrec :: Int -> IAMPolicyAssignment -> ShowS
Prelude.Show, (forall x. IAMPolicyAssignment -> Rep IAMPolicyAssignment x)
-> (forall x. Rep IAMPolicyAssignment x -> IAMPolicyAssignment)
-> Generic IAMPolicyAssignment
forall x. Rep IAMPolicyAssignment x -> IAMPolicyAssignment
forall x. IAMPolicyAssignment -> Rep IAMPolicyAssignment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IAMPolicyAssignment x -> IAMPolicyAssignment
$cfrom :: forall x. IAMPolicyAssignment -> Rep IAMPolicyAssignment x
Prelude.Generic)
newIAMPolicyAssignment ::
IAMPolicyAssignment
newIAMPolicyAssignment :: IAMPolicyAssignment
newIAMPolicyAssignment =
IAMPolicyAssignment' :: Maybe Text
-> Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment
IAMPolicyAssignment'
{ $sel:assignmentName:IAMPolicyAssignment' :: Maybe Text
assignmentName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:IAMPolicyAssignment' :: Maybe Text
awsAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assignmentStatus:IAMPolicyAssignment' :: Maybe AssignmentStatus
assignmentStatus = Maybe AssignmentStatus
forall a. Maybe a
Prelude.Nothing,
$sel:policyArn:IAMPolicyAssignment' :: Maybe Text
policyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identities:IAMPolicyAssignment' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:assignmentId:IAMPolicyAssignment' :: Maybe Text
assignmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
iAMPolicyAssignment_assignmentName :: Lens.Lens' IAMPolicyAssignment (Prelude.Maybe Prelude.Text)
iAMPolicyAssignment_assignmentName :: (Maybe Text -> f (Maybe Text))
-> IAMPolicyAssignment -> f IAMPolicyAssignment
iAMPolicyAssignment_assignmentName = (IAMPolicyAssignment -> Maybe Text)
-> (IAMPolicyAssignment -> Maybe Text -> IAMPolicyAssignment)
-> Lens
IAMPolicyAssignment IAMPolicyAssignment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IAMPolicyAssignment' {Maybe Text
assignmentName :: Maybe Text
$sel:assignmentName:IAMPolicyAssignment' :: IAMPolicyAssignment -> Maybe Text
assignmentName} -> Maybe Text
assignmentName) (\s :: IAMPolicyAssignment
s@IAMPolicyAssignment' {} Maybe Text
a -> IAMPolicyAssignment
s {$sel:assignmentName:IAMPolicyAssignment' :: Maybe Text
assignmentName = Maybe Text
a} :: IAMPolicyAssignment)
iAMPolicyAssignment_awsAccountId :: Lens.Lens' IAMPolicyAssignment (Prelude.Maybe Prelude.Text)
iAMPolicyAssignment_awsAccountId :: (Maybe Text -> f (Maybe Text))
-> IAMPolicyAssignment -> f IAMPolicyAssignment
iAMPolicyAssignment_awsAccountId = (IAMPolicyAssignment -> Maybe Text)
-> (IAMPolicyAssignment -> Maybe Text -> IAMPolicyAssignment)
-> Lens
IAMPolicyAssignment IAMPolicyAssignment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IAMPolicyAssignment' {Maybe Text
awsAccountId :: Maybe Text
$sel:awsAccountId:IAMPolicyAssignment' :: IAMPolicyAssignment -> Maybe Text
awsAccountId} -> Maybe Text
awsAccountId) (\s :: IAMPolicyAssignment
s@IAMPolicyAssignment' {} Maybe Text
a -> IAMPolicyAssignment
s {$sel:awsAccountId:IAMPolicyAssignment' :: Maybe Text
awsAccountId = Maybe Text
a} :: IAMPolicyAssignment)
iAMPolicyAssignment_assignmentStatus :: Lens.Lens' IAMPolicyAssignment (Prelude.Maybe AssignmentStatus)
iAMPolicyAssignment_assignmentStatus :: (Maybe AssignmentStatus -> f (Maybe AssignmentStatus))
-> IAMPolicyAssignment -> f IAMPolicyAssignment
iAMPolicyAssignment_assignmentStatus = (IAMPolicyAssignment -> Maybe AssignmentStatus)
-> (IAMPolicyAssignment
-> Maybe AssignmentStatus -> IAMPolicyAssignment)
-> Lens
IAMPolicyAssignment
IAMPolicyAssignment
(Maybe AssignmentStatus)
(Maybe AssignmentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IAMPolicyAssignment' {Maybe AssignmentStatus
assignmentStatus :: Maybe AssignmentStatus
$sel:assignmentStatus:IAMPolicyAssignment' :: IAMPolicyAssignment -> Maybe AssignmentStatus
assignmentStatus} -> Maybe AssignmentStatus
assignmentStatus) (\s :: IAMPolicyAssignment
s@IAMPolicyAssignment' {} Maybe AssignmentStatus
a -> IAMPolicyAssignment
s {$sel:assignmentStatus:IAMPolicyAssignment' :: Maybe AssignmentStatus
assignmentStatus = Maybe AssignmentStatus
a} :: IAMPolicyAssignment)
iAMPolicyAssignment_policyArn :: Lens.Lens' IAMPolicyAssignment (Prelude.Maybe Prelude.Text)
iAMPolicyAssignment_policyArn :: (Maybe Text -> f (Maybe Text))
-> IAMPolicyAssignment -> f IAMPolicyAssignment
iAMPolicyAssignment_policyArn = (IAMPolicyAssignment -> Maybe Text)
-> (IAMPolicyAssignment -> Maybe Text -> IAMPolicyAssignment)
-> Lens
IAMPolicyAssignment IAMPolicyAssignment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IAMPolicyAssignment' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:IAMPolicyAssignment' :: IAMPolicyAssignment -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: IAMPolicyAssignment
s@IAMPolicyAssignment' {} Maybe Text
a -> IAMPolicyAssignment
s {$sel:policyArn:IAMPolicyAssignment' :: Maybe Text
policyArn = Maybe Text
a} :: IAMPolicyAssignment)
iAMPolicyAssignment_identities :: Lens.Lens' IAMPolicyAssignment (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
iAMPolicyAssignment_identities :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> IAMPolicyAssignment -> f IAMPolicyAssignment
iAMPolicyAssignment_identities = (IAMPolicyAssignment -> Maybe (HashMap Text [Text]))
-> (IAMPolicyAssignment
-> Maybe (HashMap Text [Text]) -> IAMPolicyAssignment)
-> Lens
IAMPolicyAssignment
IAMPolicyAssignment
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IAMPolicyAssignment' {Maybe (HashMap Text [Text])
identities :: Maybe (HashMap Text [Text])
$sel:identities:IAMPolicyAssignment' :: IAMPolicyAssignment -> Maybe (HashMap Text [Text])
identities} -> Maybe (HashMap Text [Text])
identities) (\s :: IAMPolicyAssignment
s@IAMPolicyAssignment' {} Maybe (HashMap Text [Text])
a -> IAMPolicyAssignment
s {$sel:identities:IAMPolicyAssignment' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
a} :: IAMPolicyAssignment) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> IAMPolicyAssignment -> f IAMPolicyAssignment)
-> ((Maybe (HashMap Text [Text])
-> f (Maybe (HashMap Text [Text])))
-> Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> IAMPolicyAssignment
-> f IAMPolicyAssignment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
-> Iso
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [Text]))
(Maybe (HashMap Text [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 Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
(HashMap Text [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
iAMPolicyAssignment_assignmentId :: Lens.Lens' IAMPolicyAssignment (Prelude.Maybe Prelude.Text)
iAMPolicyAssignment_assignmentId :: (Maybe Text -> f (Maybe Text))
-> IAMPolicyAssignment -> f IAMPolicyAssignment
iAMPolicyAssignment_assignmentId = (IAMPolicyAssignment -> Maybe Text)
-> (IAMPolicyAssignment -> Maybe Text -> IAMPolicyAssignment)
-> Lens
IAMPolicyAssignment IAMPolicyAssignment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IAMPolicyAssignment' {Maybe Text
assignmentId :: Maybe Text
$sel:assignmentId:IAMPolicyAssignment' :: IAMPolicyAssignment -> Maybe Text
assignmentId} -> Maybe Text
assignmentId) (\s :: IAMPolicyAssignment
s@IAMPolicyAssignment' {} Maybe Text
a -> IAMPolicyAssignment
s {$sel:assignmentId:IAMPolicyAssignment' :: Maybe Text
assignmentId = Maybe Text
a} :: IAMPolicyAssignment)
instance Core.FromJSON IAMPolicyAssignment where
parseJSON :: Value -> Parser IAMPolicyAssignment
parseJSON =
String
-> (Object -> Parser IAMPolicyAssignment)
-> Value
-> Parser IAMPolicyAssignment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IAMPolicyAssignment"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment
IAMPolicyAssignment'
(Maybe Text
-> Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment)
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
"AssignmentName")
Parser
(Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment)
-> Parser (Maybe Text)
-> Parser
(Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment)
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
"AwsAccountId")
Parser
(Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment)
-> Parser (Maybe AssignmentStatus)
-> Parser
(Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AssignmentStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssignmentStatus")
Parser
(Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> IAMPolicyAssignment)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text [Text]) -> Maybe Text -> IAMPolicyAssignment)
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 (HashMap Text [Text]) -> Maybe Text -> IAMPolicyAssignment)
-> Parser (Maybe (HashMap Text [Text]))
-> Parser (Maybe Text -> IAMPolicyAssignment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text [Text])))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Identities" Parser (Maybe (Maybe (HashMap Text [Text])))
-> Maybe (HashMap Text [Text])
-> Parser (Maybe (HashMap Text [Text]))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text [Text])
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> IAMPolicyAssignment)
-> Parser (Maybe Text) -> Parser IAMPolicyAssignment
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
"AssignmentId")
)
instance Prelude.Hashable IAMPolicyAssignment
instance Prelude.NFData IAMPolicyAssignment