{-# 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.Kendra.DescribePrincipalMapping
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the processing of @PUT@ and @DELETE@ actions for mapping users
-- to their groups. This includes information on the status of actions
-- currently processing or yet to be processed, when actions were last
-- updated, when actions were received by Amazon Kendra, the latest action
-- that should process and apply after other actions, and useful error
-- messages if an action could not be processed.
--
-- @DescribePrincipalMapping@ is currently not supported in the Amazon Web
-- Services GovCloud (US-West) region.
module Amazonka.Kendra.DescribePrincipalMapping
  ( -- * Creating a Request
    DescribePrincipalMapping (..),
    newDescribePrincipalMapping,

    -- * Request Lenses
    describePrincipalMapping_dataSourceId,
    describePrincipalMapping_indexId,
    describePrincipalMapping_groupId,

    -- * Destructuring the Response
    DescribePrincipalMappingResponse (..),
    newDescribePrincipalMappingResponse,

    -- * Response Lenses
    describePrincipalMappingResponse_dataSourceId,
    describePrincipalMappingResponse_groupId,
    describePrincipalMappingResponse_groupOrderingIdSummaries,
    describePrincipalMappingResponse_indexId,
    describePrincipalMappingResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribePrincipalMapping' smart constructor.
data DescribePrincipalMapping = DescribePrincipalMapping'
  { -- | The identifier of the data source to check the processing of @PUT@ and
    -- @DELETE@ actions for mapping users to their groups.
    DescribePrincipalMapping -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the index required to check the processing of @PUT@
    -- and @DELETE@ actions for mapping users to their groups.
    DescribePrincipalMapping -> Text
indexId :: Prelude.Text,
    -- | The identifier of the group required to check the processing of @PUT@
    -- and @DELETE@ actions for mapping users to their groups.
    DescribePrincipalMapping -> Text
groupId :: Prelude.Text
  }
  deriving (DescribePrincipalMapping -> DescribePrincipalMapping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePrincipalMapping -> DescribePrincipalMapping -> Bool
$c/= :: DescribePrincipalMapping -> DescribePrincipalMapping -> Bool
== :: DescribePrincipalMapping -> DescribePrincipalMapping -> Bool
$c== :: DescribePrincipalMapping -> DescribePrincipalMapping -> Bool
Prelude.Eq, ReadPrec [DescribePrincipalMapping]
ReadPrec DescribePrincipalMapping
Int -> ReadS DescribePrincipalMapping
ReadS [DescribePrincipalMapping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePrincipalMapping]
$creadListPrec :: ReadPrec [DescribePrincipalMapping]
readPrec :: ReadPrec DescribePrincipalMapping
$creadPrec :: ReadPrec DescribePrincipalMapping
readList :: ReadS [DescribePrincipalMapping]
$creadList :: ReadS [DescribePrincipalMapping]
readsPrec :: Int -> ReadS DescribePrincipalMapping
$creadsPrec :: Int -> ReadS DescribePrincipalMapping
Prelude.Read, Int -> DescribePrincipalMapping -> ShowS
[DescribePrincipalMapping] -> ShowS
DescribePrincipalMapping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePrincipalMapping] -> ShowS
$cshowList :: [DescribePrincipalMapping] -> ShowS
show :: DescribePrincipalMapping -> String
$cshow :: DescribePrincipalMapping -> String
showsPrec :: Int -> DescribePrincipalMapping -> ShowS
$cshowsPrec :: Int -> DescribePrincipalMapping -> ShowS
Prelude.Show, forall x.
Rep DescribePrincipalMapping x -> DescribePrincipalMapping
forall x.
DescribePrincipalMapping -> Rep DescribePrincipalMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePrincipalMapping x -> DescribePrincipalMapping
$cfrom :: forall x.
DescribePrincipalMapping -> Rep DescribePrincipalMapping x
Prelude.Generic)

-- |
-- Create a value of 'DescribePrincipalMapping' 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:
--
-- 'dataSourceId', 'describePrincipalMapping_dataSourceId' - The identifier of the data source to check the processing of @PUT@ and
-- @DELETE@ actions for mapping users to their groups.
--
-- 'indexId', 'describePrincipalMapping_indexId' - The identifier of the index required to check the processing of @PUT@
-- and @DELETE@ actions for mapping users to their groups.
--
-- 'groupId', 'describePrincipalMapping_groupId' - The identifier of the group required to check the processing of @PUT@
-- and @DELETE@ actions for mapping users to their groups.
newDescribePrincipalMapping ::
  -- | 'indexId'
  Prelude.Text ->
  -- | 'groupId'
  Prelude.Text ->
  DescribePrincipalMapping
newDescribePrincipalMapping :: Text -> Text -> DescribePrincipalMapping
newDescribePrincipalMapping Text
pIndexId_ Text
pGroupId_ =
  DescribePrincipalMapping'
    { $sel:dataSourceId:DescribePrincipalMapping' :: Maybe Text
dataSourceId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:indexId:DescribePrincipalMapping' :: Text
indexId = Text
pIndexId_,
      $sel:groupId:DescribePrincipalMapping' :: Text
groupId = Text
pGroupId_
    }

-- | The identifier of the data source to check the processing of @PUT@ and
-- @DELETE@ actions for mapping users to their groups.
describePrincipalMapping_dataSourceId :: Lens.Lens' DescribePrincipalMapping (Prelude.Maybe Prelude.Text)
describePrincipalMapping_dataSourceId :: Lens' DescribePrincipalMapping (Maybe Text)
describePrincipalMapping_dataSourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalMapping' {Maybe Text
dataSourceId :: Maybe Text
$sel:dataSourceId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Maybe Text
dataSourceId} -> Maybe Text
dataSourceId) (\s :: DescribePrincipalMapping
s@DescribePrincipalMapping' {} Maybe Text
a -> DescribePrincipalMapping
s {$sel:dataSourceId:DescribePrincipalMapping' :: Maybe Text
dataSourceId = Maybe Text
a} :: DescribePrincipalMapping)

-- | The identifier of the index required to check the processing of @PUT@
-- and @DELETE@ actions for mapping users to their groups.
describePrincipalMapping_indexId :: Lens.Lens' DescribePrincipalMapping Prelude.Text
describePrincipalMapping_indexId :: Lens' DescribePrincipalMapping Text
describePrincipalMapping_indexId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalMapping' {Text
indexId :: Text
$sel:indexId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Text
indexId} -> Text
indexId) (\s :: DescribePrincipalMapping
s@DescribePrincipalMapping' {} Text
a -> DescribePrincipalMapping
s {$sel:indexId:DescribePrincipalMapping' :: Text
indexId = Text
a} :: DescribePrincipalMapping)

-- | The identifier of the group required to check the processing of @PUT@
-- and @DELETE@ actions for mapping users to their groups.
describePrincipalMapping_groupId :: Lens.Lens' DescribePrincipalMapping Prelude.Text
describePrincipalMapping_groupId :: Lens' DescribePrincipalMapping Text
describePrincipalMapping_groupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalMapping' {Text
groupId :: Text
$sel:groupId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Text
groupId} -> Text
groupId) (\s :: DescribePrincipalMapping
s@DescribePrincipalMapping' {} Text
a -> DescribePrincipalMapping
s {$sel:groupId:DescribePrincipalMapping' :: Text
groupId = Text
a} :: DescribePrincipalMapping)

instance Core.AWSRequest DescribePrincipalMapping where
  type
    AWSResponse DescribePrincipalMapping =
      DescribePrincipalMappingResponse
  request :: (Service -> Service)
-> DescribePrincipalMapping -> Request DescribePrincipalMapping
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribePrincipalMapping
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribePrincipalMapping)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [GroupOrderingIdSummary]
-> Maybe Text
-> Int
-> DescribePrincipalMappingResponse
DescribePrincipalMappingResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DataSourceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GroupId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GroupOrderingIdSummaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"IndexId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribePrincipalMapping where
  hashWithSalt :: Int -> DescribePrincipalMapping -> Int
hashWithSalt Int
_salt DescribePrincipalMapping' {Maybe Text
Text
groupId :: Text
indexId :: Text
dataSourceId :: Maybe Text
$sel:groupId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Text
$sel:indexId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Text
$sel:dataSourceId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dataSourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
indexId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
groupId

instance Prelude.NFData DescribePrincipalMapping where
  rnf :: DescribePrincipalMapping -> ()
rnf DescribePrincipalMapping' {Maybe Text
Text
groupId :: Text
indexId :: Text
dataSourceId :: Maybe Text
$sel:groupId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Text
$sel:indexId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Text
$sel:dataSourceId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dataSourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
indexId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
groupId

instance Data.ToHeaders DescribePrincipalMapping where
  toHeaders :: DescribePrincipalMapping -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSKendraFrontendService.DescribePrincipalMapping" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribePrincipalMapping where
  toJSON :: DescribePrincipalMapping -> Value
toJSON DescribePrincipalMapping' {Maybe Text
Text
groupId :: Text
indexId :: Text
dataSourceId :: Maybe Text
$sel:groupId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Text
$sel:indexId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Text
$sel:dataSourceId:DescribePrincipalMapping' :: DescribePrincipalMapping -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"DataSourceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dataSourceId,
            forall a. a -> Maybe a
Prelude.Just (Key
"IndexId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
indexId),
            forall a. a -> Maybe a
Prelude.Just (Key
"GroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
groupId)
          ]
      )

instance Data.ToPath DescribePrincipalMapping where
  toPath :: DescribePrincipalMapping -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDescribePrincipalMappingResponse' smart constructor.
data DescribePrincipalMappingResponse = DescribePrincipalMappingResponse'
  { -- | Shows the identifier of the data source to see information on the
    -- processing of @PUT@ and @DELETE@ actions for mapping users to their
    -- groups.
    DescribePrincipalMappingResponse -> Maybe Text
dataSourceId :: Prelude.Maybe Prelude.Text,
    -- | Shows the identifier of the group to see information on the processing
    -- of @PUT@ and @DELETE@ actions for mapping users to their groups.
    DescribePrincipalMappingResponse -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
    -- | Shows the following information on the processing of @PUT@ and @DELETE@
    -- actions for mapping users to their groups:
    --
    -- -   Status – the status can be either @PROCESSING@, @SUCCEEDED@,
    --     @DELETING@, @DELETED@, or @FAILED@.
    --
    -- -   Last updated – the last date-time an action was updated.
    --
    -- -   Received – the last date-time an action was received or submitted.
    --
    -- -   Ordering ID – the latest action that should process and apply after
    --     other actions.
    --
    -- -   Failure reason – the reason an action could not be processed.
    DescribePrincipalMappingResponse -> Maybe [GroupOrderingIdSummary]
groupOrderingIdSummaries :: Prelude.Maybe [GroupOrderingIdSummary],
    -- | Shows the identifier of the index to see information on the processing
    -- of @PUT@ and @DELETE@ actions for mapping users to their groups.
    DescribePrincipalMappingResponse -> Maybe Text
indexId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribePrincipalMappingResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribePrincipalMappingResponse
-> DescribePrincipalMappingResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePrincipalMappingResponse
-> DescribePrincipalMappingResponse -> Bool
$c/= :: DescribePrincipalMappingResponse
-> DescribePrincipalMappingResponse -> Bool
== :: DescribePrincipalMappingResponse
-> DescribePrincipalMappingResponse -> Bool
$c== :: DescribePrincipalMappingResponse
-> DescribePrincipalMappingResponse -> Bool
Prelude.Eq, ReadPrec [DescribePrincipalMappingResponse]
ReadPrec DescribePrincipalMappingResponse
Int -> ReadS DescribePrincipalMappingResponse
ReadS [DescribePrincipalMappingResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePrincipalMappingResponse]
$creadListPrec :: ReadPrec [DescribePrincipalMappingResponse]
readPrec :: ReadPrec DescribePrincipalMappingResponse
$creadPrec :: ReadPrec DescribePrincipalMappingResponse
readList :: ReadS [DescribePrincipalMappingResponse]
$creadList :: ReadS [DescribePrincipalMappingResponse]
readsPrec :: Int -> ReadS DescribePrincipalMappingResponse
$creadsPrec :: Int -> ReadS DescribePrincipalMappingResponse
Prelude.Read, Int -> DescribePrincipalMappingResponse -> ShowS
[DescribePrincipalMappingResponse] -> ShowS
DescribePrincipalMappingResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePrincipalMappingResponse] -> ShowS
$cshowList :: [DescribePrincipalMappingResponse] -> ShowS
show :: DescribePrincipalMappingResponse -> String
$cshow :: DescribePrincipalMappingResponse -> String
showsPrec :: Int -> DescribePrincipalMappingResponse -> ShowS
$cshowsPrec :: Int -> DescribePrincipalMappingResponse -> ShowS
Prelude.Show, forall x.
Rep DescribePrincipalMappingResponse x
-> DescribePrincipalMappingResponse
forall x.
DescribePrincipalMappingResponse
-> Rep DescribePrincipalMappingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePrincipalMappingResponse x
-> DescribePrincipalMappingResponse
$cfrom :: forall x.
DescribePrincipalMappingResponse
-> Rep DescribePrincipalMappingResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribePrincipalMappingResponse' 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:
--
-- 'dataSourceId', 'describePrincipalMappingResponse_dataSourceId' - Shows the identifier of the data source to see information on the
-- processing of @PUT@ and @DELETE@ actions for mapping users to their
-- groups.
--
-- 'groupId', 'describePrincipalMappingResponse_groupId' - Shows the identifier of the group to see information on the processing
-- of @PUT@ and @DELETE@ actions for mapping users to their groups.
--
-- 'groupOrderingIdSummaries', 'describePrincipalMappingResponse_groupOrderingIdSummaries' - Shows the following information on the processing of @PUT@ and @DELETE@
-- actions for mapping users to their groups:
--
-- -   Status – the status can be either @PROCESSING@, @SUCCEEDED@,
--     @DELETING@, @DELETED@, or @FAILED@.
--
-- -   Last updated – the last date-time an action was updated.
--
-- -   Received – the last date-time an action was received or submitted.
--
-- -   Ordering ID – the latest action that should process and apply after
--     other actions.
--
-- -   Failure reason – the reason an action could not be processed.
--
-- 'indexId', 'describePrincipalMappingResponse_indexId' - Shows the identifier of the index to see information on the processing
-- of @PUT@ and @DELETE@ actions for mapping users to their groups.
--
-- 'httpStatus', 'describePrincipalMappingResponse_httpStatus' - The response's http status code.
newDescribePrincipalMappingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribePrincipalMappingResponse
newDescribePrincipalMappingResponse :: Int -> DescribePrincipalMappingResponse
newDescribePrincipalMappingResponse Int
pHttpStatus_ =
  DescribePrincipalMappingResponse'
    { $sel:dataSourceId:DescribePrincipalMappingResponse' :: Maybe Text
dataSourceId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:groupId:DescribePrincipalMappingResponse' :: Maybe Text
groupId = forall a. Maybe a
Prelude.Nothing,
      $sel:groupOrderingIdSummaries:DescribePrincipalMappingResponse' :: Maybe [GroupOrderingIdSummary]
groupOrderingIdSummaries =
        forall a. Maybe a
Prelude.Nothing,
      $sel:indexId:DescribePrincipalMappingResponse' :: Maybe Text
indexId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribePrincipalMappingResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Shows the identifier of the data source to see information on the
-- processing of @PUT@ and @DELETE@ actions for mapping users to their
-- groups.
describePrincipalMappingResponse_dataSourceId :: Lens.Lens' DescribePrincipalMappingResponse (Prelude.Maybe Prelude.Text)
describePrincipalMappingResponse_dataSourceId :: Lens' DescribePrincipalMappingResponse (Maybe Text)
describePrincipalMappingResponse_dataSourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalMappingResponse' {Maybe Text
dataSourceId :: Maybe Text
$sel:dataSourceId:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Maybe Text
dataSourceId} -> Maybe Text
dataSourceId) (\s :: DescribePrincipalMappingResponse
s@DescribePrincipalMappingResponse' {} Maybe Text
a -> DescribePrincipalMappingResponse
s {$sel:dataSourceId:DescribePrincipalMappingResponse' :: Maybe Text
dataSourceId = Maybe Text
a} :: DescribePrincipalMappingResponse)

-- | Shows the identifier of the group to see information on the processing
-- of @PUT@ and @DELETE@ actions for mapping users to their groups.
describePrincipalMappingResponse_groupId :: Lens.Lens' DescribePrincipalMappingResponse (Prelude.Maybe Prelude.Text)
describePrincipalMappingResponse_groupId :: Lens' DescribePrincipalMappingResponse (Maybe Text)
describePrincipalMappingResponse_groupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalMappingResponse' {Maybe Text
groupId :: Maybe Text
$sel:groupId:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: DescribePrincipalMappingResponse
s@DescribePrincipalMappingResponse' {} Maybe Text
a -> DescribePrincipalMappingResponse
s {$sel:groupId:DescribePrincipalMappingResponse' :: Maybe Text
groupId = Maybe Text
a} :: DescribePrincipalMappingResponse)

-- | Shows the following information on the processing of @PUT@ and @DELETE@
-- actions for mapping users to their groups:
--
-- -   Status – the status can be either @PROCESSING@, @SUCCEEDED@,
--     @DELETING@, @DELETED@, or @FAILED@.
--
-- -   Last updated – the last date-time an action was updated.
--
-- -   Received – the last date-time an action was received or submitted.
--
-- -   Ordering ID – the latest action that should process and apply after
--     other actions.
--
-- -   Failure reason – the reason an action could not be processed.
describePrincipalMappingResponse_groupOrderingIdSummaries :: Lens.Lens' DescribePrincipalMappingResponse (Prelude.Maybe [GroupOrderingIdSummary])
describePrincipalMappingResponse_groupOrderingIdSummaries :: Lens'
  DescribePrincipalMappingResponse (Maybe [GroupOrderingIdSummary])
describePrincipalMappingResponse_groupOrderingIdSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalMappingResponse' {Maybe [GroupOrderingIdSummary]
groupOrderingIdSummaries :: Maybe [GroupOrderingIdSummary]
$sel:groupOrderingIdSummaries:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Maybe [GroupOrderingIdSummary]
groupOrderingIdSummaries} -> Maybe [GroupOrderingIdSummary]
groupOrderingIdSummaries) (\s :: DescribePrincipalMappingResponse
s@DescribePrincipalMappingResponse' {} Maybe [GroupOrderingIdSummary]
a -> DescribePrincipalMappingResponse
s {$sel:groupOrderingIdSummaries:DescribePrincipalMappingResponse' :: Maybe [GroupOrderingIdSummary]
groupOrderingIdSummaries = Maybe [GroupOrderingIdSummary]
a} :: DescribePrincipalMappingResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Shows the identifier of the index to see information on the processing
-- of @PUT@ and @DELETE@ actions for mapping users to their groups.
describePrincipalMappingResponse_indexId :: Lens.Lens' DescribePrincipalMappingResponse (Prelude.Maybe Prelude.Text)
describePrincipalMappingResponse_indexId :: Lens' DescribePrincipalMappingResponse (Maybe Text)
describePrincipalMappingResponse_indexId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalMappingResponse' {Maybe Text
indexId :: Maybe Text
$sel:indexId:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Maybe Text
indexId} -> Maybe Text
indexId) (\s :: DescribePrincipalMappingResponse
s@DescribePrincipalMappingResponse' {} Maybe Text
a -> DescribePrincipalMappingResponse
s {$sel:indexId:DescribePrincipalMappingResponse' :: Maybe Text
indexId = Maybe Text
a} :: DescribePrincipalMappingResponse)

-- | The response's http status code.
describePrincipalMappingResponse_httpStatus :: Lens.Lens' DescribePrincipalMappingResponse Prelude.Int
describePrincipalMappingResponse_httpStatus :: Lens' DescribePrincipalMappingResponse Int
describePrincipalMappingResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePrincipalMappingResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribePrincipalMappingResponse
s@DescribePrincipalMappingResponse' {} Int
a -> DescribePrincipalMappingResponse
s {$sel:httpStatus:DescribePrincipalMappingResponse' :: Int
httpStatus = Int
a} :: DescribePrincipalMappingResponse)

instance
  Prelude.NFData
    DescribePrincipalMappingResponse
  where
  rnf :: DescribePrincipalMappingResponse -> ()
rnf DescribePrincipalMappingResponse' {Int
Maybe [GroupOrderingIdSummary]
Maybe Text
httpStatus :: Int
indexId :: Maybe Text
groupOrderingIdSummaries :: Maybe [GroupOrderingIdSummary]
groupId :: Maybe Text
dataSourceId :: Maybe Text
$sel:httpStatus:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Int
$sel:indexId:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Maybe Text
$sel:groupOrderingIdSummaries:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Maybe [GroupOrderingIdSummary]
$sel:groupId:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Maybe Text
$sel:dataSourceId:DescribePrincipalMappingResponse' :: DescribePrincipalMappingResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dataSourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [GroupOrderingIdSummary]
groupOrderingIdSummaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
indexId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus