{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.QuickSight.CreateIAMPolicyAssignment
(
CreateIAMPolicyAssignment (..),
newCreateIAMPolicyAssignment,
createIAMPolicyAssignment_policyArn,
createIAMPolicyAssignment_identities,
createIAMPolicyAssignment_awsAccountId,
createIAMPolicyAssignment_assignmentName,
createIAMPolicyAssignment_assignmentStatus,
createIAMPolicyAssignment_namespace,
CreateIAMPolicyAssignmentResponse (..),
newCreateIAMPolicyAssignmentResponse,
createIAMPolicyAssignmentResponse_requestId,
createIAMPolicyAssignmentResponse_assignmentName,
createIAMPolicyAssignmentResponse_assignmentStatus,
createIAMPolicyAssignmentResponse_policyArn,
createIAMPolicyAssignmentResponse_identities,
createIAMPolicyAssignmentResponse_assignmentId,
createIAMPolicyAssignmentResponse_status,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateIAMPolicyAssignment = CreateIAMPolicyAssignment'
{
CreateIAMPolicyAssignment -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
CreateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
identities :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
CreateIAMPolicyAssignment -> Text
awsAccountId :: Prelude.Text,
CreateIAMPolicyAssignment -> Text
assignmentName :: Prelude.Text,
CreateIAMPolicyAssignment -> AssignmentStatus
assignmentStatus :: AssignmentStatus,
CreateIAMPolicyAssignment -> Text
namespace :: Prelude.Text
}
deriving (CreateIAMPolicyAssignment -> CreateIAMPolicyAssignment -> Bool
(CreateIAMPolicyAssignment -> CreateIAMPolicyAssignment -> Bool)
-> (CreateIAMPolicyAssignment -> CreateIAMPolicyAssignment -> Bool)
-> Eq CreateIAMPolicyAssignment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateIAMPolicyAssignment -> CreateIAMPolicyAssignment -> Bool
$c/= :: CreateIAMPolicyAssignment -> CreateIAMPolicyAssignment -> Bool
== :: CreateIAMPolicyAssignment -> CreateIAMPolicyAssignment -> Bool
$c== :: CreateIAMPolicyAssignment -> CreateIAMPolicyAssignment -> Bool
Prelude.Eq, ReadPrec [CreateIAMPolicyAssignment]
ReadPrec CreateIAMPolicyAssignment
Int -> ReadS CreateIAMPolicyAssignment
ReadS [CreateIAMPolicyAssignment]
(Int -> ReadS CreateIAMPolicyAssignment)
-> ReadS [CreateIAMPolicyAssignment]
-> ReadPrec CreateIAMPolicyAssignment
-> ReadPrec [CreateIAMPolicyAssignment]
-> Read CreateIAMPolicyAssignment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateIAMPolicyAssignment]
$creadListPrec :: ReadPrec [CreateIAMPolicyAssignment]
readPrec :: ReadPrec CreateIAMPolicyAssignment
$creadPrec :: ReadPrec CreateIAMPolicyAssignment
readList :: ReadS [CreateIAMPolicyAssignment]
$creadList :: ReadS [CreateIAMPolicyAssignment]
readsPrec :: Int -> ReadS CreateIAMPolicyAssignment
$creadsPrec :: Int -> ReadS CreateIAMPolicyAssignment
Prelude.Read, Int -> CreateIAMPolicyAssignment -> ShowS
[CreateIAMPolicyAssignment] -> ShowS
CreateIAMPolicyAssignment -> String
(Int -> CreateIAMPolicyAssignment -> ShowS)
-> (CreateIAMPolicyAssignment -> String)
-> ([CreateIAMPolicyAssignment] -> ShowS)
-> Show CreateIAMPolicyAssignment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateIAMPolicyAssignment] -> ShowS
$cshowList :: [CreateIAMPolicyAssignment] -> ShowS
show :: CreateIAMPolicyAssignment -> String
$cshow :: CreateIAMPolicyAssignment -> String
showsPrec :: Int -> CreateIAMPolicyAssignment -> ShowS
$cshowsPrec :: Int -> CreateIAMPolicyAssignment -> ShowS
Prelude.Show, (forall x.
CreateIAMPolicyAssignment -> Rep CreateIAMPolicyAssignment x)
-> (forall x.
Rep CreateIAMPolicyAssignment x -> CreateIAMPolicyAssignment)
-> Generic CreateIAMPolicyAssignment
forall x.
Rep CreateIAMPolicyAssignment x -> CreateIAMPolicyAssignment
forall x.
CreateIAMPolicyAssignment -> Rep CreateIAMPolicyAssignment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateIAMPolicyAssignment x -> CreateIAMPolicyAssignment
$cfrom :: forall x.
CreateIAMPolicyAssignment -> Rep CreateIAMPolicyAssignment x
Prelude.Generic)
newCreateIAMPolicyAssignment ::
Prelude.Text ->
Prelude.Text ->
AssignmentStatus ->
Prelude.Text ->
CreateIAMPolicyAssignment
newCreateIAMPolicyAssignment :: Text
-> Text -> AssignmentStatus -> Text -> CreateIAMPolicyAssignment
newCreateIAMPolicyAssignment
Text
pAwsAccountId_
Text
pAssignmentName_
AssignmentStatus
pAssignmentStatus_
Text
pNamespace_ =
CreateIAMPolicyAssignment' :: Maybe Text
-> Maybe (HashMap Text [Text])
-> Text
-> Text
-> AssignmentStatus
-> Text
-> CreateIAMPolicyAssignment
CreateIAMPolicyAssignment'
{ $sel:policyArn:CreateIAMPolicyAssignment' :: Maybe Text
policyArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identities:CreateIAMPolicyAssignment' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:CreateIAMPolicyAssignment' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:assignmentName:CreateIAMPolicyAssignment' :: Text
assignmentName = Text
pAssignmentName_,
$sel:assignmentStatus:CreateIAMPolicyAssignment' :: AssignmentStatus
assignmentStatus = AssignmentStatus
pAssignmentStatus_,
$sel:namespace:CreateIAMPolicyAssignment' :: Text
namespace = Text
pNamespace_
}
createIAMPolicyAssignment_policyArn :: Lens.Lens' CreateIAMPolicyAssignment (Prelude.Maybe Prelude.Text)
createIAMPolicyAssignment_policyArn :: (Maybe Text -> f (Maybe Text))
-> CreateIAMPolicyAssignment -> f CreateIAMPolicyAssignment
createIAMPolicyAssignment_policyArn = (CreateIAMPolicyAssignment -> Maybe Text)
-> (CreateIAMPolicyAssignment
-> Maybe Text -> CreateIAMPolicyAssignment)
-> Lens
CreateIAMPolicyAssignment
CreateIAMPolicyAssignment
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignment' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: CreateIAMPolicyAssignment
s@CreateIAMPolicyAssignment' {} Maybe Text
a -> CreateIAMPolicyAssignment
s {$sel:policyArn:CreateIAMPolicyAssignment' :: Maybe Text
policyArn = Maybe Text
a} :: CreateIAMPolicyAssignment)
createIAMPolicyAssignment_identities :: Lens.Lens' CreateIAMPolicyAssignment (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
createIAMPolicyAssignment_identities :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> CreateIAMPolicyAssignment -> f CreateIAMPolicyAssignment
createIAMPolicyAssignment_identities = (CreateIAMPolicyAssignment -> Maybe (HashMap Text [Text]))
-> (CreateIAMPolicyAssignment
-> Maybe (HashMap Text [Text]) -> CreateIAMPolicyAssignment)
-> Lens
CreateIAMPolicyAssignment
CreateIAMPolicyAssignment
(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 (\CreateIAMPolicyAssignment' {Maybe (HashMap Text [Text])
identities :: Maybe (HashMap Text [Text])
$sel:identities:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
identities} -> Maybe (HashMap Text [Text])
identities) (\s :: CreateIAMPolicyAssignment
s@CreateIAMPolicyAssignment' {} Maybe (HashMap Text [Text])
a -> CreateIAMPolicyAssignment
s {$sel:identities:CreateIAMPolicyAssignment' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
a} :: CreateIAMPolicyAssignment) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> CreateIAMPolicyAssignment -> f CreateIAMPolicyAssignment)
-> ((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])))
-> CreateIAMPolicyAssignment
-> f CreateIAMPolicyAssignment
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
createIAMPolicyAssignment_awsAccountId :: Lens.Lens' CreateIAMPolicyAssignment Prelude.Text
createIAMPolicyAssignment_awsAccountId :: (Text -> f Text)
-> CreateIAMPolicyAssignment -> f CreateIAMPolicyAssignment
createIAMPolicyAssignment_awsAccountId = (CreateIAMPolicyAssignment -> Text)
-> (CreateIAMPolicyAssignment -> Text -> CreateIAMPolicyAssignment)
-> Lens
CreateIAMPolicyAssignment CreateIAMPolicyAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignment' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateIAMPolicyAssignment
s@CreateIAMPolicyAssignment' {} Text
a -> CreateIAMPolicyAssignment
s {$sel:awsAccountId:CreateIAMPolicyAssignment' :: Text
awsAccountId = Text
a} :: CreateIAMPolicyAssignment)
createIAMPolicyAssignment_assignmentName :: Lens.Lens' CreateIAMPolicyAssignment Prelude.Text
createIAMPolicyAssignment_assignmentName :: (Text -> f Text)
-> CreateIAMPolicyAssignment -> f CreateIAMPolicyAssignment
createIAMPolicyAssignment_assignmentName = (CreateIAMPolicyAssignment -> Text)
-> (CreateIAMPolicyAssignment -> Text -> CreateIAMPolicyAssignment)
-> Lens
CreateIAMPolicyAssignment CreateIAMPolicyAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignment' {Text
assignmentName :: Text
$sel:assignmentName:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
assignmentName} -> Text
assignmentName) (\s :: CreateIAMPolicyAssignment
s@CreateIAMPolicyAssignment' {} Text
a -> CreateIAMPolicyAssignment
s {$sel:assignmentName:CreateIAMPolicyAssignment' :: Text
assignmentName = Text
a} :: CreateIAMPolicyAssignment)
createIAMPolicyAssignment_assignmentStatus :: Lens.Lens' CreateIAMPolicyAssignment AssignmentStatus
createIAMPolicyAssignment_assignmentStatus :: (AssignmentStatus -> f AssignmentStatus)
-> CreateIAMPolicyAssignment -> f CreateIAMPolicyAssignment
createIAMPolicyAssignment_assignmentStatus = (CreateIAMPolicyAssignment -> AssignmentStatus)
-> (CreateIAMPolicyAssignment
-> AssignmentStatus -> CreateIAMPolicyAssignment)
-> Lens
CreateIAMPolicyAssignment
CreateIAMPolicyAssignment
AssignmentStatus
AssignmentStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignment' {AssignmentStatus
assignmentStatus :: AssignmentStatus
$sel:assignmentStatus:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> AssignmentStatus
assignmentStatus} -> AssignmentStatus
assignmentStatus) (\s :: CreateIAMPolicyAssignment
s@CreateIAMPolicyAssignment' {} AssignmentStatus
a -> CreateIAMPolicyAssignment
s {$sel:assignmentStatus:CreateIAMPolicyAssignment' :: AssignmentStatus
assignmentStatus = AssignmentStatus
a} :: CreateIAMPolicyAssignment)
createIAMPolicyAssignment_namespace :: Lens.Lens' CreateIAMPolicyAssignment Prelude.Text
createIAMPolicyAssignment_namespace :: (Text -> f Text)
-> CreateIAMPolicyAssignment -> f CreateIAMPolicyAssignment
createIAMPolicyAssignment_namespace = (CreateIAMPolicyAssignment -> Text)
-> (CreateIAMPolicyAssignment -> Text -> CreateIAMPolicyAssignment)
-> Lens
CreateIAMPolicyAssignment CreateIAMPolicyAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignment' {Text
namespace :: Text
$sel:namespace:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
namespace} -> Text
namespace) (\s :: CreateIAMPolicyAssignment
s@CreateIAMPolicyAssignment' {} Text
a -> CreateIAMPolicyAssignment
s {$sel:namespace:CreateIAMPolicyAssignment' :: Text
namespace = Text
a} :: CreateIAMPolicyAssignment)
instance Core.AWSRequest CreateIAMPolicyAssignment where
type
AWSResponse CreateIAMPolicyAssignment =
CreateIAMPolicyAssignmentResponse
request :: CreateIAMPolicyAssignment -> Request CreateIAMPolicyAssignment
request = Service
-> CreateIAMPolicyAssignment -> Request CreateIAMPolicyAssignment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateIAMPolicyAssignment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateIAMPolicyAssignment)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateIAMPolicyAssignment))
-> Logger
-> Service
-> Proxy CreateIAMPolicyAssignment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateIAMPolicyAssignment)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse'
(Maybe Text
-> Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
Either
String
(Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssignmentName")
Either
String
(Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse)
-> Either String (Maybe AssignmentStatus)
-> Either
String
(Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe AssignmentStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssignmentStatus")
Either
String
(Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe (HashMap Text [Text])
-> Maybe Text -> Int -> CreateIAMPolicyAssignmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PolicyArn")
Either
String
(Maybe (HashMap Text [Text])
-> Maybe Text -> Int -> CreateIAMPolicyAssignmentResponse)
-> Either String (Maybe (HashMap Text [Text]))
-> Either
String (Maybe Text -> Int -> CreateIAMPolicyAssignmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe (HashMap Text [Text])))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Identities" Either String (Maybe (Maybe (HashMap Text [Text])))
-> Maybe (HashMap Text [Text])
-> Either String (Maybe (HashMap Text [Text]))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text [Text])
forall a. Monoid a => a
Prelude.mempty)
Either
String (Maybe Text -> Int -> CreateIAMPolicyAssignmentResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateIAMPolicyAssignmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssignmentId")
Either String (Int -> CreateIAMPolicyAssignmentResponse)
-> Either String Int
-> Either String CreateIAMPolicyAssignmentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateIAMPolicyAssignment
instance Prelude.NFData CreateIAMPolicyAssignment
instance Core.ToHeaders CreateIAMPolicyAssignment where
toHeaders :: CreateIAMPolicyAssignment -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateIAMPolicyAssignment -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateIAMPolicyAssignment where
toJSON :: CreateIAMPolicyAssignment -> Value
toJSON CreateIAMPolicyAssignment' {Maybe Text
Maybe (HashMap Text [Text])
Text
AssignmentStatus
namespace :: Text
assignmentStatus :: AssignmentStatus
assignmentName :: Text
awsAccountId :: Text
identities :: Maybe (HashMap Text [Text])
policyArn :: Maybe Text
$sel:namespace:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
$sel:assignmentStatus:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> AssignmentStatus
$sel:assignmentName:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
$sel:awsAccountId:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
$sel:identities:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
$sel:policyArn:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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,
(Text
"Identities" Text -> HashMap Text [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text [Text] -> Pair)
-> Maybe (HashMap Text [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [Text])
identities,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AssignmentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assignmentName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AssignmentStatus" Text -> AssignmentStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AssignmentStatus
assignmentStatus)
]
)
instance Core.ToPath CreateIAMPolicyAssignment where
toPath :: CreateIAMPolicyAssignment -> ByteString
toPath CreateIAMPolicyAssignment' {Maybe Text
Maybe (HashMap Text [Text])
Text
AssignmentStatus
namespace :: Text
assignmentStatus :: AssignmentStatus
assignmentName :: Text
awsAccountId :: Text
identities :: Maybe (HashMap Text [Text])
policyArn :: Maybe Text
$sel:namespace:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
$sel:assignmentStatus:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> AssignmentStatus
$sel:assignmentName:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
$sel:awsAccountId:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Text
$sel:identities:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
$sel:policyArn:CreateIAMPolicyAssignment' :: CreateIAMPolicyAssignment -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
ByteString
"/namespaces/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
namespace,
ByteString
"/iam-policy-assignments/"
]
instance Core.ToQuery CreateIAMPolicyAssignment where
toQuery :: CreateIAMPolicyAssignment -> QueryString
toQuery = QueryString -> CreateIAMPolicyAssignment -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateIAMPolicyAssignmentResponse = CreateIAMPolicyAssignmentResponse'
{
CreateIAMPolicyAssignmentResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateIAMPolicyAssignmentResponse -> Maybe Text
assignmentName :: Prelude.Maybe Prelude.Text,
CreateIAMPolicyAssignmentResponse -> Maybe AssignmentStatus
assignmentStatus :: Prelude.Maybe AssignmentStatus,
CreateIAMPolicyAssignmentResponse -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
CreateIAMPolicyAssignmentResponse -> Maybe (HashMap Text [Text])
identities :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
CreateIAMPolicyAssignmentResponse -> Maybe Text
assignmentId :: Prelude.Maybe Prelude.Text,
CreateIAMPolicyAssignmentResponse -> Int
status :: Prelude.Int
}
deriving (CreateIAMPolicyAssignmentResponse
-> CreateIAMPolicyAssignmentResponse -> Bool
(CreateIAMPolicyAssignmentResponse
-> CreateIAMPolicyAssignmentResponse -> Bool)
-> (CreateIAMPolicyAssignmentResponse
-> CreateIAMPolicyAssignmentResponse -> Bool)
-> Eq CreateIAMPolicyAssignmentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateIAMPolicyAssignmentResponse
-> CreateIAMPolicyAssignmentResponse -> Bool
$c/= :: CreateIAMPolicyAssignmentResponse
-> CreateIAMPolicyAssignmentResponse -> Bool
== :: CreateIAMPolicyAssignmentResponse
-> CreateIAMPolicyAssignmentResponse -> Bool
$c== :: CreateIAMPolicyAssignmentResponse
-> CreateIAMPolicyAssignmentResponse -> Bool
Prelude.Eq, ReadPrec [CreateIAMPolicyAssignmentResponse]
ReadPrec CreateIAMPolicyAssignmentResponse
Int -> ReadS CreateIAMPolicyAssignmentResponse
ReadS [CreateIAMPolicyAssignmentResponse]
(Int -> ReadS CreateIAMPolicyAssignmentResponse)
-> ReadS [CreateIAMPolicyAssignmentResponse]
-> ReadPrec CreateIAMPolicyAssignmentResponse
-> ReadPrec [CreateIAMPolicyAssignmentResponse]
-> Read CreateIAMPolicyAssignmentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateIAMPolicyAssignmentResponse]
$creadListPrec :: ReadPrec [CreateIAMPolicyAssignmentResponse]
readPrec :: ReadPrec CreateIAMPolicyAssignmentResponse
$creadPrec :: ReadPrec CreateIAMPolicyAssignmentResponse
readList :: ReadS [CreateIAMPolicyAssignmentResponse]
$creadList :: ReadS [CreateIAMPolicyAssignmentResponse]
readsPrec :: Int -> ReadS CreateIAMPolicyAssignmentResponse
$creadsPrec :: Int -> ReadS CreateIAMPolicyAssignmentResponse
Prelude.Read, Int -> CreateIAMPolicyAssignmentResponse -> ShowS
[CreateIAMPolicyAssignmentResponse] -> ShowS
CreateIAMPolicyAssignmentResponse -> String
(Int -> CreateIAMPolicyAssignmentResponse -> ShowS)
-> (CreateIAMPolicyAssignmentResponse -> String)
-> ([CreateIAMPolicyAssignmentResponse] -> ShowS)
-> Show CreateIAMPolicyAssignmentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateIAMPolicyAssignmentResponse] -> ShowS
$cshowList :: [CreateIAMPolicyAssignmentResponse] -> ShowS
show :: CreateIAMPolicyAssignmentResponse -> String
$cshow :: CreateIAMPolicyAssignmentResponse -> String
showsPrec :: Int -> CreateIAMPolicyAssignmentResponse -> ShowS
$cshowsPrec :: Int -> CreateIAMPolicyAssignmentResponse -> ShowS
Prelude.Show, (forall x.
CreateIAMPolicyAssignmentResponse
-> Rep CreateIAMPolicyAssignmentResponse x)
-> (forall x.
Rep CreateIAMPolicyAssignmentResponse x
-> CreateIAMPolicyAssignmentResponse)
-> Generic CreateIAMPolicyAssignmentResponse
forall x.
Rep CreateIAMPolicyAssignmentResponse x
-> CreateIAMPolicyAssignmentResponse
forall x.
CreateIAMPolicyAssignmentResponse
-> Rep CreateIAMPolicyAssignmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateIAMPolicyAssignmentResponse x
-> CreateIAMPolicyAssignmentResponse
$cfrom :: forall x.
CreateIAMPolicyAssignmentResponse
-> Rep CreateIAMPolicyAssignmentResponse x
Prelude.Generic)
newCreateIAMPolicyAssignmentResponse ::
Prelude.Int ->
CreateIAMPolicyAssignmentResponse
newCreateIAMPolicyAssignmentResponse :: Int -> CreateIAMPolicyAssignmentResponse
newCreateIAMPolicyAssignmentResponse Int
pStatus_ =
CreateIAMPolicyAssignmentResponse' :: Maybe Text
-> Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse'
{ $sel:requestId:CreateIAMPolicyAssignmentResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assignmentName:CreateIAMPolicyAssignmentResponse' :: Maybe Text
assignmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assignmentStatus:CreateIAMPolicyAssignmentResponse' :: Maybe AssignmentStatus
assignmentStatus = Maybe AssignmentStatus
forall a. Maybe a
Prelude.Nothing,
$sel:policyArn:CreateIAMPolicyAssignmentResponse' :: Maybe Text
policyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identities:CreateIAMPolicyAssignmentResponse' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:assignmentId:CreateIAMPolicyAssignmentResponse' :: Maybe Text
assignmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:CreateIAMPolicyAssignmentResponse' :: Int
status = Int
pStatus_
}
createIAMPolicyAssignmentResponse_requestId :: Lens.Lens' CreateIAMPolicyAssignmentResponse (Prelude.Maybe Prelude.Text)
createIAMPolicyAssignmentResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse
createIAMPolicyAssignmentResponse_requestId = (CreateIAMPolicyAssignmentResponse -> Maybe Text)
-> (CreateIAMPolicyAssignmentResponse
-> Maybe Text -> CreateIAMPolicyAssignmentResponse)
-> Lens
CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignmentResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateIAMPolicyAssignmentResponse' :: CreateIAMPolicyAssignmentResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateIAMPolicyAssignmentResponse
s@CreateIAMPolicyAssignmentResponse' {} Maybe Text
a -> CreateIAMPolicyAssignmentResponse
s {$sel:requestId:CreateIAMPolicyAssignmentResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateIAMPolicyAssignmentResponse)
createIAMPolicyAssignmentResponse_assignmentName :: Lens.Lens' CreateIAMPolicyAssignmentResponse (Prelude.Maybe Prelude.Text)
createIAMPolicyAssignmentResponse_assignmentName :: (Maybe Text -> f (Maybe Text))
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse
createIAMPolicyAssignmentResponse_assignmentName = (CreateIAMPolicyAssignmentResponse -> Maybe Text)
-> (CreateIAMPolicyAssignmentResponse
-> Maybe Text -> CreateIAMPolicyAssignmentResponse)
-> Lens
CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignmentResponse' {Maybe Text
assignmentName :: Maybe Text
$sel:assignmentName:CreateIAMPolicyAssignmentResponse' :: CreateIAMPolicyAssignmentResponse -> Maybe Text
assignmentName} -> Maybe Text
assignmentName) (\s :: CreateIAMPolicyAssignmentResponse
s@CreateIAMPolicyAssignmentResponse' {} Maybe Text
a -> CreateIAMPolicyAssignmentResponse
s {$sel:assignmentName:CreateIAMPolicyAssignmentResponse' :: Maybe Text
assignmentName = Maybe Text
a} :: CreateIAMPolicyAssignmentResponse)
createIAMPolicyAssignmentResponse_assignmentStatus :: Lens.Lens' CreateIAMPolicyAssignmentResponse (Prelude.Maybe AssignmentStatus)
createIAMPolicyAssignmentResponse_assignmentStatus :: (Maybe AssignmentStatus -> f (Maybe AssignmentStatus))
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse
createIAMPolicyAssignmentResponse_assignmentStatus = (CreateIAMPolicyAssignmentResponse -> Maybe AssignmentStatus)
-> (CreateIAMPolicyAssignmentResponse
-> Maybe AssignmentStatus -> CreateIAMPolicyAssignmentResponse)
-> Lens
CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse
(Maybe AssignmentStatus)
(Maybe AssignmentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignmentResponse' {Maybe AssignmentStatus
assignmentStatus :: Maybe AssignmentStatus
$sel:assignmentStatus:CreateIAMPolicyAssignmentResponse' :: CreateIAMPolicyAssignmentResponse -> Maybe AssignmentStatus
assignmentStatus} -> Maybe AssignmentStatus
assignmentStatus) (\s :: CreateIAMPolicyAssignmentResponse
s@CreateIAMPolicyAssignmentResponse' {} Maybe AssignmentStatus
a -> CreateIAMPolicyAssignmentResponse
s {$sel:assignmentStatus:CreateIAMPolicyAssignmentResponse' :: Maybe AssignmentStatus
assignmentStatus = Maybe AssignmentStatus
a} :: CreateIAMPolicyAssignmentResponse)
createIAMPolicyAssignmentResponse_policyArn :: Lens.Lens' CreateIAMPolicyAssignmentResponse (Prelude.Maybe Prelude.Text)
createIAMPolicyAssignmentResponse_policyArn :: (Maybe Text -> f (Maybe Text))
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse
createIAMPolicyAssignmentResponse_policyArn = (CreateIAMPolicyAssignmentResponse -> Maybe Text)
-> (CreateIAMPolicyAssignmentResponse
-> Maybe Text -> CreateIAMPolicyAssignmentResponse)
-> Lens
CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignmentResponse' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:CreateIAMPolicyAssignmentResponse' :: CreateIAMPolicyAssignmentResponse -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: CreateIAMPolicyAssignmentResponse
s@CreateIAMPolicyAssignmentResponse' {} Maybe Text
a -> CreateIAMPolicyAssignmentResponse
s {$sel:policyArn:CreateIAMPolicyAssignmentResponse' :: Maybe Text
policyArn = Maybe Text
a} :: CreateIAMPolicyAssignmentResponse)
createIAMPolicyAssignmentResponse_identities :: Lens.Lens' CreateIAMPolicyAssignmentResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
createIAMPolicyAssignmentResponse_identities :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse
createIAMPolicyAssignmentResponse_identities = (CreateIAMPolicyAssignmentResponse -> Maybe (HashMap Text [Text]))
-> (CreateIAMPolicyAssignmentResponse
-> Maybe (HashMap Text [Text])
-> CreateIAMPolicyAssignmentResponse)
-> Lens
CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse
(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 (\CreateIAMPolicyAssignmentResponse' {Maybe (HashMap Text [Text])
identities :: Maybe (HashMap Text [Text])
$sel:identities:CreateIAMPolicyAssignmentResponse' :: CreateIAMPolicyAssignmentResponse -> Maybe (HashMap Text [Text])
identities} -> Maybe (HashMap Text [Text])
identities) (\s :: CreateIAMPolicyAssignmentResponse
s@CreateIAMPolicyAssignmentResponse' {} Maybe (HashMap Text [Text])
a -> CreateIAMPolicyAssignmentResponse
s {$sel:identities:CreateIAMPolicyAssignmentResponse' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
a} :: CreateIAMPolicyAssignmentResponse) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse)
-> ((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])))
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse
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
createIAMPolicyAssignmentResponse_assignmentId :: Lens.Lens' CreateIAMPolicyAssignmentResponse (Prelude.Maybe Prelude.Text)
createIAMPolicyAssignmentResponse_assignmentId :: (Maybe Text -> f (Maybe Text))
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse
createIAMPolicyAssignmentResponse_assignmentId = (CreateIAMPolicyAssignmentResponse -> Maybe Text)
-> (CreateIAMPolicyAssignmentResponse
-> Maybe Text -> CreateIAMPolicyAssignmentResponse)
-> Lens
CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignmentResponse' {Maybe Text
assignmentId :: Maybe Text
$sel:assignmentId:CreateIAMPolicyAssignmentResponse' :: CreateIAMPolicyAssignmentResponse -> Maybe Text
assignmentId} -> Maybe Text
assignmentId) (\s :: CreateIAMPolicyAssignmentResponse
s@CreateIAMPolicyAssignmentResponse' {} Maybe Text
a -> CreateIAMPolicyAssignmentResponse
s {$sel:assignmentId:CreateIAMPolicyAssignmentResponse' :: Maybe Text
assignmentId = Maybe Text
a} :: CreateIAMPolicyAssignmentResponse)
createIAMPolicyAssignmentResponse_status :: Lens.Lens' CreateIAMPolicyAssignmentResponse Prelude.Int
createIAMPolicyAssignmentResponse_status :: (Int -> f Int)
-> CreateIAMPolicyAssignmentResponse
-> f CreateIAMPolicyAssignmentResponse
createIAMPolicyAssignmentResponse_status = (CreateIAMPolicyAssignmentResponse -> Int)
-> (CreateIAMPolicyAssignmentResponse
-> Int -> CreateIAMPolicyAssignmentResponse)
-> Lens
CreateIAMPolicyAssignmentResponse
CreateIAMPolicyAssignmentResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateIAMPolicyAssignmentResponse' {Int
status :: Int
$sel:status:CreateIAMPolicyAssignmentResponse' :: CreateIAMPolicyAssignmentResponse -> Int
status} -> Int
status) (\s :: CreateIAMPolicyAssignmentResponse
s@CreateIAMPolicyAssignmentResponse' {} Int
a -> CreateIAMPolicyAssignmentResponse
s {$sel:status:CreateIAMPolicyAssignmentResponse' :: Int
status = Int
a} :: CreateIAMPolicyAssignmentResponse)
instance
Prelude.NFData
CreateIAMPolicyAssignmentResponse