{-# 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.GetCredentialsForIdentity
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns credentials for the provided identity ID. Any provided logins
-- will be validated against supported login providers. If the token is for
-- cognito-identity.amazonaws.com, it will be passed through to AWS
-- Security Token Service with the appropriate role for the token.
--
-- This is a public API. You do not need any credentials to call this API.
module Amazonka.CognitoIdentity.GetCredentialsForIdentity
  ( -- * Creating a Request
    GetCredentialsForIdentity (..),
    newGetCredentialsForIdentity,

    -- * Request Lenses
    getCredentialsForIdentity_customRoleArn,
    getCredentialsForIdentity_logins,
    getCredentialsForIdentity_identityId,

    -- * Destructuring the Response
    GetCredentialsForIdentityResponse (..),
    newGetCredentialsForIdentityResponse,

    -- * Response Lenses
    getCredentialsForIdentityResponse_credentials,
    getCredentialsForIdentityResponse_identityId,
    getCredentialsForIdentityResponse_httpStatus,
  )
where

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

-- | Input to the @GetCredentialsForIdentity@ action.
--
-- /See:/ 'newGetCredentialsForIdentity' smart constructor.
data GetCredentialsForIdentity = GetCredentialsForIdentity'
  { -- | The Amazon Resource Name (ARN) of the role to be assumed when multiple
    -- roles were received in the token from the identity provider. For
    -- example, a SAML-based identity provider. This parameter is optional for
    -- identity providers that do not support role customization.
    GetCredentialsForIdentity -> Maybe Text
customRoleArn :: Prelude.Maybe Prelude.Text,
    -- | A set of optional name-value pairs that map provider names to provider
    -- tokens. The name-value pair will follow the syntax \"provider_name\":
    -- \"provider_user_identifier\".
    --
    -- Logins should not be specified when trying to get credentials for an
    -- unauthenticated identity.
    --
    -- The Logins parameter is required when using identities associated with
    -- external identity providers such as Facebook. For examples of @Logins@
    -- maps, see the code examples in the
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/external-identity-providers.html External Identity Providers>
    -- section of the Amazon Cognito Developer Guide.
    GetCredentialsForIdentity -> Maybe (HashMap Text Text)
logins :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A unique identifier in the format REGION:GUID.
    GetCredentialsForIdentity -> Text
identityId :: Prelude.Text
  }
  deriving (GetCredentialsForIdentity -> GetCredentialsForIdentity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCredentialsForIdentity -> GetCredentialsForIdentity -> Bool
$c/= :: GetCredentialsForIdentity -> GetCredentialsForIdentity -> Bool
== :: GetCredentialsForIdentity -> GetCredentialsForIdentity -> Bool
$c== :: GetCredentialsForIdentity -> GetCredentialsForIdentity -> Bool
Prelude.Eq, ReadPrec [GetCredentialsForIdentity]
ReadPrec GetCredentialsForIdentity
Int -> ReadS GetCredentialsForIdentity
ReadS [GetCredentialsForIdentity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCredentialsForIdentity]
$creadListPrec :: ReadPrec [GetCredentialsForIdentity]
readPrec :: ReadPrec GetCredentialsForIdentity
$creadPrec :: ReadPrec GetCredentialsForIdentity
readList :: ReadS [GetCredentialsForIdentity]
$creadList :: ReadS [GetCredentialsForIdentity]
readsPrec :: Int -> ReadS GetCredentialsForIdentity
$creadsPrec :: Int -> ReadS GetCredentialsForIdentity
Prelude.Read, Int -> GetCredentialsForIdentity -> ShowS
[GetCredentialsForIdentity] -> ShowS
GetCredentialsForIdentity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCredentialsForIdentity] -> ShowS
$cshowList :: [GetCredentialsForIdentity] -> ShowS
show :: GetCredentialsForIdentity -> String
$cshow :: GetCredentialsForIdentity -> String
showsPrec :: Int -> GetCredentialsForIdentity -> ShowS
$cshowsPrec :: Int -> GetCredentialsForIdentity -> ShowS
Prelude.Show, forall x.
Rep GetCredentialsForIdentity x -> GetCredentialsForIdentity
forall x.
GetCredentialsForIdentity -> Rep GetCredentialsForIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCredentialsForIdentity x -> GetCredentialsForIdentity
$cfrom :: forall x.
GetCredentialsForIdentity -> Rep GetCredentialsForIdentity x
Prelude.Generic)

-- |
-- Create a value of 'GetCredentialsForIdentity' 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:
--
-- 'customRoleArn', 'getCredentialsForIdentity_customRoleArn' - The Amazon Resource Name (ARN) of the role to be assumed when multiple
-- roles were received in the token from the identity provider. For
-- example, a SAML-based identity provider. This parameter is optional for
-- identity providers that do not support role customization.
--
-- 'logins', 'getCredentialsForIdentity_logins' - A set of optional name-value pairs that map provider names to provider
-- tokens. The name-value pair will follow the syntax \"provider_name\":
-- \"provider_user_identifier\".
--
-- Logins should not be specified when trying to get credentials for an
-- unauthenticated identity.
--
-- The Logins parameter is required when using identities associated with
-- external identity providers such as Facebook. For examples of @Logins@
-- maps, see the code examples in the
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/external-identity-providers.html External Identity Providers>
-- section of the Amazon Cognito Developer Guide.
--
-- 'identityId', 'getCredentialsForIdentity_identityId' - A unique identifier in the format REGION:GUID.
newGetCredentialsForIdentity ::
  -- | 'identityId'
  Prelude.Text ->
  GetCredentialsForIdentity
newGetCredentialsForIdentity :: Text -> GetCredentialsForIdentity
newGetCredentialsForIdentity Text
pIdentityId_ =
  GetCredentialsForIdentity'
    { $sel:customRoleArn:GetCredentialsForIdentity' :: Maybe Text
customRoleArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:logins:GetCredentialsForIdentity' :: Maybe (HashMap Text Text)
logins = forall a. Maybe a
Prelude.Nothing,
      $sel:identityId:GetCredentialsForIdentity' :: Text
identityId = Text
pIdentityId_
    }

-- | The Amazon Resource Name (ARN) of the role to be assumed when multiple
-- roles were received in the token from the identity provider. For
-- example, a SAML-based identity provider. This parameter is optional for
-- identity providers that do not support role customization.
getCredentialsForIdentity_customRoleArn :: Lens.Lens' GetCredentialsForIdentity (Prelude.Maybe Prelude.Text)
getCredentialsForIdentity_customRoleArn :: Lens' GetCredentialsForIdentity (Maybe Text)
getCredentialsForIdentity_customRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCredentialsForIdentity' {Maybe Text
customRoleArn :: Maybe Text
$sel:customRoleArn:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Maybe Text
customRoleArn} -> Maybe Text
customRoleArn) (\s :: GetCredentialsForIdentity
s@GetCredentialsForIdentity' {} Maybe Text
a -> GetCredentialsForIdentity
s {$sel:customRoleArn:GetCredentialsForIdentity' :: Maybe Text
customRoleArn = Maybe Text
a} :: GetCredentialsForIdentity)

-- | A set of optional name-value pairs that map provider names to provider
-- tokens. The name-value pair will follow the syntax \"provider_name\":
-- \"provider_user_identifier\".
--
-- Logins should not be specified when trying to get credentials for an
-- unauthenticated identity.
--
-- The Logins parameter is required when using identities associated with
-- external identity providers such as Facebook. For examples of @Logins@
-- maps, see the code examples in the
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/external-identity-providers.html External Identity Providers>
-- section of the Amazon Cognito Developer Guide.
getCredentialsForIdentity_logins :: Lens.Lens' GetCredentialsForIdentity (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getCredentialsForIdentity_logins :: Lens' GetCredentialsForIdentity (Maybe (HashMap Text Text))
getCredentialsForIdentity_logins = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCredentialsForIdentity' {Maybe (HashMap Text Text)
logins :: Maybe (HashMap Text Text)
$sel:logins:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Maybe (HashMap Text Text)
logins} -> Maybe (HashMap Text Text)
logins) (\s :: GetCredentialsForIdentity
s@GetCredentialsForIdentity' {} Maybe (HashMap Text Text)
a -> GetCredentialsForIdentity
s {$sel:logins:GetCredentialsForIdentity' :: Maybe (HashMap Text Text)
logins = Maybe (HashMap Text Text)
a} :: GetCredentialsForIdentity) 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

-- | A unique identifier in the format REGION:GUID.
getCredentialsForIdentity_identityId :: Lens.Lens' GetCredentialsForIdentity Prelude.Text
getCredentialsForIdentity_identityId :: Lens' GetCredentialsForIdentity Text
getCredentialsForIdentity_identityId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCredentialsForIdentity' {Text
identityId :: Text
$sel:identityId:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Text
identityId} -> Text
identityId) (\s :: GetCredentialsForIdentity
s@GetCredentialsForIdentity' {} Text
a -> GetCredentialsForIdentity
s {$sel:identityId:GetCredentialsForIdentity' :: Text
identityId = Text
a} :: GetCredentialsForIdentity)

instance Core.AWSRequest GetCredentialsForIdentity where
  type
    AWSResponse GetCredentialsForIdentity =
      GetCredentialsForIdentityResponse
  request :: (Service -> Service)
-> GetCredentialsForIdentity -> Request GetCredentialsForIdentity
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 GetCredentialsForIdentity
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetCredentialsForIdentity)))
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 Credentials
-> Maybe Text -> Int -> GetCredentialsForIdentityResponse
GetCredentialsForIdentityResponse'
            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
"Credentials")
            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
"IdentityId")
            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 GetCredentialsForIdentity where
  hashWithSalt :: Int -> GetCredentialsForIdentity -> Int
hashWithSalt Int
_salt GetCredentialsForIdentity' {Maybe Text
Maybe (HashMap Text Text)
Text
identityId :: Text
logins :: Maybe (HashMap Text Text)
customRoleArn :: Maybe Text
$sel:identityId:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Text
$sel:logins:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Maybe (HashMap Text Text)
$sel:customRoleArn:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
logins
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
identityId

instance Prelude.NFData GetCredentialsForIdentity where
  rnf :: GetCredentialsForIdentity -> ()
rnf GetCredentialsForIdentity' {Maybe Text
Maybe (HashMap Text Text)
Text
identityId :: Text
logins :: Maybe (HashMap Text Text)
customRoleArn :: Maybe Text
$sel:identityId:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Text
$sel:logins:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Maybe (HashMap Text Text)
$sel:customRoleArn:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
logins
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
identityId

instance Data.ToHeaders GetCredentialsForIdentity where
  toHeaders :: GetCredentialsForIdentity -> 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
"AWSCognitoIdentityService.GetCredentialsForIdentity" ::
                          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 GetCredentialsForIdentity where
  toJSON :: GetCredentialsForIdentity -> Value
toJSON GetCredentialsForIdentity' {Maybe Text
Maybe (HashMap Text Text)
Text
identityId :: Text
logins :: Maybe (HashMap Text Text)
customRoleArn :: Maybe Text
$sel:identityId:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Text
$sel:logins:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Maybe (HashMap Text Text)
$sel:customRoleArn:GetCredentialsForIdentity' :: GetCredentialsForIdentity -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CustomRoleArn" 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
customRoleArn,
            (Key
"Logins" 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 (HashMap Text Text)
logins,
            forall a. a -> Maybe a
Prelude.Just (Key
"IdentityId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
identityId)
          ]
      )

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

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

-- | Returned in response to a successful @GetCredentialsForIdentity@
-- operation.
--
-- /See:/ 'newGetCredentialsForIdentityResponse' smart constructor.
data GetCredentialsForIdentityResponse = GetCredentialsForIdentityResponse'
  { -- | Credentials for the provided identity ID.
    GetCredentialsForIdentityResponse -> Maybe Credentials
credentials :: Prelude.Maybe Credentials,
    -- | A unique identifier in the format REGION:GUID.
    GetCredentialsForIdentityResponse -> Maybe Text
identityId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetCredentialsForIdentityResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetCredentialsForIdentityResponse
-> GetCredentialsForIdentityResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCredentialsForIdentityResponse
-> GetCredentialsForIdentityResponse -> Bool
$c/= :: GetCredentialsForIdentityResponse
-> GetCredentialsForIdentityResponse -> Bool
== :: GetCredentialsForIdentityResponse
-> GetCredentialsForIdentityResponse -> Bool
$c== :: GetCredentialsForIdentityResponse
-> GetCredentialsForIdentityResponse -> Bool
Prelude.Eq, ReadPrec [GetCredentialsForIdentityResponse]
ReadPrec GetCredentialsForIdentityResponse
Int -> ReadS GetCredentialsForIdentityResponse
ReadS [GetCredentialsForIdentityResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCredentialsForIdentityResponse]
$creadListPrec :: ReadPrec [GetCredentialsForIdentityResponse]
readPrec :: ReadPrec GetCredentialsForIdentityResponse
$creadPrec :: ReadPrec GetCredentialsForIdentityResponse
readList :: ReadS [GetCredentialsForIdentityResponse]
$creadList :: ReadS [GetCredentialsForIdentityResponse]
readsPrec :: Int -> ReadS GetCredentialsForIdentityResponse
$creadsPrec :: Int -> ReadS GetCredentialsForIdentityResponse
Prelude.Read, Int -> GetCredentialsForIdentityResponse -> ShowS
[GetCredentialsForIdentityResponse] -> ShowS
GetCredentialsForIdentityResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCredentialsForIdentityResponse] -> ShowS
$cshowList :: [GetCredentialsForIdentityResponse] -> ShowS
show :: GetCredentialsForIdentityResponse -> String
$cshow :: GetCredentialsForIdentityResponse -> String
showsPrec :: Int -> GetCredentialsForIdentityResponse -> ShowS
$cshowsPrec :: Int -> GetCredentialsForIdentityResponse -> ShowS
Prelude.Show, forall x.
Rep GetCredentialsForIdentityResponse x
-> GetCredentialsForIdentityResponse
forall x.
GetCredentialsForIdentityResponse
-> Rep GetCredentialsForIdentityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCredentialsForIdentityResponse x
-> GetCredentialsForIdentityResponse
$cfrom :: forall x.
GetCredentialsForIdentityResponse
-> Rep GetCredentialsForIdentityResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetCredentialsForIdentityResponse' 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:
--
-- 'credentials', 'getCredentialsForIdentityResponse_credentials' - Credentials for the provided identity ID.
--
-- 'identityId', 'getCredentialsForIdentityResponse_identityId' - A unique identifier in the format REGION:GUID.
--
-- 'httpStatus', 'getCredentialsForIdentityResponse_httpStatus' - The response's http status code.
newGetCredentialsForIdentityResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCredentialsForIdentityResponse
newGetCredentialsForIdentityResponse :: Int -> GetCredentialsForIdentityResponse
newGetCredentialsForIdentityResponse Int
pHttpStatus_ =
  GetCredentialsForIdentityResponse'
    { $sel:credentials:GetCredentialsForIdentityResponse' :: Maybe Credentials
credentials =
        forall a. Maybe a
Prelude.Nothing,
      $sel:identityId:GetCredentialsForIdentityResponse' :: Maybe Text
identityId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCredentialsForIdentityResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Credentials for the provided identity ID.
getCredentialsForIdentityResponse_credentials :: Lens.Lens' GetCredentialsForIdentityResponse (Prelude.Maybe Credentials)
getCredentialsForIdentityResponse_credentials :: Lens' GetCredentialsForIdentityResponse (Maybe Credentials)
getCredentialsForIdentityResponse_credentials = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCredentialsForIdentityResponse' {Maybe Credentials
credentials :: Maybe Credentials
$sel:credentials:GetCredentialsForIdentityResponse' :: GetCredentialsForIdentityResponse -> Maybe Credentials
credentials} -> Maybe Credentials
credentials) (\s :: GetCredentialsForIdentityResponse
s@GetCredentialsForIdentityResponse' {} Maybe Credentials
a -> GetCredentialsForIdentityResponse
s {$sel:credentials:GetCredentialsForIdentityResponse' :: Maybe Credentials
credentials = Maybe Credentials
a} :: GetCredentialsForIdentityResponse)

-- | A unique identifier in the format REGION:GUID.
getCredentialsForIdentityResponse_identityId :: Lens.Lens' GetCredentialsForIdentityResponse (Prelude.Maybe Prelude.Text)
getCredentialsForIdentityResponse_identityId :: Lens' GetCredentialsForIdentityResponse (Maybe Text)
getCredentialsForIdentityResponse_identityId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCredentialsForIdentityResponse' {Maybe Text
identityId :: Maybe Text
$sel:identityId:GetCredentialsForIdentityResponse' :: GetCredentialsForIdentityResponse -> Maybe Text
identityId} -> Maybe Text
identityId) (\s :: GetCredentialsForIdentityResponse
s@GetCredentialsForIdentityResponse' {} Maybe Text
a -> GetCredentialsForIdentityResponse
s {$sel:identityId:GetCredentialsForIdentityResponse' :: Maybe Text
identityId = Maybe Text
a} :: GetCredentialsForIdentityResponse)

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

instance
  Prelude.NFData
    GetCredentialsForIdentityResponse
  where
  rnf :: GetCredentialsForIdentityResponse -> ()
rnf GetCredentialsForIdentityResponse' {Int
Maybe Text
Maybe Credentials
httpStatus :: Int
identityId :: Maybe Text
credentials :: Maybe Credentials
$sel:httpStatus:GetCredentialsForIdentityResponse' :: GetCredentialsForIdentityResponse -> Int
$sel:identityId:GetCredentialsForIdentityResponse' :: GetCredentialsForIdentityResponse -> Maybe Text
$sel:credentials:GetCredentialsForIdentityResponse' :: GetCredentialsForIdentityResponse -> Maybe Credentials
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Credentials
credentials
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
identityId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus