{-# 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.CognitoIdentity.GetIdentityPoolRoles
-- 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)
--
-- Gets the roles for an identity pool.
--
-- You must use AWS Developer credentials to call this API.
module Amazonka.CognitoIdentity.GetIdentityPoolRoles
  ( -- * Creating a Request
    GetIdentityPoolRoles (..),
    newGetIdentityPoolRoles,

    -- * Request Lenses
    getIdentityPoolRoles_identityPoolId,

    -- * Destructuring the Response
    GetIdentityPoolRolesResponse (..),
    newGetIdentityPoolRolesResponse,

    -- * Response Lenses
    getIdentityPoolRolesResponse_roles,
    getIdentityPoolRolesResponse_identityPoolId,
    getIdentityPoolRolesResponse_roleMappings,
    getIdentityPoolRolesResponse_httpStatus,
  )
where

import Amazonka.CognitoIdentity.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Input to the @GetIdentityPoolRoles@ action.
--
-- /See:/ 'newGetIdentityPoolRoles' smart constructor.
data GetIdentityPoolRoles = GetIdentityPoolRoles'
  { -- | An identity pool ID in the format REGION:GUID.
    GetIdentityPoolRoles -> Text
identityPoolId :: Prelude.Text
  }
  deriving (GetIdentityPoolRoles -> GetIdentityPoolRoles -> Bool
(GetIdentityPoolRoles -> GetIdentityPoolRoles -> Bool)
-> (GetIdentityPoolRoles -> GetIdentityPoolRoles -> Bool)
-> Eq GetIdentityPoolRoles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIdentityPoolRoles -> GetIdentityPoolRoles -> Bool
$c/= :: GetIdentityPoolRoles -> GetIdentityPoolRoles -> Bool
== :: GetIdentityPoolRoles -> GetIdentityPoolRoles -> Bool
$c== :: GetIdentityPoolRoles -> GetIdentityPoolRoles -> Bool
Prelude.Eq, ReadPrec [GetIdentityPoolRoles]
ReadPrec GetIdentityPoolRoles
Int -> ReadS GetIdentityPoolRoles
ReadS [GetIdentityPoolRoles]
(Int -> ReadS GetIdentityPoolRoles)
-> ReadS [GetIdentityPoolRoles]
-> ReadPrec GetIdentityPoolRoles
-> ReadPrec [GetIdentityPoolRoles]
-> Read GetIdentityPoolRoles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIdentityPoolRoles]
$creadListPrec :: ReadPrec [GetIdentityPoolRoles]
readPrec :: ReadPrec GetIdentityPoolRoles
$creadPrec :: ReadPrec GetIdentityPoolRoles
readList :: ReadS [GetIdentityPoolRoles]
$creadList :: ReadS [GetIdentityPoolRoles]
readsPrec :: Int -> ReadS GetIdentityPoolRoles
$creadsPrec :: Int -> ReadS GetIdentityPoolRoles
Prelude.Read, Int -> GetIdentityPoolRoles -> ShowS
[GetIdentityPoolRoles] -> ShowS
GetIdentityPoolRoles -> String
(Int -> GetIdentityPoolRoles -> ShowS)
-> (GetIdentityPoolRoles -> String)
-> ([GetIdentityPoolRoles] -> ShowS)
-> Show GetIdentityPoolRoles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIdentityPoolRoles] -> ShowS
$cshowList :: [GetIdentityPoolRoles] -> ShowS
show :: GetIdentityPoolRoles -> String
$cshow :: GetIdentityPoolRoles -> String
showsPrec :: Int -> GetIdentityPoolRoles -> ShowS
$cshowsPrec :: Int -> GetIdentityPoolRoles -> ShowS
Prelude.Show, (forall x. GetIdentityPoolRoles -> Rep GetIdentityPoolRoles x)
-> (forall x. Rep GetIdentityPoolRoles x -> GetIdentityPoolRoles)
-> Generic GetIdentityPoolRoles
forall x. Rep GetIdentityPoolRoles x -> GetIdentityPoolRoles
forall x. GetIdentityPoolRoles -> Rep GetIdentityPoolRoles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetIdentityPoolRoles x -> GetIdentityPoolRoles
$cfrom :: forall x. GetIdentityPoolRoles -> Rep GetIdentityPoolRoles x
Prelude.Generic)

-- |
-- Create a value of 'GetIdentityPoolRoles' 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:
--
-- 'identityPoolId', 'getIdentityPoolRoles_identityPoolId' - An identity pool ID in the format REGION:GUID.
newGetIdentityPoolRoles ::
  -- | 'identityPoolId'
  Prelude.Text ->
  GetIdentityPoolRoles
newGetIdentityPoolRoles :: Text -> GetIdentityPoolRoles
newGetIdentityPoolRoles Text
pIdentityPoolId_ =
  GetIdentityPoolRoles' :: Text -> GetIdentityPoolRoles
GetIdentityPoolRoles'
    { $sel:identityPoolId:GetIdentityPoolRoles' :: Text
identityPoolId =
        Text
pIdentityPoolId_
    }

-- | An identity pool ID in the format REGION:GUID.
getIdentityPoolRoles_identityPoolId :: Lens.Lens' GetIdentityPoolRoles Prelude.Text
getIdentityPoolRoles_identityPoolId :: (Text -> f Text) -> GetIdentityPoolRoles -> f GetIdentityPoolRoles
getIdentityPoolRoles_identityPoolId = (GetIdentityPoolRoles -> Text)
-> (GetIdentityPoolRoles -> Text -> GetIdentityPoolRoles)
-> Lens GetIdentityPoolRoles GetIdentityPoolRoles Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIdentityPoolRoles' {Text
identityPoolId :: Text
$sel:identityPoolId:GetIdentityPoolRoles' :: GetIdentityPoolRoles -> Text
identityPoolId} -> Text
identityPoolId) (\s :: GetIdentityPoolRoles
s@GetIdentityPoolRoles' {} Text
a -> GetIdentityPoolRoles
s {$sel:identityPoolId:GetIdentityPoolRoles' :: Text
identityPoolId = Text
a} :: GetIdentityPoolRoles)

instance Core.AWSRequest GetIdentityPoolRoles where
  type
    AWSResponse GetIdentityPoolRoles =
      GetIdentityPoolRolesResponse
  request :: GetIdentityPoolRoles -> Request GetIdentityPoolRoles
request = Service -> GetIdentityPoolRoles -> Request GetIdentityPoolRoles
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetIdentityPoolRoles
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetIdentityPoolRoles)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetIdentityPoolRoles))
-> Logger
-> Service
-> Proxy GetIdentityPoolRoles
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetIdentityPoolRoles)))
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 (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text RoleMapping)
-> Int
-> GetIdentityPoolRolesResponse
GetIdentityPoolRolesResponse'
            (Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe (HashMap Text RoleMapping)
 -> Int
 -> GetIdentityPoolRolesResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text RoleMapping)
      -> Int
      -> GetIdentityPoolRolesResponse)
forall (f :: * -> *) a b. Functor 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
"Roles" 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
   -> Maybe (HashMap Text RoleMapping)
   -> Int
   -> GetIdentityPoolRolesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text RoleMapping)
      -> Int -> GetIdentityPoolRolesResponse)
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
"IdentityPoolId")
            Either
  String
  (Maybe (HashMap Text RoleMapping)
   -> Int -> GetIdentityPoolRolesResponse)
-> Either String (Maybe (HashMap Text RoleMapping))
-> Either String (Int -> GetIdentityPoolRolesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe (HashMap Text RoleMapping)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RoleMappings" Either String (Maybe (Maybe (HashMap Text RoleMapping)))
-> Maybe (HashMap Text RoleMapping)
-> Either String (Maybe (HashMap Text RoleMapping))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text RoleMapping)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetIdentityPoolRolesResponse)
-> Either String Int -> Either String GetIdentityPoolRolesResponse
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 GetIdentityPoolRoles

instance Prelude.NFData GetIdentityPoolRoles

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

instance Core.ToJSON GetIdentityPoolRoles where
  toJSON :: GetIdentityPoolRoles -> Value
toJSON GetIdentityPoolRoles' {Text
identityPoolId :: Text
$sel:identityPoolId:GetIdentityPoolRoles' :: GetIdentityPoolRoles -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"IdentityPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identityPoolId)
          ]
      )

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

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

-- | Returned in response to a successful @GetIdentityPoolRoles@ operation.
--
-- /See:/ 'newGetIdentityPoolRolesResponse' smart constructor.
data GetIdentityPoolRolesResponse = GetIdentityPoolRolesResponse'
  { -- | The map of roles associated with this pool. Currently only authenticated
    -- and unauthenticated roles are supported.
    GetIdentityPoolRolesResponse -> Maybe (HashMap Text Text)
roles :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | An identity pool ID in the format REGION:GUID.
    GetIdentityPoolRolesResponse -> Maybe Text
identityPoolId :: Prelude.Maybe Prelude.Text,
    -- | How users for a specific identity provider are to mapped to roles. This
    -- is a String-to-RoleMapping object map. The string identifies the
    -- identity provider, for example, \"graph.facebook.com\" or
    -- \"cognito-idp.us-east-1.amazonaws.com\/us-east-1_abcdefghi:app_client_id\".
    GetIdentityPoolRolesResponse -> Maybe (HashMap Text RoleMapping)
roleMappings :: Prelude.Maybe (Prelude.HashMap Prelude.Text RoleMapping),
    -- | The response's http status code.
    GetIdentityPoolRolesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetIdentityPoolRolesResponse
-> GetIdentityPoolRolesResponse -> Bool
(GetIdentityPoolRolesResponse
 -> GetIdentityPoolRolesResponse -> Bool)
-> (GetIdentityPoolRolesResponse
    -> GetIdentityPoolRolesResponse -> Bool)
-> Eq GetIdentityPoolRolesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetIdentityPoolRolesResponse
-> GetIdentityPoolRolesResponse -> Bool
$c/= :: GetIdentityPoolRolesResponse
-> GetIdentityPoolRolesResponse -> Bool
== :: GetIdentityPoolRolesResponse
-> GetIdentityPoolRolesResponse -> Bool
$c== :: GetIdentityPoolRolesResponse
-> GetIdentityPoolRolesResponse -> Bool
Prelude.Eq, ReadPrec [GetIdentityPoolRolesResponse]
ReadPrec GetIdentityPoolRolesResponse
Int -> ReadS GetIdentityPoolRolesResponse
ReadS [GetIdentityPoolRolesResponse]
(Int -> ReadS GetIdentityPoolRolesResponse)
-> ReadS [GetIdentityPoolRolesResponse]
-> ReadPrec GetIdentityPoolRolesResponse
-> ReadPrec [GetIdentityPoolRolesResponse]
-> Read GetIdentityPoolRolesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetIdentityPoolRolesResponse]
$creadListPrec :: ReadPrec [GetIdentityPoolRolesResponse]
readPrec :: ReadPrec GetIdentityPoolRolesResponse
$creadPrec :: ReadPrec GetIdentityPoolRolesResponse
readList :: ReadS [GetIdentityPoolRolesResponse]
$creadList :: ReadS [GetIdentityPoolRolesResponse]
readsPrec :: Int -> ReadS GetIdentityPoolRolesResponse
$creadsPrec :: Int -> ReadS GetIdentityPoolRolesResponse
Prelude.Read, Int -> GetIdentityPoolRolesResponse -> ShowS
[GetIdentityPoolRolesResponse] -> ShowS
GetIdentityPoolRolesResponse -> String
(Int -> GetIdentityPoolRolesResponse -> ShowS)
-> (GetIdentityPoolRolesResponse -> String)
-> ([GetIdentityPoolRolesResponse] -> ShowS)
-> Show GetIdentityPoolRolesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetIdentityPoolRolesResponse] -> ShowS
$cshowList :: [GetIdentityPoolRolesResponse] -> ShowS
show :: GetIdentityPoolRolesResponse -> String
$cshow :: GetIdentityPoolRolesResponse -> String
showsPrec :: Int -> GetIdentityPoolRolesResponse -> ShowS
$cshowsPrec :: Int -> GetIdentityPoolRolesResponse -> ShowS
Prelude.Show, (forall x.
 GetIdentityPoolRolesResponse -> Rep GetIdentityPoolRolesResponse x)
-> (forall x.
    Rep GetIdentityPoolRolesResponse x -> GetIdentityPoolRolesResponse)
-> Generic GetIdentityPoolRolesResponse
forall x.
Rep GetIdentityPoolRolesResponse x -> GetIdentityPoolRolesResponse
forall x.
GetIdentityPoolRolesResponse -> Rep GetIdentityPoolRolesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetIdentityPoolRolesResponse x -> GetIdentityPoolRolesResponse
$cfrom :: forall x.
GetIdentityPoolRolesResponse -> Rep GetIdentityPoolRolesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetIdentityPoolRolesResponse' 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:
--
-- 'roles', 'getIdentityPoolRolesResponse_roles' - The map of roles associated with this pool. Currently only authenticated
-- and unauthenticated roles are supported.
--
-- 'identityPoolId', 'getIdentityPoolRolesResponse_identityPoolId' - An identity pool ID in the format REGION:GUID.
--
-- 'roleMappings', 'getIdentityPoolRolesResponse_roleMappings' - How users for a specific identity provider are to mapped to roles. This
-- is a String-to-RoleMapping object map. The string identifies the
-- identity provider, for example, \"graph.facebook.com\" or
-- \"cognito-idp.us-east-1.amazonaws.com\/us-east-1_abcdefghi:app_client_id\".
--
-- 'httpStatus', 'getIdentityPoolRolesResponse_httpStatus' - The response's http status code.
newGetIdentityPoolRolesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetIdentityPoolRolesResponse
newGetIdentityPoolRolesResponse :: Int -> GetIdentityPoolRolesResponse
newGetIdentityPoolRolesResponse Int
pHttpStatus_ =
  GetIdentityPoolRolesResponse' :: Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe (HashMap Text RoleMapping)
-> Int
-> GetIdentityPoolRolesResponse
GetIdentityPoolRolesResponse'
    { $sel:roles:GetIdentityPoolRolesResponse' :: Maybe (HashMap Text Text)
roles =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:identityPoolId:GetIdentityPoolRolesResponse' :: Maybe Text
identityPoolId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleMappings:GetIdentityPoolRolesResponse' :: Maybe (HashMap Text RoleMapping)
roleMappings = Maybe (HashMap Text RoleMapping)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetIdentityPoolRolesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The map of roles associated with this pool. Currently only authenticated
-- and unauthenticated roles are supported.
getIdentityPoolRolesResponse_roles :: Lens.Lens' GetIdentityPoolRolesResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getIdentityPoolRolesResponse_roles :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetIdentityPoolRolesResponse -> f GetIdentityPoolRolesResponse
getIdentityPoolRolesResponse_roles = (GetIdentityPoolRolesResponse -> Maybe (HashMap Text Text))
-> (GetIdentityPoolRolesResponse
    -> Maybe (HashMap Text Text) -> GetIdentityPoolRolesResponse)
-> Lens
     GetIdentityPoolRolesResponse
     GetIdentityPoolRolesResponse
     (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 (\GetIdentityPoolRolesResponse' {Maybe (HashMap Text Text)
roles :: Maybe (HashMap Text Text)
$sel:roles:GetIdentityPoolRolesResponse' :: GetIdentityPoolRolesResponse -> Maybe (HashMap Text Text)
roles} -> Maybe (HashMap Text Text)
roles) (\s :: GetIdentityPoolRolesResponse
s@GetIdentityPoolRolesResponse' {} Maybe (HashMap Text Text)
a -> GetIdentityPoolRolesResponse
s {$sel:roles:GetIdentityPoolRolesResponse' :: Maybe (HashMap Text Text)
roles = Maybe (HashMap Text Text)
a} :: GetIdentityPoolRolesResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetIdentityPoolRolesResponse -> f GetIdentityPoolRolesResponse)
-> ((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)))
-> GetIdentityPoolRolesResponse
-> f GetIdentityPoolRolesResponse
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

-- | An identity pool ID in the format REGION:GUID.
getIdentityPoolRolesResponse_identityPoolId :: Lens.Lens' GetIdentityPoolRolesResponse (Prelude.Maybe Prelude.Text)
getIdentityPoolRolesResponse_identityPoolId :: (Maybe Text -> f (Maybe Text))
-> GetIdentityPoolRolesResponse -> f GetIdentityPoolRolesResponse
getIdentityPoolRolesResponse_identityPoolId = (GetIdentityPoolRolesResponse -> Maybe Text)
-> (GetIdentityPoolRolesResponse
    -> Maybe Text -> GetIdentityPoolRolesResponse)
-> Lens
     GetIdentityPoolRolesResponse
     GetIdentityPoolRolesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIdentityPoolRolesResponse' {Maybe Text
identityPoolId :: Maybe Text
$sel:identityPoolId:GetIdentityPoolRolesResponse' :: GetIdentityPoolRolesResponse -> Maybe Text
identityPoolId} -> Maybe Text
identityPoolId) (\s :: GetIdentityPoolRolesResponse
s@GetIdentityPoolRolesResponse' {} Maybe Text
a -> GetIdentityPoolRolesResponse
s {$sel:identityPoolId:GetIdentityPoolRolesResponse' :: Maybe Text
identityPoolId = Maybe Text
a} :: GetIdentityPoolRolesResponse)

-- | How users for a specific identity provider are to mapped to roles. This
-- is a String-to-RoleMapping object map. The string identifies the
-- identity provider, for example, \"graph.facebook.com\" or
-- \"cognito-idp.us-east-1.amazonaws.com\/us-east-1_abcdefghi:app_client_id\".
getIdentityPoolRolesResponse_roleMappings :: Lens.Lens' GetIdentityPoolRolesResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text RoleMapping))
getIdentityPoolRolesResponse_roleMappings :: (Maybe (HashMap Text RoleMapping)
 -> f (Maybe (HashMap Text RoleMapping)))
-> GetIdentityPoolRolesResponse -> f GetIdentityPoolRolesResponse
getIdentityPoolRolesResponse_roleMappings = (GetIdentityPoolRolesResponse -> Maybe (HashMap Text RoleMapping))
-> (GetIdentityPoolRolesResponse
    -> Maybe (HashMap Text RoleMapping)
    -> GetIdentityPoolRolesResponse)
-> Lens
     GetIdentityPoolRolesResponse
     GetIdentityPoolRolesResponse
     (Maybe (HashMap Text RoleMapping))
     (Maybe (HashMap Text RoleMapping))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetIdentityPoolRolesResponse' {Maybe (HashMap Text RoleMapping)
roleMappings :: Maybe (HashMap Text RoleMapping)
$sel:roleMappings:GetIdentityPoolRolesResponse' :: GetIdentityPoolRolesResponse -> Maybe (HashMap Text RoleMapping)
roleMappings} -> Maybe (HashMap Text RoleMapping)
roleMappings) (\s :: GetIdentityPoolRolesResponse
s@GetIdentityPoolRolesResponse' {} Maybe (HashMap Text RoleMapping)
a -> GetIdentityPoolRolesResponse
s {$sel:roleMappings:GetIdentityPoolRolesResponse' :: Maybe (HashMap Text RoleMapping)
roleMappings = Maybe (HashMap Text RoleMapping)
a} :: GetIdentityPoolRolesResponse) ((Maybe (HashMap Text RoleMapping)
  -> f (Maybe (HashMap Text RoleMapping)))
 -> GetIdentityPoolRolesResponse -> f GetIdentityPoolRolesResponse)
-> ((Maybe (HashMap Text RoleMapping)
     -> f (Maybe (HashMap Text RoleMapping)))
    -> Maybe (HashMap Text RoleMapping)
    -> f (Maybe (HashMap Text RoleMapping)))
-> (Maybe (HashMap Text RoleMapping)
    -> f (Maybe (HashMap Text RoleMapping)))
-> GetIdentityPoolRolesResponse
-> f GetIdentityPoolRolesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text RoleMapping)
  (HashMap Text RoleMapping)
  (HashMap Text RoleMapping)
  (HashMap Text RoleMapping)
-> Iso
     (Maybe (HashMap Text RoleMapping))
     (Maybe (HashMap Text RoleMapping))
     (Maybe (HashMap Text RoleMapping))
     (Maybe (HashMap Text RoleMapping))
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 RoleMapping)
  (HashMap Text RoleMapping)
  (HashMap Text RoleMapping)
  (HashMap Text RoleMapping)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetIdentityPoolRolesResponse