{-# 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.UpdateIAMPolicyAssignment
-- 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)
--
-- Updates an existing IAMpolicy assignment. This operation updates only
-- the optional parameter or parameters that are specified in the request.
-- This overwrites all of the users included in @Identities@.
module Amazonka.QuickSight.UpdateIAMPolicyAssignment
  ( -- * Creating a Request
    UpdateIAMPolicyAssignment (..),
    newUpdateIAMPolicyAssignment,

    -- * Request Lenses
    updateIAMPolicyAssignment_assignmentStatus,
    updateIAMPolicyAssignment_policyArn,
    updateIAMPolicyAssignment_identities,
    updateIAMPolicyAssignment_awsAccountId,
    updateIAMPolicyAssignment_assignmentName,
    updateIAMPolicyAssignment_namespace,

    -- * Destructuring the Response
    UpdateIAMPolicyAssignmentResponse (..),
    newUpdateIAMPolicyAssignmentResponse,

    -- * Response Lenses
    updateIAMPolicyAssignmentResponse_requestId,
    updateIAMPolicyAssignmentResponse_assignmentName,
    updateIAMPolicyAssignmentResponse_assignmentStatus,
    updateIAMPolicyAssignmentResponse_policyArn,
    updateIAMPolicyAssignmentResponse_identities,
    updateIAMPolicyAssignmentResponse_assignmentId,
    updateIAMPolicyAssignmentResponse_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:/ 'newUpdateIAMPolicyAssignment' smart constructor.
data UpdateIAMPolicyAssignment = UpdateIAMPolicyAssignment'
  { -- | 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.
    UpdateIAMPolicyAssignment -> Maybe AssignmentStatus
assignmentStatus :: Prelude.Maybe AssignmentStatus,
    -- | The ARN for the IAMpolicy to apply to the Amazon QuickSight users and
    -- groups specified in this assignment.
    UpdateIAMPolicyAssignment -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon QuickSight users, groups, or both that you want to assign the
    -- policy to.
    UpdateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
identities :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The ID of the Amazon Web Services account that contains the IAMpolicy
    -- assignment.
    UpdateIAMPolicyAssignment -> Text
awsAccountId :: Prelude.Text,
    -- | The name of the assignment, also called a rule. This name must be unique
    -- within an Amazon Web Services account.
    UpdateIAMPolicyAssignment -> Text
assignmentName :: Prelude.Text,
    -- | The namespace of the assignment.
    UpdateIAMPolicyAssignment -> Text
namespace :: Prelude.Text
  }
  deriving (UpdateIAMPolicyAssignment -> UpdateIAMPolicyAssignment -> Bool
(UpdateIAMPolicyAssignment -> UpdateIAMPolicyAssignment -> Bool)
-> (UpdateIAMPolicyAssignment -> UpdateIAMPolicyAssignment -> Bool)
-> Eq UpdateIAMPolicyAssignment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIAMPolicyAssignment -> UpdateIAMPolicyAssignment -> Bool
$c/= :: UpdateIAMPolicyAssignment -> UpdateIAMPolicyAssignment -> Bool
== :: UpdateIAMPolicyAssignment -> UpdateIAMPolicyAssignment -> Bool
$c== :: UpdateIAMPolicyAssignment -> UpdateIAMPolicyAssignment -> Bool
Prelude.Eq, ReadPrec [UpdateIAMPolicyAssignment]
ReadPrec UpdateIAMPolicyAssignment
Int -> ReadS UpdateIAMPolicyAssignment
ReadS [UpdateIAMPolicyAssignment]
(Int -> ReadS UpdateIAMPolicyAssignment)
-> ReadS [UpdateIAMPolicyAssignment]
-> ReadPrec UpdateIAMPolicyAssignment
-> ReadPrec [UpdateIAMPolicyAssignment]
-> Read UpdateIAMPolicyAssignment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIAMPolicyAssignment]
$creadListPrec :: ReadPrec [UpdateIAMPolicyAssignment]
readPrec :: ReadPrec UpdateIAMPolicyAssignment
$creadPrec :: ReadPrec UpdateIAMPolicyAssignment
readList :: ReadS [UpdateIAMPolicyAssignment]
$creadList :: ReadS [UpdateIAMPolicyAssignment]
readsPrec :: Int -> ReadS UpdateIAMPolicyAssignment
$creadsPrec :: Int -> ReadS UpdateIAMPolicyAssignment
Prelude.Read, Int -> UpdateIAMPolicyAssignment -> ShowS
[UpdateIAMPolicyAssignment] -> ShowS
UpdateIAMPolicyAssignment -> String
(Int -> UpdateIAMPolicyAssignment -> ShowS)
-> (UpdateIAMPolicyAssignment -> String)
-> ([UpdateIAMPolicyAssignment] -> ShowS)
-> Show UpdateIAMPolicyAssignment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIAMPolicyAssignment] -> ShowS
$cshowList :: [UpdateIAMPolicyAssignment] -> ShowS
show :: UpdateIAMPolicyAssignment -> String
$cshow :: UpdateIAMPolicyAssignment -> String
showsPrec :: Int -> UpdateIAMPolicyAssignment -> ShowS
$cshowsPrec :: Int -> UpdateIAMPolicyAssignment -> ShowS
Prelude.Show, (forall x.
 UpdateIAMPolicyAssignment -> Rep UpdateIAMPolicyAssignment x)
-> (forall x.
    Rep UpdateIAMPolicyAssignment x -> UpdateIAMPolicyAssignment)
-> Generic UpdateIAMPolicyAssignment
forall x.
Rep UpdateIAMPolicyAssignment x -> UpdateIAMPolicyAssignment
forall x.
UpdateIAMPolicyAssignment -> Rep UpdateIAMPolicyAssignment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateIAMPolicyAssignment x -> UpdateIAMPolicyAssignment
$cfrom :: forall x.
UpdateIAMPolicyAssignment -> Rep UpdateIAMPolicyAssignment x
Prelude.Generic)

-- |
-- Create a value of 'UpdateIAMPolicyAssignment' 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:
--
-- 'assignmentStatus', 'updateIAMPolicyAssignment_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', 'updateIAMPolicyAssignment_policyArn' - The ARN for the IAMpolicy to apply to the Amazon QuickSight users and
-- groups specified in this assignment.
--
-- 'identities', 'updateIAMPolicyAssignment_identities' - The Amazon QuickSight users, groups, or both that you want to assign the
-- policy to.
--
-- 'awsAccountId', 'updateIAMPolicyAssignment_awsAccountId' - The ID of the Amazon Web Services account that contains the IAMpolicy
-- assignment.
--
-- 'assignmentName', 'updateIAMPolicyAssignment_assignmentName' - The name of the assignment, also called a rule. This name must be unique
-- within an Amazon Web Services account.
--
-- 'namespace', 'updateIAMPolicyAssignment_namespace' - The namespace of the assignment.
newUpdateIAMPolicyAssignment ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'assignmentName'
  Prelude.Text ->
  -- | 'namespace'
  Prelude.Text ->
  UpdateIAMPolicyAssignment
newUpdateIAMPolicyAssignment :: Text -> Text -> Text -> UpdateIAMPolicyAssignment
newUpdateIAMPolicyAssignment
  Text
pAwsAccountId_
  Text
pAssignmentName_
  Text
pNamespace_ =
    UpdateIAMPolicyAssignment' :: Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Text
-> Text
-> Text
-> UpdateIAMPolicyAssignment
UpdateIAMPolicyAssignment'
      { $sel:assignmentStatus:UpdateIAMPolicyAssignment' :: Maybe AssignmentStatus
assignmentStatus =
          Maybe AssignmentStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:policyArn:UpdateIAMPolicyAssignment' :: Maybe Text
policyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:identities:UpdateIAMPolicyAssignment' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:UpdateIAMPolicyAssignment' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:assignmentName:UpdateIAMPolicyAssignment' :: Text
assignmentName = Text
pAssignmentName_,
        $sel:namespace:UpdateIAMPolicyAssignment' :: Text
namespace = Text
pNamespace_
      }

-- | 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.
updateIAMPolicyAssignment_assignmentStatus :: Lens.Lens' UpdateIAMPolicyAssignment (Prelude.Maybe AssignmentStatus)
updateIAMPolicyAssignment_assignmentStatus :: (Maybe AssignmentStatus -> f (Maybe AssignmentStatus))
-> UpdateIAMPolicyAssignment -> f UpdateIAMPolicyAssignment
updateIAMPolicyAssignment_assignmentStatus = (UpdateIAMPolicyAssignment -> Maybe AssignmentStatus)
-> (UpdateIAMPolicyAssignment
    -> Maybe AssignmentStatus -> UpdateIAMPolicyAssignment)
-> Lens
     UpdateIAMPolicyAssignment
     UpdateIAMPolicyAssignment
     (Maybe AssignmentStatus)
     (Maybe AssignmentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignment' {Maybe AssignmentStatus
assignmentStatus :: Maybe AssignmentStatus
$sel:assignmentStatus:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe AssignmentStatus
assignmentStatus} -> Maybe AssignmentStatus
assignmentStatus) (\s :: UpdateIAMPolicyAssignment
s@UpdateIAMPolicyAssignment' {} Maybe AssignmentStatus
a -> UpdateIAMPolicyAssignment
s {$sel:assignmentStatus:UpdateIAMPolicyAssignment' :: Maybe AssignmentStatus
assignmentStatus = Maybe AssignmentStatus
a} :: UpdateIAMPolicyAssignment)

-- | The ARN for the IAMpolicy to apply to the Amazon QuickSight users and
-- groups specified in this assignment.
updateIAMPolicyAssignment_policyArn :: Lens.Lens' UpdateIAMPolicyAssignment (Prelude.Maybe Prelude.Text)
updateIAMPolicyAssignment_policyArn :: (Maybe Text -> f (Maybe Text))
-> UpdateIAMPolicyAssignment -> f UpdateIAMPolicyAssignment
updateIAMPolicyAssignment_policyArn = (UpdateIAMPolicyAssignment -> Maybe Text)
-> (UpdateIAMPolicyAssignment
    -> Maybe Text -> UpdateIAMPolicyAssignment)
-> Lens
     UpdateIAMPolicyAssignment
     UpdateIAMPolicyAssignment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignment' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: UpdateIAMPolicyAssignment
s@UpdateIAMPolicyAssignment' {} Maybe Text
a -> UpdateIAMPolicyAssignment
s {$sel:policyArn:UpdateIAMPolicyAssignment' :: Maybe Text
policyArn = Maybe Text
a} :: UpdateIAMPolicyAssignment)

-- | The Amazon QuickSight users, groups, or both that you want to assign the
-- policy to.
updateIAMPolicyAssignment_identities :: Lens.Lens' UpdateIAMPolicyAssignment (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
updateIAMPolicyAssignment_identities :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> UpdateIAMPolicyAssignment -> f UpdateIAMPolicyAssignment
updateIAMPolicyAssignment_identities = (UpdateIAMPolicyAssignment -> Maybe (HashMap Text [Text]))
-> (UpdateIAMPolicyAssignment
    -> Maybe (HashMap Text [Text]) -> UpdateIAMPolicyAssignment)
-> Lens
     UpdateIAMPolicyAssignment
     UpdateIAMPolicyAssignment
     (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 (\UpdateIAMPolicyAssignment' {Maybe (HashMap Text [Text])
identities :: Maybe (HashMap Text [Text])
$sel:identities:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
identities} -> Maybe (HashMap Text [Text])
identities) (\s :: UpdateIAMPolicyAssignment
s@UpdateIAMPolicyAssignment' {} Maybe (HashMap Text [Text])
a -> UpdateIAMPolicyAssignment
s {$sel:identities:UpdateIAMPolicyAssignment' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
a} :: UpdateIAMPolicyAssignment) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> UpdateIAMPolicyAssignment -> f UpdateIAMPolicyAssignment)
-> ((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])))
-> UpdateIAMPolicyAssignment
-> f UpdateIAMPolicyAssignment
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 that contains the IAMpolicy
-- assignment.
updateIAMPolicyAssignment_awsAccountId :: Lens.Lens' UpdateIAMPolicyAssignment Prelude.Text
updateIAMPolicyAssignment_awsAccountId :: (Text -> f Text)
-> UpdateIAMPolicyAssignment -> f UpdateIAMPolicyAssignment
updateIAMPolicyAssignment_awsAccountId = (UpdateIAMPolicyAssignment -> Text)
-> (UpdateIAMPolicyAssignment -> Text -> UpdateIAMPolicyAssignment)
-> Lens
     UpdateIAMPolicyAssignment UpdateIAMPolicyAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignment' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdateIAMPolicyAssignment
s@UpdateIAMPolicyAssignment' {} Text
a -> UpdateIAMPolicyAssignment
s {$sel:awsAccountId:UpdateIAMPolicyAssignment' :: Text
awsAccountId = Text
a} :: UpdateIAMPolicyAssignment)

-- | The name of the assignment, also called a rule. This name must be unique
-- within an Amazon Web Services account.
updateIAMPolicyAssignment_assignmentName :: Lens.Lens' UpdateIAMPolicyAssignment Prelude.Text
updateIAMPolicyAssignment_assignmentName :: (Text -> f Text)
-> UpdateIAMPolicyAssignment -> f UpdateIAMPolicyAssignment
updateIAMPolicyAssignment_assignmentName = (UpdateIAMPolicyAssignment -> Text)
-> (UpdateIAMPolicyAssignment -> Text -> UpdateIAMPolicyAssignment)
-> Lens
     UpdateIAMPolicyAssignment UpdateIAMPolicyAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignment' {Text
assignmentName :: Text
$sel:assignmentName:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
assignmentName} -> Text
assignmentName) (\s :: UpdateIAMPolicyAssignment
s@UpdateIAMPolicyAssignment' {} Text
a -> UpdateIAMPolicyAssignment
s {$sel:assignmentName:UpdateIAMPolicyAssignment' :: Text
assignmentName = Text
a} :: UpdateIAMPolicyAssignment)

-- | The namespace of the assignment.
updateIAMPolicyAssignment_namespace :: Lens.Lens' UpdateIAMPolicyAssignment Prelude.Text
updateIAMPolicyAssignment_namespace :: (Text -> f Text)
-> UpdateIAMPolicyAssignment -> f UpdateIAMPolicyAssignment
updateIAMPolicyAssignment_namespace = (UpdateIAMPolicyAssignment -> Text)
-> (UpdateIAMPolicyAssignment -> Text -> UpdateIAMPolicyAssignment)
-> Lens
     UpdateIAMPolicyAssignment UpdateIAMPolicyAssignment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignment' {Text
namespace :: Text
$sel:namespace:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
namespace} -> Text
namespace) (\s :: UpdateIAMPolicyAssignment
s@UpdateIAMPolicyAssignment' {} Text
a -> UpdateIAMPolicyAssignment
s {$sel:namespace:UpdateIAMPolicyAssignment' :: Text
namespace = Text
a} :: UpdateIAMPolicyAssignment)

instance Core.AWSRequest UpdateIAMPolicyAssignment where
  type
    AWSResponse UpdateIAMPolicyAssignment =
      UpdateIAMPolicyAssignmentResponse
  request :: UpdateIAMPolicyAssignment -> Request UpdateIAMPolicyAssignment
request = Service
-> UpdateIAMPolicyAssignment -> Request UpdateIAMPolicyAssignment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateIAMPolicyAssignment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIAMPolicyAssignment)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateIAMPolicyAssignment))
-> Logger
-> Service
-> Proxy UpdateIAMPolicyAssignment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIAMPolicyAssignment)))
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
-> UpdateIAMPolicyAssignmentResponse
UpdateIAMPolicyAssignmentResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe AssignmentStatus
 -> Maybe Text
 -> Maybe (HashMap Text [Text])
 -> Maybe Text
 -> Int
 -> UpdateIAMPolicyAssignmentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe AssignmentStatus
      -> Maybe Text
      -> Maybe (HashMap Text [Text])
      -> Maybe Text
      -> Int
      -> UpdateIAMPolicyAssignmentResponse)
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
   -> UpdateIAMPolicyAssignmentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe AssignmentStatus
      -> Maybe Text
      -> Maybe (HashMap Text [Text])
      -> Maybe Text
      -> Int
      -> UpdateIAMPolicyAssignmentResponse)
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
   -> UpdateIAMPolicyAssignmentResponse)
-> Either String (Maybe AssignmentStatus)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text [Text])
      -> Maybe Text
      -> Int
      -> UpdateIAMPolicyAssignmentResponse)
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
   -> UpdateIAMPolicyAssignmentResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text [Text])
      -> Maybe Text -> Int -> UpdateIAMPolicyAssignmentResponse)
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 -> UpdateIAMPolicyAssignmentResponse)
-> Either String (Maybe (HashMap Text [Text]))
-> Either
     String (Maybe Text -> Int -> UpdateIAMPolicyAssignmentResponse)
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 -> UpdateIAMPolicyAssignmentResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateIAMPolicyAssignmentResponse)
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 -> UpdateIAMPolicyAssignmentResponse)
-> Either String Int
-> Either String UpdateIAMPolicyAssignmentResponse
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 UpdateIAMPolicyAssignment

instance Prelude.NFData UpdateIAMPolicyAssignment

instance Core.ToHeaders UpdateIAMPolicyAssignment where
  toHeaders :: UpdateIAMPolicyAssignment -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateIAMPolicyAssignment -> 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 UpdateIAMPolicyAssignment where
  toJSON :: UpdateIAMPolicyAssignment -> Value
toJSON UpdateIAMPolicyAssignment' {Maybe Text
Maybe (HashMap Text [Text])
Maybe AssignmentStatus
Text
namespace :: Text
assignmentName :: Text
awsAccountId :: Text
identities :: Maybe (HashMap Text [Text])
policyArn :: Maybe Text
assignmentStatus :: Maybe AssignmentStatus
$sel:namespace:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
$sel:assignmentName:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
$sel:awsAccountId:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
$sel:identities:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
$sel:policyArn:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe Text
$sel:assignmentStatus:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe AssignmentStatus
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AssignmentStatus" Text -> AssignmentStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AssignmentStatus -> Pair) -> Maybe AssignmentStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AssignmentStatus
assignmentStatus,
            (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
          ]
      )

instance Core.ToPath UpdateIAMPolicyAssignment where
  toPath :: UpdateIAMPolicyAssignment -> ByteString
toPath UpdateIAMPolicyAssignment' {Maybe Text
Maybe (HashMap Text [Text])
Maybe AssignmentStatus
Text
namespace :: Text
assignmentName :: Text
awsAccountId :: Text
identities :: Maybe (HashMap Text [Text])
policyArn :: Maybe Text
assignmentStatus :: Maybe AssignmentStatus
$sel:namespace:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
$sel:assignmentName:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
$sel:awsAccountId:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Text
$sel:identities:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe (HashMap Text [Text])
$sel:policyArn:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe Text
$sel:assignmentStatus:UpdateIAMPolicyAssignment' :: UpdateIAMPolicyAssignment -> Maybe AssignmentStatus
..} =
    [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/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assignmentName
      ]

instance Core.ToQuery UpdateIAMPolicyAssignment where
  toQuery :: UpdateIAMPolicyAssignment -> QueryString
toQuery = QueryString -> UpdateIAMPolicyAssignment -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateIAMPolicyAssignmentResponse' smart constructor.
data UpdateIAMPolicyAssignmentResponse = UpdateIAMPolicyAssignmentResponse'
  { -- | The Amazon Web Services request ID for this operation.
    UpdateIAMPolicyAssignmentResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The name of the assignment or rule.
    UpdateIAMPolicyAssignmentResponse -> 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.
    UpdateIAMPolicyAssignmentResponse -> Maybe AssignmentStatus
assignmentStatus :: Prelude.Maybe AssignmentStatus,
    -- | The ARN for the IAMpolicy applied to the Amazon QuickSight users and
    -- groups specified in this assignment.
    UpdateIAMPolicyAssignmentResponse -> Maybe Text
policyArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon QuickSight users, groups, or both that the IAMpolicy is
    -- assigned to.
    UpdateIAMPolicyAssignmentResponse -> Maybe (HashMap Text [Text])
identities :: Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]),
    -- | The ID of the assignment.
    UpdateIAMPolicyAssignmentResponse -> Maybe Text
assignmentId :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    UpdateIAMPolicyAssignmentResponse -> Int
status :: Prelude.Int
  }
  deriving (UpdateIAMPolicyAssignmentResponse
-> UpdateIAMPolicyAssignmentResponse -> Bool
(UpdateIAMPolicyAssignmentResponse
 -> UpdateIAMPolicyAssignmentResponse -> Bool)
-> (UpdateIAMPolicyAssignmentResponse
    -> UpdateIAMPolicyAssignmentResponse -> Bool)
-> Eq UpdateIAMPolicyAssignmentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIAMPolicyAssignmentResponse
-> UpdateIAMPolicyAssignmentResponse -> Bool
$c/= :: UpdateIAMPolicyAssignmentResponse
-> UpdateIAMPolicyAssignmentResponse -> Bool
== :: UpdateIAMPolicyAssignmentResponse
-> UpdateIAMPolicyAssignmentResponse -> Bool
$c== :: UpdateIAMPolicyAssignmentResponse
-> UpdateIAMPolicyAssignmentResponse -> Bool
Prelude.Eq, ReadPrec [UpdateIAMPolicyAssignmentResponse]
ReadPrec UpdateIAMPolicyAssignmentResponse
Int -> ReadS UpdateIAMPolicyAssignmentResponse
ReadS [UpdateIAMPolicyAssignmentResponse]
(Int -> ReadS UpdateIAMPolicyAssignmentResponse)
-> ReadS [UpdateIAMPolicyAssignmentResponse]
-> ReadPrec UpdateIAMPolicyAssignmentResponse
-> ReadPrec [UpdateIAMPolicyAssignmentResponse]
-> Read UpdateIAMPolicyAssignmentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIAMPolicyAssignmentResponse]
$creadListPrec :: ReadPrec [UpdateIAMPolicyAssignmentResponse]
readPrec :: ReadPrec UpdateIAMPolicyAssignmentResponse
$creadPrec :: ReadPrec UpdateIAMPolicyAssignmentResponse
readList :: ReadS [UpdateIAMPolicyAssignmentResponse]
$creadList :: ReadS [UpdateIAMPolicyAssignmentResponse]
readsPrec :: Int -> ReadS UpdateIAMPolicyAssignmentResponse
$creadsPrec :: Int -> ReadS UpdateIAMPolicyAssignmentResponse
Prelude.Read, Int -> UpdateIAMPolicyAssignmentResponse -> ShowS
[UpdateIAMPolicyAssignmentResponse] -> ShowS
UpdateIAMPolicyAssignmentResponse -> String
(Int -> UpdateIAMPolicyAssignmentResponse -> ShowS)
-> (UpdateIAMPolicyAssignmentResponse -> String)
-> ([UpdateIAMPolicyAssignmentResponse] -> ShowS)
-> Show UpdateIAMPolicyAssignmentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIAMPolicyAssignmentResponse] -> ShowS
$cshowList :: [UpdateIAMPolicyAssignmentResponse] -> ShowS
show :: UpdateIAMPolicyAssignmentResponse -> String
$cshow :: UpdateIAMPolicyAssignmentResponse -> String
showsPrec :: Int -> UpdateIAMPolicyAssignmentResponse -> ShowS
$cshowsPrec :: Int -> UpdateIAMPolicyAssignmentResponse -> ShowS
Prelude.Show, (forall x.
 UpdateIAMPolicyAssignmentResponse
 -> Rep UpdateIAMPolicyAssignmentResponse x)
-> (forall x.
    Rep UpdateIAMPolicyAssignmentResponse x
    -> UpdateIAMPolicyAssignmentResponse)
-> Generic UpdateIAMPolicyAssignmentResponse
forall x.
Rep UpdateIAMPolicyAssignmentResponse x
-> UpdateIAMPolicyAssignmentResponse
forall x.
UpdateIAMPolicyAssignmentResponse
-> Rep UpdateIAMPolicyAssignmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateIAMPolicyAssignmentResponse x
-> UpdateIAMPolicyAssignmentResponse
$cfrom :: forall x.
UpdateIAMPolicyAssignmentResponse
-> Rep UpdateIAMPolicyAssignmentResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateIAMPolicyAssignmentResponse' 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', 'updateIAMPolicyAssignmentResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'assignmentName', 'updateIAMPolicyAssignmentResponse_assignmentName' - The name of the assignment or rule.
--
-- 'assignmentStatus', 'updateIAMPolicyAssignmentResponse_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', 'updateIAMPolicyAssignmentResponse_policyArn' - The ARN for the IAMpolicy applied to the Amazon QuickSight users and
-- groups specified in this assignment.
--
-- 'identities', 'updateIAMPolicyAssignmentResponse_identities' - The Amazon QuickSight users, groups, or both that the IAMpolicy is
-- assigned to.
--
-- 'assignmentId', 'updateIAMPolicyAssignmentResponse_assignmentId' - The ID of the assignment.
--
-- 'status', 'updateIAMPolicyAssignmentResponse_status' - The HTTP status of the request.
newUpdateIAMPolicyAssignmentResponse ::
  -- | 'status'
  Prelude.Int ->
  UpdateIAMPolicyAssignmentResponse
newUpdateIAMPolicyAssignmentResponse :: Int -> UpdateIAMPolicyAssignmentResponse
newUpdateIAMPolicyAssignmentResponse Int
pStatus_ =
  UpdateIAMPolicyAssignmentResponse' :: Maybe Text
-> Maybe Text
-> Maybe AssignmentStatus
-> Maybe Text
-> Maybe (HashMap Text [Text])
-> Maybe Text
-> Int
-> UpdateIAMPolicyAssignmentResponse
UpdateIAMPolicyAssignmentResponse'
    { $sel:requestId:UpdateIAMPolicyAssignmentResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:assignmentName:UpdateIAMPolicyAssignmentResponse' :: Maybe Text
assignmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:assignmentStatus:UpdateIAMPolicyAssignmentResponse' :: Maybe AssignmentStatus
assignmentStatus = Maybe AssignmentStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:policyArn:UpdateIAMPolicyAssignmentResponse' :: Maybe Text
policyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identities:UpdateIAMPolicyAssignmentResponse' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
forall a. Maybe a
Prelude.Nothing,
      $sel:assignmentId:UpdateIAMPolicyAssignmentResponse' :: Maybe Text
assignmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateIAMPolicyAssignmentResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
updateIAMPolicyAssignmentResponse_requestId :: Lens.Lens' UpdateIAMPolicyAssignmentResponse (Prelude.Maybe Prelude.Text)
updateIAMPolicyAssignmentResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> UpdateIAMPolicyAssignmentResponse
-> f UpdateIAMPolicyAssignmentResponse
updateIAMPolicyAssignmentResponse_requestId = (UpdateIAMPolicyAssignmentResponse -> Maybe Text)
-> (UpdateIAMPolicyAssignmentResponse
    -> Maybe Text -> UpdateIAMPolicyAssignmentResponse)
-> Lens
     UpdateIAMPolicyAssignmentResponse
     UpdateIAMPolicyAssignmentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignmentResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:UpdateIAMPolicyAssignmentResponse' :: UpdateIAMPolicyAssignmentResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: UpdateIAMPolicyAssignmentResponse
s@UpdateIAMPolicyAssignmentResponse' {} Maybe Text
a -> UpdateIAMPolicyAssignmentResponse
s {$sel:requestId:UpdateIAMPolicyAssignmentResponse' :: Maybe Text
requestId = Maybe Text
a} :: UpdateIAMPolicyAssignmentResponse)

-- | The name of the assignment or rule.
updateIAMPolicyAssignmentResponse_assignmentName :: Lens.Lens' UpdateIAMPolicyAssignmentResponse (Prelude.Maybe Prelude.Text)
updateIAMPolicyAssignmentResponse_assignmentName :: (Maybe Text -> f (Maybe Text))
-> UpdateIAMPolicyAssignmentResponse
-> f UpdateIAMPolicyAssignmentResponse
updateIAMPolicyAssignmentResponse_assignmentName = (UpdateIAMPolicyAssignmentResponse -> Maybe Text)
-> (UpdateIAMPolicyAssignmentResponse
    -> Maybe Text -> UpdateIAMPolicyAssignmentResponse)
-> Lens
     UpdateIAMPolicyAssignmentResponse
     UpdateIAMPolicyAssignmentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignmentResponse' {Maybe Text
assignmentName :: Maybe Text
$sel:assignmentName:UpdateIAMPolicyAssignmentResponse' :: UpdateIAMPolicyAssignmentResponse -> Maybe Text
assignmentName} -> Maybe Text
assignmentName) (\s :: UpdateIAMPolicyAssignmentResponse
s@UpdateIAMPolicyAssignmentResponse' {} Maybe Text
a -> UpdateIAMPolicyAssignmentResponse
s {$sel:assignmentName:UpdateIAMPolicyAssignmentResponse' :: Maybe Text
assignmentName = Maybe Text
a} :: UpdateIAMPolicyAssignmentResponse)

-- | 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.
updateIAMPolicyAssignmentResponse_assignmentStatus :: Lens.Lens' UpdateIAMPolicyAssignmentResponse (Prelude.Maybe AssignmentStatus)
updateIAMPolicyAssignmentResponse_assignmentStatus :: (Maybe AssignmentStatus -> f (Maybe AssignmentStatus))
-> UpdateIAMPolicyAssignmentResponse
-> f UpdateIAMPolicyAssignmentResponse
updateIAMPolicyAssignmentResponse_assignmentStatus = (UpdateIAMPolicyAssignmentResponse -> Maybe AssignmentStatus)
-> (UpdateIAMPolicyAssignmentResponse
    -> Maybe AssignmentStatus -> UpdateIAMPolicyAssignmentResponse)
-> Lens
     UpdateIAMPolicyAssignmentResponse
     UpdateIAMPolicyAssignmentResponse
     (Maybe AssignmentStatus)
     (Maybe AssignmentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignmentResponse' {Maybe AssignmentStatus
assignmentStatus :: Maybe AssignmentStatus
$sel:assignmentStatus:UpdateIAMPolicyAssignmentResponse' :: UpdateIAMPolicyAssignmentResponse -> Maybe AssignmentStatus
assignmentStatus} -> Maybe AssignmentStatus
assignmentStatus) (\s :: UpdateIAMPolicyAssignmentResponse
s@UpdateIAMPolicyAssignmentResponse' {} Maybe AssignmentStatus
a -> UpdateIAMPolicyAssignmentResponse
s {$sel:assignmentStatus:UpdateIAMPolicyAssignmentResponse' :: Maybe AssignmentStatus
assignmentStatus = Maybe AssignmentStatus
a} :: UpdateIAMPolicyAssignmentResponse)

-- | The ARN for the IAMpolicy applied to the Amazon QuickSight users and
-- groups specified in this assignment.
updateIAMPolicyAssignmentResponse_policyArn :: Lens.Lens' UpdateIAMPolicyAssignmentResponse (Prelude.Maybe Prelude.Text)
updateIAMPolicyAssignmentResponse_policyArn :: (Maybe Text -> f (Maybe Text))
-> UpdateIAMPolicyAssignmentResponse
-> f UpdateIAMPolicyAssignmentResponse
updateIAMPolicyAssignmentResponse_policyArn = (UpdateIAMPolicyAssignmentResponse -> Maybe Text)
-> (UpdateIAMPolicyAssignmentResponse
    -> Maybe Text -> UpdateIAMPolicyAssignmentResponse)
-> Lens
     UpdateIAMPolicyAssignmentResponse
     UpdateIAMPolicyAssignmentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignmentResponse' {Maybe Text
policyArn :: Maybe Text
$sel:policyArn:UpdateIAMPolicyAssignmentResponse' :: UpdateIAMPolicyAssignmentResponse -> Maybe Text
policyArn} -> Maybe Text
policyArn) (\s :: UpdateIAMPolicyAssignmentResponse
s@UpdateIAMPolicyAssignmentResponse' {} Maybe Text
a -> UpdateIAMPolicyAssignmentResponse
s {$sel:policyArn:UpdateIAMPolicyAssignmentResponse' :: Maybe Text
policyArn = Maybe Text
a} :: UpdateIAMPolicyAssignmentResponse)

-- | The Amazon QuickSight users, groups, or both that the IAMpolicy is
-- assigned to.
updateIAMPolicyAssignmentResponse_identities :: Lens.Lens' UpdateIAMPolicyAssignmentResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
updateIAMPolicyAssignmentResponse_identities :: (Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
-> UpdateIAMPolicyAssignmentResponse
-> f UpdateIAMPolicyAssignmentResponse
updateIAMPolicyAssignmentResponse_identities = (UpdateIAMPolicyAssignmentResponse -> Maybe (HashMap Text [Text]))
-> (UpdateIAMPolicyAssignmentResponse
    -> Maybe (HashMap Text [Text])
    -> UpdateIAMPolicyAssignmentResponse)
-> Lens
     UpdateIAMPolicyAssignmentResponse
     UpdateIAMPolicyAssignmentResponse
     (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 (\UpdateIAMPolicyAssignmentResponse' {Maybe (HashMap Text [Text])
identities :: Maybe (HashMap Text [Text])
$sel:identities:UpdateIAMPolicyAssignmentResponse' :: UpdateIAMPolicyAssignmentResponse -> Maybe (HashMap Text [Text])
identities} -> Maybe (HashMap Text [Text])
identities) (\s :: UpdateIAMPolicyAssignmentResponse
s@UpdateIAMPolicyAssignmentResponse' {} Maybe (HashMap Text [Text])
a -> UpdateIAMPolicyAssignmentResponse
s {$sel:identities:UpdateIAMPolicyAssignmentResponse' :: Maybe (HashMap Text [Text])
identities = Maybe (HashMap Text [Text])
a} :: UpdateIAMPolicyAssignmentResponse) ((Maybe (HashMap Text [Text]) -> f (Maybe (HashMap Text [Text])))
 -> UpdateIAMPolicyAssignmentResponse
 -> f UpdateIAMPolicyAssignmentResponse)
-> ((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])))
-> UpdateIAMPolicyAssignmentResponse
-> f UpdateIAMPolicyAssignmentResponse
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 assignment.
updateIAMPolicyAssignmentResponse_assignmentId :: Lens.Lens' UpdateIAMPolicyAssignmentResponse (Prelude.Maybe Prelude.Text)
updateIAMPolicyAssignmentResponse_assignmentId :: (Maybe Text -> f (Maybe Text))
-> UpdateIAMPolicyAssignmentResponse
-> f UpdateIAMPolicyAssignmentResponse
updateIAMPolicyAssignmentResponse_assignmentId = (UpdateIAMPolicyAssignmentResponse -> Maybe Text)
-> (UpdateIAMPolicyAssignmentResponse
    -> Maybe Text -> UpdateIAMPolicyAssignmentResponse)
-> Lens
     UpdateIAMPolicyAssignmentResponse
     UpdateIAMPolicyAssignmentResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignmentResponse' {Maybe Text
assignmentId :: Maybe Text
$sel:assignmentId:UpdateIAMPolicyAssignmentResponse' :: UpdateIAMPolicyAssignmentResponse -> Maybe Text
assignmentId} -> Maybe Text
assignmentId) (\s :: UpdateIAMPolicyAssignmentResponse
s@UpdateIAMPolicyAssignmentResponse' {} Maybe Text
a -> UpdateIAMPolicyAssignmentResponse
s {$sel:assignmentId:UpdateIAMPolicyAssignmentResponse' :: Maybe Text
assignmentId = Maybe Text
a} :: UpdateIAMPolicyAssignmentResponse)

-- | The HTTP status of the request.
updateIAMPolicyAssignmentResponse_status :: Lens.Lens' UpdateIAMPolicyAssignmentResponse Prelude.Int
updateIAMPolicyAssignmentResponse_status :: (Int -> f Int)
-> UpdateIAMPolicyAssignmentResponse
-> f UpdateIAMPolicyAssignmentResponse
updateIAMPolicyAssignmentResponse_status = (UpdateIAMPolicyAssignmentResponse -> Int)
-> (UpdateIAMPolicyAssignmentResponse
    -> Int -> UpdateIAMPolicyAssignmentResponse)
-> Lens
     UpdateIAMPolicyAssignmentResponse
     UpdateIAMPolicyAssignmentResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIAMPolicyAssignmentResponse' {Int
status :: Int
$sel:status:UpdateIAMPolicyAssignmentResponse' :: UpdateIAMPolicyAssignmentResponse -> Int
status} -> Int
status) (\s :: UpdateIAMPolicyAssignmentResponse
s@UpdateIAMPolicyAssignmentResponse' {} Int
a -> UpdateIAMPolicyAssignmentResponse
s {$sel:status:UpdateIAMPolicyAssignmentResponse' :: Int
status = Int
a} :: UpdateIAMPolicyAssignmentResponse)

instance
  Prelude.NFData
    UpdateIAMPolicyAssignmentResponse