{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.QuickSight.CreateIAMPolicyAssignment
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an assignment with one specified IAMpolicy, identified by its
-- Amazon Resource Name (ARN). This policy assignment is attached to the
-- specified groups or users of Amazon QuickSight. Assignment names are
-- unique per Amazon Web Services account. To avoid overwriting rules in
-- other namespaces, use assignment names that are unique.
module Amazonka.QuickSight.CreateIAMPolicyAssignment
  ( -- * Creating a Request
    CreateIAMPolicyAssignment (..),
    newCreateIAMPolicyAssignment,

    -- * Request Lenses
    createIAMPolicyAssignment_policyArn,
    createIAMPolicyAssignment_identities,
    createIAMPolicyAssignment_awsAccountId,
    createIAMPolicyAssignment_assignmentName,
    createIAMPolicyAssignment_assignmentStatus,
    createIAMPolicyAssignment_namespace,

    -- * Destructuring the Response
    CreateIAMPolicyAssignmentResponse (..),
    newCreateIAMPolicyAssignmentResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newCreateIAMPolicyAssignment' smart constructor.
data CreateIAMPolicyAssignment = CreateIAMPolicyAssignment'
  { -- | The ARN for the IAMpolicy to apply to the Amazon QuickSight users and
    -- groups specified in this assignment.
    CreateIAMPolicyAssignment -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon QuickSight users, groups, or both that you want to assign the
    -- policy to.
    CreateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
identities :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The ID of the Amazon Web Services account where you want to assign an
    -- IAMpolicy to Amazon QuickSight users or groups.
    CreateIAMPolicyAssignment -> Text
awsAccountId :: Prelude.Text,
    -- | The name of the assignment, also called a rule. It must be unique within
    -- an Amazon Web Services account.
    CreateIAMPolicyAssignment -> Text
assignmentName :: Prelude.Text,
    -- | The status of the assignment. Possible values are as follows:
    --
    -- -   @ENABLED@ - Anything specified in this assignment is used when
    --     creating the data source.
    --
    -- -   @DISABLED@ - This assignment isn\'t used when creating the data
    --     source.
    --
    -- -   @DRAFT@ - This assignment is an unfinished draft and isn\'t used
    --     when creating the data source.
    CreateIAMPolicyAssignment -> AssignmentStatus
assignmentStatus :: AssignmentStatus,
    -- | The namespace that contains the assignment.
    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)

-- |
-- Create a value of 'CreateIAMPolicyAssignment' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'policyArn', 'createIAMPolicyAssignment_policyArn' - The ARN for the IAMpolicy to apply to the Amazon QuickSight users and
-- groups specified in this assignment.
--
-- 'identities', 'createIAMPolicyAssignment_identities' - The Amazon QuickSight users, groups, or both that you want to assign the
-- policy to.
--
-- 'awsAccountId', 'createIAMPolicyAssignment_awsAccountId' - The ID of the Amazon Web Services account where you want to assign an
-- IAMpolicy to Amazon QuickSight users or groups.
--
-- 'assignmentName', 'createIAMPolicyAssignment_assignmentName' - The name of the assignment, also called a rule. It must be unique within
-- an Amazon Web Services account.
--
-- 'assignmentStatus', 'createIAMPolicyAssignment_assignmentStatus' - The status of the assignment. Possible values are as follows:
--
-- -   @ENABLED@ - Anything specified in this assignment is used when
--     creating the data source.
--
-- -   @DISABLED@ - This assignment isn\'t used when creating the data
--     source.
--
-- -   @DRAFT@ - This assignment is an unfinished draft and isn\'t used
--     when creating the data source.
--
-- 'namespace', 'createIAMPolicyAssignment_namespace' - The namespace that contains the assignment.
newCreateIAMPolicyAssignment ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'assignmentName'
  Prelude.Text ->
  -- | 'assignmentStatus'
  AssignmentStatus ->
  -- | 'namespace'
  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_
      }

-- | The ARN for the IAMpolicy to apply to the Amazon QuickSight users and
-- groups specified in this assignment.
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)

-- | The Amazon QuickSight users, groups, or both that you want to assign the
-- policy to.
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

-- | The ID of the Amazon Web Services account where you want to assign an
-- IAMpolicy to Amazon QuickSight users or groups.
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)

-- | The name of the assignment, also called a rule. It must be unique within
-- an Amazon Web Services account.
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)

-- | The status of the assignment. Possible values are as follows:
--
-- -   @ENABLED@ - Anything specified in this assignment is used when
--     creating the data source.
--
-- -   @DISABLED@ - This assignment isn\'t used when creating the data
--     source.
--
-- -   @DRAFT@ - This assignment is an unfinished draft and isn\'t used
--     when creating the data source.
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)

-- | The namespace that contains the assignment.
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

-- | /See:/ 'newCreateIAMPolicyAssignmentResponse' smart constructor.
data CreateIAMPolicyAssignmentResponse = CreateIAMPolicyAssignmentResponse'
  { -- | The Amazon Web Services request ID for this operation.
    CreateIAMPolicyAssignmentResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The name of the assignment. This name must be unique within the Amazon
    -- Web Services account.
    CreateIAMPolicyAssignmentResponse -> Maybe Text
assignmentName :: Prelude.Maybe Prelude.Text,
    -- | The status of the assignment. Possible values are as follows:
    --
    -- -   @ENABLED@ - Anything specified in this assignment is used when
    --     creating the data source.
    --
    -- -   @DISABLED@ - This assignment isn\'t used when creating the data
    --     source.
    --
    -- -   @DRAFT@ - This assignment is an unfinished draft and isn\'t used
    --     when creating the data source.
    CreateIAMPolicyAssignmentResponse -> Maybe AssignmentStatus
assignmentStatus :: Prelude.Maybe AssignmentStatus,
    -- | The ARN for the IAMpolicy that is applied to the Amazon QuickSight users
    -- and groups specified in this assignment.
    CreateIAMPolicyAssignmentResponse -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon QuickSight users, groups, or both that the IAMpolicy is
    -- assigned to.
    CreateIAMPolicyAssignmentResponse -> Maybe (HashMap Text [Text])
identities :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The ID for the assignment.
    CreateIAMPolicyAssignmentResponse -> Maybe Text
assignmentId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    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)

-- |
-- Create a value of 'CreateIAMPolicyAssignmentResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'requestId', 'createIAMPolicyAssignmentResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'assignmentName', 'createIAMPolicyAssignmentResponse_assignmentName' - The name of the assignment. This name must be unique within the Amazon
-- Web Services account.
--
-- 'assignmentStatus', 'createIAMPolicyAssignmentResponse_assignmentStatus' - The status of the assignment. Possible values are as follows:
--
-- -   @ENABLED@ - Anything specified in this assignment is used when
--     creating the data source.
--
-- -   @DISABLED@ - This assignment isn\'t used when creating the data
--     source.
--
-- -   @DRAFT@ - This assignment is an unfinished draft and isn\'t used
--     when creating the data source.
--
-- 'policyArn', 'createIAMPolicyAssignmentResponse_policyArn' - The ARN for the IAMpolicy that is applied to the Amazon QuickSight users
-- and groups specified in this assignment.
--
-- 'identities', 'createIAMPolicyAssignmentResponse_identities' - The Amazon QuickSight users, groups, or both that the IAMpolicy is
-- assigned to.
--
-- 'assignmentId', 'createIAMPolicyAssignmentResponse_assignmentId' - The ID for the assignment.
--
-- 'status', 'createIAMPolicyAssignmentResponse_status' - The HTTP status of the request.
newCreateIAMPolicyAssignmentResponse ::
  -- | 'status'
  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_
    }

-- | The Amazon Web Services request ID for this operation.
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)

-- | The name of the assignment. This name must be unique within the Amazon
-- Web Services account.
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)

-- | The status of the assignment. Possible values are as follows:
--
-- -   @ENABLED@ - Anything specified in this assignment is used when
--     creating the data source.
--
-- -   @DISABLED@ - This assignment isn\'t used when creating the data
--     source.
--
-- -   @DRAFT@ - This assignment is an unfinished draft and isn\'t used
--     when creating the data source.
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)

-- | The ARN for the IAMpolicy that is applied to the Amazon QuickSight users
-- and groups specified in this assignment.
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)

-- | The Amazon QuickSight users, groups, or both that the IAMpolicy is
-- assigned to.
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

-- | The ID for the assignment.
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)

-- | The HTTP status of the request.
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