{-# 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.WorkMail.DescribeUser
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides information regarding the user.
module Amazonka.WorkMail.DescribeUser
  ( -- * Creating a Request
    DescribeUser (..),
    newDescribeUser,

    -- * Request Lenses
    describeUser_organizationId,
    describeUser_userId,

    -- * Destructuring the Response
    DescribeUserResponse (..),
    newDescribeUserResponse,

    -- * Response Lenses
    describeUserResponse_disabledDate,
    describeUserResponse_displayName,
    describeUserResponse_email,
    describeUserResponse_enabledDate,
    describeUserResponse_name,
    describeUserResponse_state,
    describeUserResponse_userId,
    describeUserResponse_userRole,
    describeUserResponse_httpStatus,
  )
where

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
import Amazonka.WorkMail.Types

-- | /See:/ 'newDescribeUser' smart constructor.
data DescribeUser = DescribeUser'
  { -- | The identifier for the organization under which the user exists.
    DescribeUser -> Text
organizationId :: Prelude.Text,
    -- | The identifier for the user to be described.
    DescribeUser -> Text
userId :: Prelude.Text
  }
  deriving (DescribeUser -> DescribeUser -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUser -> DescribeUser -> Bool
$c/= :: DescribeUser -> DescribeUser -> Bool
== :: DescribeUser -> DescribeUser -> Bool
$c== :: DescribeUser -> DescribeUser -> Bool
Prelude.Eq, ReadPrec [DescribeUser]
ReadPrec DescribeUser
Int -> ReadS DescribeUser
ReadS [DescribeUser]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUser]
$creadListPrec :: ReadPrec [DescribeUser]
readPrec :: ReadPrec DescribeUser
$creadPrec :: ReadPrec DescribeUser
readList :: ReadS [DescribeUser]
$creadList :: ReadS [DescribeUser]
readsPrec :: Int -> ReadS DescribeUser
$creadsPrec :: Int -> ReadS DescribeUser
Prelude.Read, Int -> DescribeUser -> ShowS
[DescribeUser] -> ShowS
DescribeUser -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUser] -> ShowS
$cshowList :: [DescribeUser] -> ShowS
show :: DescribeUser -> String
$cshow :: DescribeUser -> String
showsPrec :: Int -> DescribeUser -> ShowS
$cshowsPrec :: Int -> DescribeUser -> ShowS
Prelude.Show, forall x. Rep DescribeUser x -> DescribeUser
forall x. DescribeUser -> Rep DescribeUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeUser x -> DescribeUser
$cfrom :: forall x. DescribeUser -> Rep DescribeUser x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUser' 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:
--
-- 'organizationId', 'describeUser_organizationId' - The identifier for the organization under which the user exists.
--
-- 'userId', 'describeUser_userId' - The identifier for the user to be described.
newDescribeUser ::
  -- | 'organizationId'
  Prelude.Text ->
  -- | 'userId'
  Prelude.Text ->
  DescribeUser
newDescribeUser :: Text -> Text -> DescribeUser
newDescribeUser Text
pOrganizationId_ Text
pUserId_ =
  DescribeUser'
    { $sel:organizationId:DescribeUser' :: Text
organizationId = Text
pOrganizationId_,
      $sel:userId:DescribeUser' :: Text
userId = Text
pUserId_
    }

-- | The identifier for the organization under which the user exists.
describeUser_organizationId :: Lens.Lens' DescribeUser Prelude.Text
describeUser_organizationId :: Lens' DescribeUser Text
describeUser_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUser' {Text
organizationId :: Text
$sel:organizationId:DescribeUser' :: DescribeUser -> Text
organizationId} -> Text
organizationId) (\s :: DescribeUser
s@DescribeUser' {} Text
a -> DescribeUser
s {$sel:organizationId:DescribeUser' :: Text
organizationId = Text
a} :: DescribeUser)

-- | The identifier for the user to be described.
describeUser_userId :: Lens.Lens' DescribeUser Prelude.Text
describeUser_userId :: Lens' DescribeUser Text
describeUser_userId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUser' {Text
userId :: Text
$sel:userId:DescribeUser' :: DescribeUser -> Text
userId} -> Text
userId) (\s :: DescribeUser
s@DescribeUser' {} Text
a -> DescribeUser
s {$sel:userId:DescribeUser' :: Text
userId = Text
a} :: DescribeUser)

instance Core.AWSRequest DescribeUser where
  type AWSResponse DescribeUser = DescribeUserResponse
  request :: (Service -> Service) -> DescribeUser -> Request DescribeUser
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 DescribeUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeUser)))
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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe EntityState
-> Maybe Text
-> Maybe UserRole
-> Int
-> DescribeUserResponse
DescribeUserResponse'
            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
"DisabledDate")
            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
"DisplayName")
            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
"Email")
            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
"EnabledDate")
            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
"Name")
            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
"State")
            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
"UserId")
            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
"UserRole")
            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 DescribeUser where
  hashWithSalt :: Int -> DescribeUser -> Int
hashWithSalt Int
_salt DescribeUser' {Text
userId :: Text
organizationId :: Text
$sel:userId:DescribeUser' :: DescribeUser -> Text
$sel:organizationId:DescribeUser' :: DescribeUser -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userId

instance Prelude.NFData DescribeUser where
  rnf :: DescribeUser -> ()
rnf DescribeUser' {Text
userId :: Text
organizationId :: Text
$sel:userId:DescribeUser' :: DescribeUser -> Text
$sel:organizationId:DescribeUser' :: DescribeUser -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userId

instance Data.ToHeaders DescribeUser where
  toHeaders :: DescribeUser -> 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
"WorkMailService.DescribeUser" ::
                          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 DescribeUser where
  toJSON :: DescribeUser -> Value
toJSON DescribeUser' {Text
userId :: Text
organizationId :: Text
$sel:userId:DescribeUser' :: DescribeUser -> Text
$sel:organizationId:DescribeUser' :: DescribeUser -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId),
            forall a. a -> Maybe a
Prelude.Just (Key
"UserId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userId)
          ]
      )

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

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

-- | /See:/ 'newDescribeUserResponse' smart constructor.
data DescribeUserResponse = DescribeUserResponse'
  { -- | The date and time at which the user was disabled for WorkMail usage, in
    -- UNIX epoch time format.
    DescribeUserResponse -> Maybe POSIX
disabledDate :: Prelude.Maybe Data.POSIX,
    -- | The display name of the user.
    DescribeUserResponse -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The email of the user.
    DescribeUserResponse -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
    -- | The date and time at which the user was enabled for WorkMailusage, in
    -- UNIX epoch time format.
    DescribeUserResponse -> Maybe POSIX
enabledDate :: Prelude.Maybe Data.POSIX,
    -- | The name for the user.
    DescribeUserResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The state of a user: enabled (registered to WorkMail) or disabled
    -- (deregistered or never registered to WorkMail).
    DescribeUserResponse -> Maybe EntityState
state :: Prelude.Maybe EntityState,
    -- | The identifier for the described user.
    DescribeUserResponse -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
    -- | In certain cases, other entities are modeled as users. If
    -- interoperability is enabled, resources are imported into WorkMail as
    -- users. Because different WorkMail organizations rely on different
    -- directory types, administrators can distinguish between an unregistered
    -- user (account is disabled and has a user role) and the directory
    -- administrators. The values are USER, RESOURCE, and SYSTEM_USER.
    DescribeUserResponse -> Maybe UserRole
userRole :: Prelude.Maybe UserRole,
    -- | The response's http status code.
    DescribeUserResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeUserResponse -> DescribeUserResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUserResponse -> DescribeUserResponse -> Bool
$c/= :: DescribeUserResponse -> DescribeUserResponse -> Bool
== :: DescribeUserResponse -> DescribeUserResponse -> Bool
$c== :: DescribeUserResponse -> DescribeUserResponse -> Bool
Prelude.Eq, ReadPrec [DescribeUserResponse]
ReadPrec DescribeUserResponse
Int -> ReadS DescribeUserResponse
ReadS [DescribeUserResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUserResponse]
$creadListPrec :: ReadPrec [DescribeUserResponse]
readPrec :: ReadPrec DescribeUserResponse
$creadPrec :: ReadPrec DescribeUserResponse
readList :: ReadS [DescribeUserResponse]
$creadList :: ReadS [DescribeUserResponse]
readsPrec :: Int -> ReadS DescribeUserResponse
$creadsPrec :: Int -> ReadS DescribeUserResponse
Prelude.Read, Int -> DescribeUserResponse -> ShowS
[DescribeUserResponse] -> ShowS
DescribeUserResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUserResponse] -> ShowS
$cshowList :: [DescribeUserResponse] -> ShowS
show :: DescribeUserResponse -> String
$cshow :: DescribeUserResponse -> String
showsPrec :: Int -> DescribeUserResponse -> ShowS
$cshowsPrec :: Int -> DescribeUserResponse -> ShowS
Prelude.Show, forall x. Rep DescribeUserResponse x -> DescribeUserResponse
forall x. DescribeUserResponse -> Rep DescribeUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeUserResponse x -> DescribeUserResponse
$cfrom :: forall x. DescribeUserResponse -> Rep DescribeUserResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUserResponse' 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:
--
-- 'disabledDate', 'describeUserResponse_disabledDate' - The date and time at which the user was disabled for WorkMail usage, in
-- UNIX epoch time format.
--
-- 'displayName', 'describeUserResponse_displayName' - The display name of the user.
--
-- 'email', 'describeUserResponse_email' - The email of the user.
--
-- 'enabledDate', 'describeUserResponse_enabledDate' - The date and time at which the user was enabled for WorkMailusage, in
-- UNIX epoch time format.
--
-- 'name', 'describeUserResponse_name' - The name for the user.
--
-- 'state', 'describeUserResponse_state' - The state of a user: enabled (registered to WorkMail) or disabled
-- (deregistered or never registered to WorkMail).
--
-- 'userId', 'describeUserResponse_userId' - The identifier for the described user.
--
-- 'userRole', 'describeUserResponse_userRole' - In certain cases, other entities are modeled as users. If
-- interoperability is enabled, resources are imported into WorkMail as
-- users. Because different WorkMail organizations rely on different
-- directory types, administrators can distinguish between an unregistered
-- user (account is disabled and has a user role) and the directory
-- administrators. The values are USER, RESOURCE, and SYSTEM_USER.
--
-- 'httpStatus', 'describeUserResponse_httpStatus' - The response's http status code.
newDescribeUserResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeUserResponse
newDescribeUserResponse :: Int -> DescribeUserResponse
newDescribeUserResponse Int
pHttpStatus_ =
  DescribeUserResponse'
    { $sel:disabledDate:DescribeUserResponse' :: Maybe POSIX
disabledDate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:DescribeUserResponse' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
      $sel:email:DescribeUserResponse' :: Maybe Text
email = forall a. Maybe a
Prelude.Nothing,
      $sel:enabledDate:DescribeUserResponse' :: Maybe POSIX
enabledDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeUserResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:state:DescribeUserResponse' :: Maybe EntityState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:userId:DescribeUserResponse' :: Maybe Text
userId = forall a. Maybe a
Prelude.Nothing,
      $sel:userRole:DescribeUserResponse' :: Maybe UserRole
userRole = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeUserResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The date and time at which the user was disabled for WorkMail usage, in
-- UNIX epoch time format.
describeUserResponse_disabledDate :: Lens.Lens' DescribeUserResponse (Prelude.Maybe Prelude.UTCTime)
describeUserResponse_disabledDate :: Lens' DescribeUserResponse (Maybe UTCTime)
describeUserResponse_disabledDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserResponse' {Maybe POSIX
disabledDate :: Maybe POSIX
$sel:disabledDate:DescribeUserResponse' :: DescribeUserResponse -> Maybe POSIX
disabledDate} -> Maybe POSIX
disabledDate) (\s :: DescribeUserResponse
s@DescribeUserResponse' {} Maybe POSIX
a -> DescribeUserResponse
s {$sel:disabledDate:DescribeUserResponse' :: Maybe POSIX
disabledDate = Maybe POSIX
a} :: DescribeUserResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The display name of the user.
describeUserResponse_displayName :: Lens.Lens' DescribeUserResponse (Prelude.Maybe Prelude.Text)
describeUserResponse_displayName :: Lens' DescribeUserResponse (Maybe Text)
describeUserResponse_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserResponse' {Maybe Text
displayName :: Maybe Text
$sel:displayName:DescribeUserResponse' :: DescribeUserResponse -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: DescribeUserResponse
s@DescribeUserResponse' {} Maybe Text
a -> DescribeUserResponse
s {$sel:displayName:DescribeUserResponse' :: Maybe Text
displayName = Maybe Text
a} :: DescribeUserResponse)

-- | The email of the user.
describeUserResponse_email :: Lens.Lens' DescribeUserResponse (Prelude.Maybe Prelude.Text)
describeUserResponse_email :: Lens' DescribeUserResponse (Maybe Text)
describeUserResponse_email = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserResponse' {Maybe Text
email :: Maybe Text
$sel:email:DescribeUserResponse' :: DescribeUserResponse -> Maybe Text
email} -> Maybe Text
email) (\s :: DescribeUserResponse
s@DescribeUserResponse' {} Maybe Text
a -> DescribeUserResponse
s {$sel:email:DescribeUserResponse' :: Maybe Text
email = Maybe Text
a} :: DescribeUserResponse)

-- | The date and time at which the user was enabled for WorkMailusage, in
-- UNIX epoch time format.
describeUserResponse_enabledDate :: Lens.Lens' DescribeUserResponse (Prelude.Maybe Prelude.UTCTime)
describeUserResponse_enabledDate :: Lens' DescribeUserResponse (Maybe UTCTime)
describeUserResponse_enabledDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserResponse' {Maybe POSIX
enabledDate :: Maybe POSIX
$sel:enabledDate:DescribeUserResponse' :: DescribeUserResponse -> Maybe POSIX
enabledDate} -> Maybe POSIX
enabledDate) (\s :: DescribeUserResponse
s@DescribeUserResponse' {} Maybe POSIX
a -> DescribeUserResponse
s {$sel:enabledDate:DescribeUserResponse' :: Maybe POSIX
enabledDate = Maybe POSIX
a} :: DescribeUserResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name for the user.
describeUserResponse_name :: Lens.Lens' DescribeUserResponse (Prelude.Maybe Prelude.Text)
describeUserResponse_name :: Lens' DescribeUserResponse (Maybe Text)
describeUserResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeUserResponse' :: DescribeUserResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeUserResponse
s@DescribeUserResponse' {} Maybe Text
a -> DescribeUserResponse
s {$sel:name:DescribeUserResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeUserResponse)

-- | The state of a user: enabled (registered to WorkMail) or disabled
-- (deregistered or never registered to WorkMail).
describeUserResponse_state :: Lens.Lens' DescribeUserResponse (Prelude.Maybe EntityState)
describeUserResponse_state :: Lens' DescribeUserResponse (Maybe EntityState)
describeUserResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserResponse' {Maybe EntityState
state :: Maybe EntityState
$sel:state:DescribeUserResponse' :: DescribeUserResponse -> Maybe EntityState
state} -> Maybe EntityState
state) (\s :: DescribeUserResponse
s@DescribeUserResponse' {} Maybe EntityState
a -> DescribeUserResponse
s {$sel:state:DescribeUserResponse' :: Maybe EntityState
state = Maybe EntityState
a} :: DescribeUserResponse)

-- | The identifier for the described user.
describeUserResponse_userId :: Lens.Lens' DescribeUserResponse (Prelude.Maybe Prelude.Text)
describeUserResponse_userId :: Lens' DescribeUserResponse (Maybe Text)
describeUserResponse_userId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserResponse' {Maybe Text
userId :: Maybe Text
$sel:userId:DescribeUserResponse' :: DescribeUserResponse -> Maybe Text
userId} -> Maybe Text
userId) (\s :: DescribeUserResponse
s@DescribeUserResponse' {} Maybe Text
a -> DescribeUserResponse
s {$sel:userId:DescribeUserResponse' :: Maybe Text
userId = Maybe Text
a} :: DescribeUserResponse)

-- | In certain cases, other entities are modeled as users. If
-- interoperability is enabled, resources are imported into WorkMail as
-- users. Because different WorkMail organizations rely on different
-- directory types, administrators can distinguish between an unregistered
-- user (account is disabled and has a user role) and the directory
-- administrators. The values are USER, RESOURCE, and SYSTEM_USER.
describeUserResponse_userRole :: Lens.Lens' DescribeUserResponse (Prelude.Maybe UserRole)
describeUserResponse_userRole :: Lens' DescribeUserResponse (Maybe UserRole)
describeUserResponse_userRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserResponse' {Maybe UserRole
userRole :: Maybe UserRole
$sel:userRole:DescribeUserResponse' :: DescribeUserResponse -> Maybe UserRole
userRole} -> Maybe UserRole
userRole) (\s :: DescribeUserResponse
s@DescribeUserResponse' {} Maybe UserRole
a -> DescribeUserResponse
s {$sel:userRole:DescribeUserResponse' :: Maybe UserRole
userRole = Maybe UserRole
a} :: DescribeUserResponse)

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

instance Prelude.NFData DescribeUserResponse where
  rnf :: DescribeUserResponse -> ()
rnf DescribeUserResponse' {Int
Maybe Text
Maybe POSIX
Maybe EntityState
Maybe UserRole
httpStatus :: Int
userRole :: Maybe UserRole
userId :: Maybe Text
state :: Maybe EntityState
name :: Maybe Text
enabledDate :: Maybe POSIX
email :: Maybe Text
displayName :: Maybe Text
disabledDate :: Maybe POSIX
$sel:httpStatus:DescribeUserResponse' :: DescribeUserResponse -> Int
$sel:userRole:DescribeUserResponse' :: DescribeUserResponse -> Maybe UserRole
$sel:userId:DescribeUserResponse' :: DescribeUserResponse -> Maybe Text
$sel:state:DescribeUserResponse' :: DescribeUserResponse -> Maybe EntityState
$sel:name:DescribeUserResponse' :: DescribeUserResponse -> Maybe Text
$sel:enabledDate:DescribeUserResponse' :: DescribeUserResponse -> Maybe POSIX
$sel:email:DescribeUserResponse' :: DescribeUserResponse -> Maybe Text
$sel:displayName:DescribeUserResponse' :: DescribeUserResponse -> Maybe Text
$sel:disabledDate:DescribeUserResponse' :: DescribeUserResponse -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
disabledDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
email
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
enabledDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EntityState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserRole
userRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus