{-# 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.CognitoIdentityProvider.GetUser
-- 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 user attributes and metadata for a user.
module Amazonka.CognitoIdentityProvider.GetUser
  ( -- * Creating a Request
    GetUser (..),
    newGetUser,

    -- * Request Lenses
    getUser_accessToken,

    -- * Destructuring the Response
    GetUserResponse (..),
    newGetUserResponse,

    -- * Response Lenses
    getUserResponse_userMFASettingList,
    getUserResponse_mfaOptions,
    getUserResponse_preferredMfaSetting,
    getUserResponse_httpStatus,
    getUserResponse_username,
    getUserResponse_userAttributes,
  )
where

import Amazonka.CognitoIdentityProvider.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

-- | Represents the request to get information about the user.
--
-- /See:/ 'newGetUser' smart constructor.
data GetUser = GetUser'
  { -- | The access token returned by the server response to get information
    -- about the user.
    GetUser -> Sensitive Text
accessToken :: Core.Sensitive Prelude.Text
  }
  deriving (GetUser -> GetUser -> Bool
(GetUser -> GetUser -> Bool)
-> (GetUser -> GetUser -> Bool) -> Eq GetUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUser -> GetUser -> Bool
$c/= :: GetUser -> GetUser -> Bool
== :: GetUser -> GetUser -> Bool
$c== :: GetUser -> GetUser -> Bool
Prelude.Eq, Int -> GetUser -> ShowS
[GetUser] -> ShowS
GetUser -> String
(Int -> GetUser -> ShowS)
-> (GetUser -> String) -> ([GetUser] -> ShowS) -> Show GetUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUser] -> ShowS
$cshowList :: [GetUser] -> ShowS
show :: GetUser -> String
$cshow :: GetUser -> String
showsPrec :: Int -> GetUser -> ShowS
$cshowsPrec :: Int -> GetUser -> ShowS
Prelude.Show, (forall x. GetUser -> Rep GetUser x)
-> (forall x. Rep GetUser x -> GetUser) -> Generic GetUser
forall x. Rep GetUser x -> GetUser
forall x. GetUser -> Rep GetUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUser x -> GetUser
$cfrom :: forall x. GetUser -> Rep GetUser x
Prelude.Generic)

-- |
-- Create a value of 'GetUser' 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:
--
-- 'accessToken', 'getUser_accessToken' - The access token returned by the server response to get information
-- about the user.
newGetUser ::
  -- | 'accessToken'
  Prelude.Text ->
  GetUser
newGetUser :: Text -> GetUser
newGetUser Text
pAccessToken_ =
  GetUser' :: Sensitive Text -> GetUser
GetUser'
    { $sel:accessToken:GetUser' :: Sensitive Text
accessToken =
        Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pAccessToken_
    }

-- | The access token returned by the server response to get information
-- about the user.
getUser_accessToken :: Lens.Lens' GetUser Prelude.Text
getUser_accessToken :: (Text -> f Text) -> GetUser -> f GetUser
getUser_accessToken = (GetUser -> Sensitive Text)
-> (GetUser -> Sensitive Text -> GetUser)
-> Lens GetUser GetUser (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUser' {Sensitive Text
accessToken :: Sensitive Text
$sel:accessToken:GetUser' :: GetUser -> Sensitive Text
accessToken} -> Sensitive Text
accessToken) (\s :: GetUser
s@GetUser' {} Sensitive Text
a -> GetUser
s {$sel:accessToken:GetUser' :: Sensitive Text
accessToken = Sensitive Text
a} :: GetUser) ((Sensitive Text -> f (Sensitive Text)) -> GetUser -> f GetUser)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> GetUser
-> f GetUser
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Core.AWSRequest GetUser where
  type AWSResponse GetUser = GetUserResponse
  request :: GetUser -> Request GetUser
request = Service -> GetUser -> Request GetUser
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetUser)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetUser))
-> Logger
-> Service
-> Proxy GetUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetUser)))
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 [MFAOptionType]
-> Maybe Text
-> Int
-> Sensitive Text
-> [AttributeType]
-> GetUserResponse
GetUserResponse'
            (Maybe [Text]
 -> Maybe [MFAOptionType]
 -> Maybe Text
 -> Int
 -> Sensitive Text
 -> [AttributeType]
 -> GetUserResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe [MFAOptionType]
      -> Maybe Text
      -> Int
      -> Sensitive Text
      -> [AttributeType]
      -> GetUserResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserMFASettingList"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe [MFAOptionType]
   -> Maybe Text
   -> Int
   -> Sensitive Text
   -> [AttributeType]
   -> GetUserResponse)
-> Either String (Maybe [MFAOptionType])
-> Either
     String
     (Maybe Text
      -> Int -> Sensitive Text -> [AttributeType] -> GetUserResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [MFAOptionType]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MFAOptions" Either String (Maybe (Maybe [MFAOptionType]))
-> Maybe [MFAOptionType] -> Either String (Maybe [MFAOptionType])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MFAOptionType]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Int -> Sensitive Text -> [AttributeType] -> GetUserResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> Sensitive Text -> [AttributeType] -> GetUserResponse)
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
"PreferredMfaSetting")
            Either
  String
  (Int -> Sensitive Text -> [AttributeType] -> GetUserResponse)
-> Either String Int
-> Either
     String (Sensitive Text -> [AttributeType] -> GetUserResponse)
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))
            Either
  String (Sensitive Text -> [AttributeType] -> GetUserResponse)
-> Either String (Sensitive Text)
-> Either String ([AttributeType] -> GetUserResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Sensitive Text)
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"Username")
            Either String ([AttributeType] -> GetUserResponse)
-> Either String [AttributeType] -> Either String GetUserResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [AttributeType])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserAttributes"
                            Either String (Maybe [AttributeType])
-> [AttributeType] -> Either String [AttributeType]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AttributeType]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable GetUser

instance Prelude.NFData GetUser

instance Core.ToHeaders GetUser where
  toHeaders :: GetUser -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetUser -> 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
"AWSCognitoIdentityProviderService.GetUser" ::
                          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 GetUser where
  toJSON :: GetUser -> Value
toJSON GetUser' {Sensitive Text
accessToken :: Sensitive Text
$sel:accessToken:GetUser' :: GetUser -> Sensitive 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
"AccessToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
accessToken)]
      )

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

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

-- | Represents the response from the server from the request to get
-- information about the user.
--
-- /See:/ 'newGetUserResponse' smart constructor.
data GetUserResponse = GetUserResponse'
  { -- | The MFA options that are enabled for the user. The possible values in
    -- this list are @SMS_MFA@ and @SOFTWARE_TOKEN_MFA@.
    GetUserResponse -> Maybe [Text]
userMFASettingList :: Prelude.Maybe [Prelude.Text],
    -- | /This response parameter is no longer supported./ It provides
    -- information only about SMS MFA configurations. It doesn\'t provide
    -- information about TOTP software token MFA configurations. To look up
    -- information about either type of MFA configuration, use
    -- UserMFASettingList instead.
    GetUserResponse -> Maybe [MFAOptionType]
mfaOptions :: Prelude.Maybe [MFAOptionType],
    -- | The user\'s preferred MFA setting.
    GetUserResponse -> Maybe Text
preferredMfaSetting :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetUserResponse -> Int
httpStatus :: Prelude.Int,
    -- | The user name of the user you wish to retrieve from the get user
    -- request.
    GetUserResponse -> Sensitive Text
username :: Core.Sensitive Prelude.Text,
    -- | An array of name-value pairs representing user attributes.
    --
    -- For custom attributes, you must prepend the @custom:@ prefix to the
    -- attribute name.
    GetUserResponse -> [AttributeType]
userAttributes :: [AttributeType]
  }
  deriving (GetUserResponse -> GetUserResponse -> Bool
(GetUserResponse -> GetUserResponse -> Bool)
-> (GetUserResponse -> GetUserResponse -> Bool)
-> Eq GetUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetUserResponse -> GetUserResponse -> Bool
$c/= :: GetUserResponse -> GetUserResponse -> Bool
== :: GetUserResponse -> GetUserResponse -> Bool
$c== :: GetUserResponse -> GetUserResponse -> Bool
Prelude.Eq, Int -> GetUserResponse -> ShowS
[GetUserResponse] -> ShowS
GetUserResponse -> String
(Int -> GetUserResponse -> ShowS)
-> (GetUserResponse -> String)
-> ([GetUserResponse] -> ShowS)
-> Show GetUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetUserResponse] -> ShowS
$cshowList :: [GetUserResponse] -> ShowS
show :: GetUserResponse -> String
$cshow :: GetUserResponse -> String
showsPrec :: Int -> GetUserResponse -> ShowS
$cshowsPrec :: Int -> GetUserResponse -> ShowS
Prelude.Show, (forall x. GetUserResponse -> Rep GetUserResponse x)
-> (forall x. Rep GetUserResponse x -> GetUserResponse)
-> Generic GetUserResponse
forall x. Rep GetUserResponse x -> GetUserResponse
forall x. GetUserResponse -> Rep GetUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetUserResponse x -> GetUserResponse
$cfrom :: forall x. GetUserResponse -> Rep GetUserResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetUserResponse' 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:
--
-- 'userMFASettingList', 'getUserResponse_userMFASettingList' - The MFA options that are enabled for the user. The possible values in
-- this list are @SMS_MFA@ and @SOFTWARE_TOKEN_MFA@.
--
-- 'mfaOptions', 'getUserResponse_mfaOptions' - /This response parameter is no longer supported./ It provides
-- information only about SMS MFA configurations. It doesn\'t provide
-- information about TOTP software token MFA configurations. To look up
-- information about either type of MFA configuration, use
-- UserMFASettingList instead.
--
-- 'preferredMfaSetting', 'getUserResponse_preferredMfaSetting' - The user\'s preferred MFA setting.
--
-- 'httpStatus', 'getUserResponse_httpStatus' - The response's http status code.
--
-- 'username', 'getUserResponse_username' - The user name of the user you wish to retrieve from the get user
-- request.
--
-- 'userAttributes', 'getUserResponse_userAttributes' - An array of name-value pairs representing user attributes.
--
-- For custom attributes, you must prepend the @custom:@ prefix to the
-- attribute name.
newGetUserResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'username'
  Prelude.Text ->
  GetUserResponse
newGetUserResponse :: Int -> Text -> GetUserResponse
newGetUserResponse Int
pHttpStatus_ Text
pUsername_ =
  GetUserResponse' :: Maybe [Text]
-> Maybe [MFAOptionType]
-> Maybe Text
-> Int
-> Sensitive Text
-> [AttributeType]
-> GetUserResponse
GetUserResponse'
    { $sel:userMFASettingList:GetUserResponse' :: Maybe [Text]
userMFASettingList =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:mfaOptions:GetUserResponse' :: Maybe [MFAOptionType]
mfaOptions = Maybe [MFAOptionType]
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMfaSetting:GetUserResponse' :: Maybe Text
preferredMfaSetting = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetUserResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:username:GetUserResponse' :: Sensitive Text
username = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pUsername_,
      $sel:userAttributes:GetUserResponse' :: [AttributeType]
userAttributes = [AttributeType]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The MFA options that are enabled for the user. The possible values in
-- this list are @SMS_MFA@ and @SOFTWARE_TOKEN_MFA@.
getUserResponse_userMFASettingList :: Lens.Lens' GetUserResponse (Prelude.Maybe [Prelude.Text])
getUserResponse_userMFASettingList :: (Maybe [Text] -> f (Maybe [Text]))
-> GetUserResponse -> f GetUserResponse
getUserResponse_userMFASettingList = (GetUserResponse -> Maybe [Text])
-> (GetUserResponse -> Maybe [Text] -> GetUserResponse)
-> Lens
     GetUserResponse GetUserResponse (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserResponse' {Maybe [Text]
userMFASettingList :: Maybe [Text]
$sel:userMFASettingList:GetUserResponse' :: GetUserResponse -> Maybe [Text]
userMFASettingList} -> Maybe [Text]
userMFASettingList) (\s :: GetUserResponse
s@GetUserResponse' {} Maybe [Text]
a -> GetUserResponse
s {$sel:userMFASettingList:GetUserResponse' :: Maybe [Text]
userMFASettingList = Maybe [Text]
a} :: GetUserResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetUserResponse -> f GetUserResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetUserResponse
-> f GetUserResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | /This response parameter is no longer supported./ It provides
-- information only about SMS MFA configurations. It doesn\'t provide
-- information about TOTP software token MFA configurations. To look up
-- information about either type of MFA configuration, use
-- UserMFASettingList instead.
getUserResponse_mfaOptions :: Lens.Lens' GetUserResponse (Prelude.Maybe [MFAOptionType])
getUserResponse_mfaOptions :: (Maybe [MFAOptionType] -> f (Maybe [MFAOptionType]))
-> GetUserResponse -> f GetUserResponse
getUserResponse_mfaOptions = (GetUserResponse -> Maybe [MFAOptionType])
-> (GetUserResponse -> Maybe [MFAOptionType] -> GetUserResponse)
-> Lens
     GetUserResponse
     GetUserResponse
     (Maybe [MFAOptionType])
     (Maybe [MFAOptionType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserResponse' {Maybe [MFAOptionType]
mfaOptions :: Maybe [MFAOptionType]
$sel:mfaOptions:GetUserResponse' :: GetUserResponse -> Maybe [MFAOptionType]
mfaOptions} -> Maybe [MFAOptionType]
mfaOptions) (\s :: GetUserResponse
s@GetUserResponse' {} Maybe [MFAOptionType]
a -> GetUserResponse
s {$sel:mfaOptions:GetUserResponse' :: Maybe [MFAOptionType]
mfaOptions = Maybe [MFAOptionType]
a} :: GetUserResponse) ((Maybe [MFAOptionType] -> f (Maybe [MFAOptionType]))
 -> GetUserResponse -> f GetUserResponse)
-> ((Maybe [MFAOptionType] -> f (Maybe [MFAOptionType]))
    -> Maybe [MFAOptionType] -> f (Maybe [MFAOptionType]))
-> (Maybe [MFAOptionType] -> f (Maybe [MFAOptionType]))
-> GetUserResponse
-> f GetUserResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MFAOptionType] [MFAOptionType] [MFAOptionType] [MFAOptionType]
-> Iso
     (Maybe [MFAOptionType])
     (Maybe [MFAOptionType])
     (Maybe [MFAOptionType])
     (Maybe [MFAOptionType])
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
  [MFAOptionType] [MFAOptionType] [MFAOptionType] [MFAOptionType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The user\'s preferred MFA setting.
getUserResponse_preferredMfaSetting :: Lens.Lens' GetUserResponse (Prelude.Maybe Prelude.Text)
getUserResponse_preferredMfaSetting :: (Maybe Text -> f (Maybe Text))
-> GetUserResponse -> f GetUserResponse
getUserResponse_preferredMfaSetting = (GetUserResponse -> Maybe Text)
-> (GetUserResponse -> Maybe Text -> GetUserResponse)
-> Lens GetUserResponse GetUserResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserResponse' {Maybe Text
preferredMfaSetting :: Maybe Text
$sel:preferredMfaSetting:GetUserResponse' :: GetUserResponse -> Maybe Text
preferredMfaSetting} -> Maybe Text
preferredMfaSetting) (\s :: GetUserResponse
s@GetUserResponse' {} Maybe Text
a -> GetUserResponse
s {$sel:preferredMfaSetting:GetUserResponse' :: Maybe Text
preferredMfaSetting = Maybe Text
a} :: GetUserResponse)

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

-- | The user name of the user you wish to retrieve from the get user
-- request.
getUserResponse_username :: Lens.Lens' GetUserResponse Prelude.Text
getUserResponse_username :: (Text -> f Text) -> GetUserResponse -> f GetUserResponse
getUserResponse_username = (GetUserResponse -> Sensitive Text)
-> (GetUserResponse -> Sensitive Text -> GetUserResponse)
-> Lens
     GetUserResponse GetUserResponse (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserResponse' {Sensitive Text
username :: Sensitive Text
$sel:username:GetUserResponse' :: GetUserResponse -> Sensitive Text
username} -> Sensitive Text
username) (\s :: GetUserResponse
s@GetUserResponse' {} Sensitive Text
a -> GetUserResponse
s {$sel:username:GetUserResponse' :: Sensitive Text
username = Sensitive Text
a} :: GetUserResponse) ((Sensitive Text -> f (Sensitive Text))
 -> GetUserResponse -> f GetUserResponse)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> GetUserResponse
-> f GetUserResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | An array of name-value pairs representing user attributes.
--
-- For custom attributes, you must prepend the @custom:@ prefix to the
-- attribute name.
getUserResponse_userAttributes :: Lens.Lens' GetUserResponse [AttributeType]
getUserResponse_userAttributes :: ([AttributeType] -> f [AttributeType])
-> GetUserResponse -> f GetUserResponse
getUserResponse_userAttributes = (GetUserResponse -> [AttributeType])
-> (GetUserResponse -> [AttributeType] -> GetUserResponse)
-> Lens
     GetUserResponse GetUserResponse [AttributeType] [AttributeType]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetUserResponse' {[AttributeType]
userAttributes :: [AttributeType]
$sel:userAttributes:GetUserResponse' :: GetUserResponse -> [AttributeType]
userAttributes} -> [AttributeType]
userAttributes) (\s :: GetUserResponse
s@GetUserResponse' {} [AttributeType]
a -> GetUserResponse
s {$sel:userAttributes:GetUserResponse' :: [AttributeType]
userAttributes = [AttributeType]
a} :: GetUserResponse) (([AttributeType] -> f [AttributeType])
 -> GetUserResponse -> f GetUserResponse)
-> (([AttributeType] -> f [AttributeType])
    -> [AttributeType] -> f [AttributeType])
-> ([AttributeType] -> f [AttributeType])
-> GetUserResponse
-> f GetUserResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AttributeType] -> f [AttributeType])
-> [AttributeType] -> f [AttributeType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData GetUserResponse