{-# 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.CodeStar.UpdateUserProfile
-- 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)
--
-- Updates a user\'s profile in AWS CodeStar. The user profile is not
-- project-specific. Information in the user profile is displayed wherever
-- the user\'s information appears to other users in AWS CodeStar.
module Amazonka.CodeStar.UpdateUserProfile
  ( -- * Creating a Request
    UpdateUserProfile (..),
    newUpdateUserProfile,

    -- * Request Lenses
    updateUserProfile_sshPublicKey,
    updateUserProfile_emailAddress,
    updateUserProfile_displayName,
    updateUserProfile_userArn,

    -- * Destructuring the Response
    UpdateUserProfileResponse (..),
    newUpdateUserProfileResponse,

    -- * Response Lenses
    updateUserProfileResponse_lastModifiedTimestamp,
    updateUserProfileResponse_sshPublicKey,
    updateUserProfileResponse_emailAddress,
    updateUserProfileResponse_displayName,
    updateUserProfileResponse_createdTimestamp,
    updateUserProfileResponse_httpStatus,
    updateUserProfileResponse_userArn,
  )
where

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

-- | /See:/ 'newUpdateUserProfile' smart constructor.
data UpdateUserProfile = UpdateUserProfile'
  { -- | The SSH public key associated with the user in AWS CodeStar. If a
    -- project owner allows the user remote access to project resources, this
    -- public key will be used along with the user\'s private key for SSH
    -- access.
    UpdateUserProfile -> Maybe Text
sshPublicKey :: Prelude.Maybe Prelude.Text,
    -- | The email address that is displayed as part of the user\'s profile in
    -- AWS CodeStar.
    UpdateUserProfile -> Maybe (Sensitive Text)
emailAddress :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The name that is displayed as the friendly name for the user in AWS
    -- CodeStar.
    UpdateUserProfile -> Maybe (Sensitive Text)
displayName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The name that will be displayed as the friendly name for the user in AWS
    -- CodeStar.
    UpdateUserProfile -> Text
userArn :: Prelude.Text
  }
  deriving (UpdateUserProfile -> UpdateUserProfile -> Bool
(UpdateUserProfile -> UpdateUserProfile -> Bool)
-> (UpdateUserProfile -> UpdateUserProfile -> Bool)
-> Eq UpdateUserProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserProfile -> UpdateUserProfile -> Bool
$c/= :: UpdateUserProfile -> UpdateUserProfile -> Bool
== :: UpdateUserProfile -> UpdateUserProfile -> Bool
$c== :: UpdateUserProfile -> UpdateUserProfile -> Bool
Prelude.Eq, Int -> UpdateUserProfile -> ShowS
[UpdateUserProfile] -> ShowS
UpdateUserProfile -> String
(Int -> UpdateUserProfile -> ShowS)
-> (UpdateUserProfile -> String)
-> ([UpdateUserProfile] -> ShowS)
-> Show UpdateUserProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserProfile] -> ShowS
$cshowList :: [UpdateUserProfile] -> ShowS
show :: UpdateUserProfile -> String
$cshow :: UpdateUserProfile -> String
showsPrec :: Int -> UpdateUserProfile -> ShowS
$cshowsPrec :: Int -> UpdateUserProfile -> ShowS
Prelude.Show, (forall x. UpdateUserProfile -> Rep UpdateUserProfile x)
-> (forall x. Rep UpdateUserProfile x -> UpdateUserProfile)
-> Generic UpdateUserProfile
forall x. Rep UpdateUserProfile x -> UpdateUserProfile
forall x. UpdateUserProfile -> Rep UpdateUserProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateUserProfile x -> UpdateUserProfile
$cfrom :: forall x. UpdateUserProfile -> Rep UpdateUserProfile x
Prelude.Generic)

-- |
-- Create a value of 'UpdateUserProfile' 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:
--
-- 'sshPublicKey', 'updateUserProfile_sshPublicKey' - The SSH public key associated with the user in AWS CodeStar. If a
-- project owner allows the user remote access to project resources, this
-- public key will be used along with the user\'s private key for SSH
-- access.
--
-- 'emailAddress', 'updateUserProfile_emailAddress' - The email address that is displayed as part of the user\'s profile in
-- AWS CodeStar.
--
-- 'displayName', 'updateUserProfile_displayName' - The name that is displayed as the friendly name for the user in AWS
-- CodeStar.
--
-- 'userArn', 'updateUserProfile_userArn' - The name that will be displayed as the friendly name for the user in AWS
-- CodeStar.
newUpdateUserProfile ::
  -- | 'userArn'
  Prelude.Text ->
  UpdateUserProfile
newUpdateUserProfile :: Text -> UpdateUserProfile
newUpdateUserProfile Text
pUserArn_ =
  UpdateUserProfile' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Text
-> UpdateUserProfile
UpdateUserProfile'
    { $sel:sshPublicKey:UpdateUserProfile' :: Maybe Text
sshPublicKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:emailAddress:UpdateUserProfile' :: Maybe (Sensitive Text)
emailAddress = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:UpdateUserProfile' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:userArn:UpdateUserProfile' :: Text
userArn = Text
pUserArn_
    }

-- | The SSH public key associated with the user in AWS CodeStar. If a
-- project owner allows the user remote access to project resources, this
-- public key will be used along with the user\'s private key for SSH
-- access.
updateUserProfile_sshPublicKey :: Lens.Lens' UpdateUserProfile (Prelude.Maybe Prelude.Text)
updateUserProfile_sshPublicKey :: (Maybe Text -> f (Maybe Text))
-> UpdateUserProfile -> f UpdateUserProfile
updateUserProfile_sshPublicKey = (UpdateUserProfile -> Maybe Text)
-> (UpdateUserProfile -> Maybe Text -> UpdateUserProfile)
-> Lens
     UpdateUserProfile UpdateUserProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfile' {Maybe Text
sshPublicKey :: Maybe Text
$sel:sshPublicKey:UpdateUserProfile' :: UpdateUserProfile -> Maybe Text
sshPublicKey} -> Maybe Text
sshPublicKey) (\s :: UpdateUserProfile
s@UpdateUserProfile' {} Maybe Text
a -> UpdateUserProfile
s {$sel:sshPublicKey:UpdateUserProfile' :: Maybe Text
sshPublicKey = Maybe Text
a} :: UpdateUserProfile)

-- | The email address that is displayed as part of the user\'s profile in
-- AWS CodeStar.
updateUserProfile_emailAddress :: Lens.Lens' UpdateUserProfile (Prelude.Maybe Prelude.Text)
updateUserProfile_emailAddress :: (Maybe Text -> f (Maybe Text))
-> UpdateUserProfile -> f UpdateUserProfile
updateUserProfile_emailAddress = (UpdateUserProfile -> Maybe (Sensitive Text))
-> (UpdateUserProfile
    -> Maybe (Sensitive Text) -> UpdateUserProfile)
-> Lens
     UpdateUserProfile
     UpdateUserProfile
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfile' {Maybe (Sensitive Text)
emailAddress :: Maybe (Sensitive Text)
$sel:emailAddress:UpdateUserProfile' :: UpdateUserProfile -> Maybe (Sensitive Text)
emailAddress} -> Maybe (Sensitive Text)
emailAddress) (\s :: UpdateUserProfile
s@UpdateUserProfile' {} Maybe (Sensitive Text)
a -> UpdateUserProfile
s {$sel:emailAddress:UpdateUserProfile' :: Maybe (Sensitive Text)
emailAddress = Maybe (Sensitive Text)
a} :: UpdateUserProfile) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateUserProfile -> f UpdateUserProfile)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateUserProfile
-> f UpdateUserProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The name that is displayed as the friendly name for the user in AWS
-- CodeStar.
updateUserProfile_displayName :: Lens.Lens' UpdateUserProfile (Prelude.Maybe Prelude.Text)
updateUserProfile_displayName :: (Maybe Text -> f (Maybe Text))
-> UpdateUserProfile -> f UpdateUserProfile
updateUserProfile_displayName = (UpdateUserProfile -> Maybe (Sensitive Text))
-> (UpdateUserProfile
    -> Maybe (Sensitive Text) -> UpdateUserProfile)
-> Lens
     UpdateUserProfile
     UpdateUserProfile
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfile' {Maybe (Sensitive Text)
displayName :: Maybe (Sensitive Text)
$sel:displayName:UpdateUserProfile' :: UpdateUserProfile -> Maybe (Sensitive Text)
displayName} -> Maybe (Sensitive Text)
displayName) (\s :: UpdateUserProfile
s@UpdateUserProfile' {} Maybe (Sensitive Text)
a -> UpdateUserProfile
s {$sel:displayName:UpdateUserProfile' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
a} :: UpdateUserProfile) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateUserProfile -> f UpdateUserProfile)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateUserProfile
-> f UpdateUserProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The name that will be displayed as the friendly name for the user in AWS
-- CodeStar.
updateUserProfile_userArn :: Lens.Lens' UpdateUserProfile Prelude.Text
updateUserProfile_userArn :: (Text -> f Text) -> UpdateUserProfile -> f UpdateUserProfile
updateUserProfile_userArn = (UpdateUserProfile -> Text)
-> (UpdateUserProfile -> Text -> UpdateUserProfile)
-> Lens UpdateUserProfile UpdateUserProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfile' {Text
userArn :: Text
$sel:userArn:UpdateUserProfile' :: UpdateUserProfile -> Text
userArn} -> Text
userArn) (\s :: UpdateUserProfile
s@UpdateUserProfile' {} Text
a -> UpdateUserProfile
s {$sel:userArn:UpdateUserProfile' :: Text
userArn = Text
a} :: UpdateUserProfile)

instance Core.AWSRequest UpdateUserProfile where
  type
    AWSResponse UpdateUserProfile =
      UpdateUserProfileResponse
  request :: UpdateUserProfile -> Request UpdateUserProfile
request = Service -> UpdateUserProfile -> Request UpdateUserProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateUserProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateUserProfile)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateUserProfile))
-> Logger
-> Service
-> Proxy UpdateUserProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateUserProfile)))
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 POSIX
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe POSIX
-> Int
-> Text
-> UpdateUserProfileResponse
UpdateUserProfileResponse'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe (Sensitive Text)
 -> Maybe POSIX
 -> Int
 -> Text
 -> UpdateUserProfileResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe POSIX
      -> Int
      -> Text
      -> UpdateUserProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastModifiedTimestamp")
            Either
  String
  (Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe POSIX
   -> Int
   -> Text
   -> UpdateUserProfileResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe (Sensitive Text)
      -> Maybe POSIX
      -> Int
      -> Text
      -> UpdateUserProfileResponse)
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
"sshPublicKey")
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe (Sensitive Text)
   -> Maybe POSIX
   -> Int
   -> Text
   -> UpdateUserProfileResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe POSIX -> Int -> Text -> UpdateUserProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"emailAddress")
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe POSIX -> Int -> Text -> UpdateUserProfileResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String (Maybe POSIX -> Int -> Text -> UpdateUserProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"displayName")
            Either
  String (Maybe POSIX -> Int -> Text -> UpdateUserProfileResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> Text -> UpdateUserProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"createdTimestamp")
            Either String (Int -> Text -> UpdateUserProfileResponse)
-> Either String Int
-> Either String (Text -> UpdateUserProfileResponse)
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 (Text -> UpdateUserProfileResponse)
-> Either String Text -> Either String UpdateUserProfileResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"userArn")
      )

instance Prelude.Hashable UpdateUserProfile

instance Prelude.NFData UpdateUserProfile

instance Core.ToHeaders UpdateUserProfile where
  toHeaders :: UpdateUserProfile -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateUserProfile -> 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
"CodeStar_20170419.UpdateUserProfile" ::
                          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 UpdateUserProfile where
  toJSON :: UpdateUserProfile -> Value
toJSON UpdateUserProfile' {Maybe Text
Maybe (Sensitive Text)
Text
userArn :: Text
displayName :: Maybe (Sensitive Text)
emailAddress :: Maybe (Sensitive Text)
sshPublicKey :: Maybe Text
$sel:userArn:UpdateUserProfile' :: UpdateUserProfile -> Text
$sel:displayName:UpdateUserProfile' :: UpdateUserProfile -> Maybe (Sensitive Text)
$sel:emailAddress:UpdateUserProfile' :: UpdateUserProfile -> Maybe (Sensitive Text)
$sel:sshPublicKey:UpdateUserProfile' :: UpdateUserProfile -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"sshPublicKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sshPublicKey,
            (Text
"emailAddress" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
emailAddress,
            (Text
"displayName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
displayName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"userArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userArn)
          ]
      )

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

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

-- | /See:/ 'newUpdateUserProfileResponse' smart constructor.
data UpdateUserProfileResponse = UpdateUserProfileResponse'
  { -- | The date the user profile was last modified, in timestamp format.
    UpdateUserProfileResponse -> Maybe POSIX
lastModifiedTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The SSH public key associated with the user in AWS CodeStar. This is the
    -- public portion of the public\/private keypair the user can use to access
    -- project resources if a project owner allows the user remote access to
    -- those resources.
    UpdateUserProfileResponse -> Maybe Text
sshPublicKey :: Prelude.Maybe Prelude.Text,
    -- | The email address that is displayed as part of the user\'s profile in
    -- AWS CodeStar.
    UpdateUserProfileResponse -> Maybe (Sensitive Text)
emailAddress :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The name that is displayed as the friendly name for the user in AWS
    -- CodeStar.
    UpdateUserProfileResponse -> Maybe (Sensitive Text)
displayName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The date the user profile was created, in timestamp format.
    UpdateUserProfileResponse -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The response's http status code.
    UpdateUserProfileResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the user in IAM.
    UpdateUserProfileResponse -> Text
userArn :: Prelude.Text
  }
  deriving (UpdateUserProfileResponse -> UpdateUserProfileResponse -> Bool
(UpdateUserProfileResponse -> UpdateUserProfileResponse -> Bool)
-> (UpdateUserProfileResponse -> UpdateUserProfileResponse -> Bool)
-> Eq UpdateUserProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserProfileResponse -> UpdateUserProfileResponse -> Bool
$c/= :: UpdateUserProfileResponse -> UpdateUserProfileResponse -> Bool
== :: UpdateUserProfileResponse -> UpdateUserProfileResponse -> Bool
$c== :: UpdateUserProfileResponse -> UpdateUserProfileResponse -> Bool
Prelude.Eq, Int -> UpdateUserProfileResponse -> ShowS
[UpdateUserProfileResponse] -> ShowS
UpdateUserProfileResponse -> String
(Int -> UpdateUserProfileResponse -> ShowS)
-> (UpdateUserProfileResponse -> String)
-> ([UpdateUserProfileResponse] -> ShowS)
-> Show UpdateUserProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserProfileResponse] -> ShowS
$cshowList :: [UpdateUserProfileResponse] -> ShowS
show :: UpdateUserProfileResponse -> String
$cshow :: UpdateUserProfileResponse -> String
showsPrec :: Int -> UpdateUserProfileResponse -> ShowS
$cshowsPrec :: Int -> UpdateUserProfileResponse -> ShowS
Prelude.Show, (forall x.
 UpdateUserProfileResponse -> Rep UpdateUserProfileResponse x)
-> (forall x.
    Rep UpdateUserProfileResponse x -> UpdateUserProfileResponse)
-> Generic UpdateUserProfileResponse
forall x.
Rep UpdateUserProfileResponse x -> UpdateUserProfileResponse
forall x.
UpdateUserProfileResponse -> Rep UpdateUserProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateUserProfileResponse x -> UpdateUserProfileResponse
$cfrom :: forall x.
UpdateUserProfileResponse -> Rep UpdateUserProfileResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateUserProfileResponse' 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:
--
-- 'lastModifiedTimestamp', 'updateUserProfileResponse_lastModifiedTimestamp' - The date the user profile was last modified, in timestamp format.
--
-- 'sshPublicKey', 'updateUserProfileResponse_sshPublicKey' - The SSH public key associated with the user in AWS CodeStar. This is the
-- public portion of the public\/private keypair the user can use to access
-- project resources if a project owner allows the user remote access to
-- those resources.
--
-- 'emailAddress', 'updateUserProfileResponse_emailAddress' - The email address that is displayed as part of the user\'s profile in
-- AWS CodeStar.
--
-- 'displayName', 'updateUserProfileResponse_displayName' - The name that is displayed as the friendly name for the user in AWS
-- CodeStar.
--
-- 'createdTimestamp', 'updateUserProfileResponse_createdTimestamp' - The date the user profile was created, in timestamp format.
--
-- 'httpStatus', 'updateUserProfileResponse_httpStatus' - The response's http status code.
--
-- 'userArn', 'updateUserProfileResponse_userArn' - The Amazon Resource Name (ARN) of the user in IAM.
newUpdateUserProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'userArn'
  Prelude.Text ->
  UpdateUserProfileResponse
newUpdateUserProfileResponse :: Int -> Text -> UpdateUserProfileResponse
newUpdateUserProfileResponse Int
pHttpStatus_ Text
pUserArn_ =
  UpdateUserProfileResponse' :: Maybe POSIX
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe POSIX
-> Int
-> Text
-> UpdateUserProfileResponse
UpdateUserProfileResponse'
    { $sel:lastModifiedTimestamp:UpdateUserProfileResponse' :: Maybe POSIX
lastModifiedTimestamp =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sshPublicKey:UpdateUserProfileResponse' :: Maybe Text
sshPublicKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:emailAddress:UpdateUserProfileResponse' :: Maybe (Sensitive Text)
emailAddress = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:UpdateUserProfileResponse' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:UpdateUserProfileResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateUserProfileResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:userArn:UpdateUserProfileResponse' :: Text
userArn = Text
pUserArn_
    }

-- | The date the user profile was last modified, in timestamp format.
updateUserProfileResponse_lastModifiedTimestamp :: Lens.Lens' UpdateUserProfileResponse (Prelude.Maybe Prelude.UTCTime)
updateUserProfileResponse_lastModifiedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateUserProfileResponse -> f UpdateUserProfileResponse
updateUserProfileResponse_lastModifiedTimestamp = (UpdateUserProfileResponse -> Maybe POSIX)
-> (UpdateUserProfileResponse
    -> Maybe POSIX -> UpdateUserProfileResponse)
-> Lens
     UpdateUserProfileResponse
     UpdateUserProfileResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfileResponse' {Maybe POSIX
lastModifiedTimestamp :: Maybe POSIX
$sel:lastModifiedTimestamp:UpdateUserProfileResponse' :: UpdateUserProfileResponse -> Maybe POSIX
lastModifiedTimestamp} -> Maybe POSIX
lastModifiedTimestamp) (\s :: UpdateUserProfileResponse
s@UpdateUserProfileResponse' {} Maybe POSIX
a -> UpdateUserProfileResponse
s {$sel:lastModifiedTimestamp:UpdateUserProfileResponse' :: Maybe POSIX
lastModifiedTimestamp = Maybe POSIX
a} :: UpdateUserProfileResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateUserProfileResponse -> f UpdateUserProfileResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateUserProfileResponse
-> f UpdateUserProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The SSH public key associated with the user in AWS CodeStar. This is the
-- public portion of the public\/private keypair the user can use to access
-- project resources if a project owner allows the user remote access to
-- those resources.
updateUserProfileResponse_sshPublicKey :: Lens.Lens' UpdateUserProfileResponse (Prelude.Maybe Prelude.Text)
updateUserProfileResponse_sshPublicKey :: (Maybe Text -> f (Maybe Text))
-> UpdateUserProfileResponse -> f UpdateUserProfileResponse
updateUserProfileResponse_sshPublicKey = (UpdateUserProfileResponse -> Maybe Text)
-> (UpdateUserProfileResponse
    -> Maybe Text -> UpdateUserProfileResponse)
-> Lens
     UpdateUserProfileResponse
     UpdateUserProfileResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfileResponse' {Maybe Text
sshPublicKey :: Maybe Text
$sel:sshPublicKey:UpdateUserProfileResponse' :: UpdateUserProfileResponse -> Maybe Text
sshPublicKey} -> Maybe Text
sshPublicKey) (\s :: UpdateUserProfileResponse
s@UpdateUserProfileResponse' {} Maybe Text
a -> UpdateUserProfileResponse
s {$sel:sshPublicKey:UpdateUserProfileResponse' :: Maybe Text
sshPublicKey = Maybe Text
a} :: UpdateUserProfileResponse)

-- | The email address that is displayed as part of the user\'s profile in
-- AWS CodeStar.
updateUserProfileResponse_emailAddress :: Lens.Lens' UpdateUserProfileResponse (Prelude.Maybe Prelude.Text)
updateUserProfileResponse_emailAddress :: (Maybe Text -> f (Maybe Text))
-> UpdateUserProfileResponse -> f UpdateUserProfileResponse
updateUserProfileResponse_emailAddress = (UpdateUserProfileResponse -> Maybe (Sensitive Text))
-> (UpdateUserProfileResponse
    -> Maybe (Sensitive Text) -> UpdateUserProfileResponse)
-> Lens
     UpdateUserProfileResponse
     UpdateUserProfileResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfileResponse' {Maybe (Sensitive Text)
emailAddress :: Maybe (Sensitive Text)
$sel:emailAddress:UpdateUserProfileResponse' :: UpdateUserProfileResponse -> Maybe (Sensitive Text)
emailAddress} -> Maybe (Sensitive Text)
emailAddress) (\s :: UpdateUserProfileResponse
s@UpdateUserProfileResponse' {} Maybe (Sensitive Text)
a -> UpdateUserProfileResponse
s {$sel:emailAddress:UpdateUserProfileResponse' :: Maybe (Sensitive Text)
emailAddress = Maybe (Sensitive Text)
a} :: UpdateUserProfileResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateUserProfileResponse -> f UpdateUserProfileResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateUserProfileResponse
-> f UpdateUserProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The name that is displayed as the friendly name for the user in AWS
-- CodeStar.
updateUserProfileResponse_displayName :: Lens.Lens' UpdateUserProfileResponse (Prelude.Maybe Prelude.Text)
updateUserProfileResponse_displayName :: (Maybe Text -> f (Maybe Text))
-> UpdateUserProfileResponse -> f UpdateUserProfileResponse
updateUserProfileResponse_displayName = (UpdateUserProfileResponse -> Maybe (Sensitive Text))
-> (UpdateUserProfileResponse
    -> Maybe (Sensitive Text) -> UpdateUserProfileResponse)
-> Lens
     UpdateUserProfileResponse
     UpdateUserProfileResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfileResponse' {Maybe (Sensitive Text)
displayName :: Maybe (Sensitive Text)
$sel:displayName:UpdateUserProfileResponse' :: UpdateUserProfileResponse -> Maybe (Sensitive Text)
displayName} -> Maybe (Sensitive Text)
displayName) (\s :: UpdateUserProfileResponse
s@UpdateUserProfileResponse' {} Maybe (Sensitive Text)
a -> UpdateUserProfileResponse
s {$sel:displayName:UpdateUserProfileResponse' :: Maybe (Sensitive Text)
displayName = Maybe (Sensitive Text)
a} :: UpdateUserProfileResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateUserProfileResponse -> f UpdateUserProfileResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateUserProfileResponse
-> f UpdateUserProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The date the user profile was created, in timestamp format.
updateUserProfileResponse_createdTimestamp :: Lens.Lens' UpdateUserProfileResponse (Prelude.Maybe Prelude.UTCTime)
updateUserProfileResponse_createdTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateUserProfileResponse -> f UpdateUserProfileResponse
updateUserProfileResponse_createdTimestamp = (UpdateUserProfileResponse -> Maybe POSIX)
-> (UpdateUserProfileResponse
    -> Maybe POSIX -> UpdateUserProfileResponse)
-> Lens
     UpdateUserProfileResponse
     UpdateUserProfileResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfileResponse' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:UpdateUserProfileResponse' :: UpdateUserProfileResponse -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: UpdateUserProfileResponse
s@UpdateUserProfileResponse' {} Maybe POSIX
a -> UpdateUserProfileResponse
s {$sel:createdTimestamp:UpdateUserProfileResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: UpdateUserProfileResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateUserProfileResponse -> f UpdateUserProfileResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateUserProfileResponse
-> f UpdateUserProfileResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | The Amazon Resource Name (ARN) of the user in IAM.
updateUserProfileResponse_userArn :: Lens.Lens' UpdateUserProfileResponse Prelude.Text
updateUserProfileResponse_userArn :: (Text -> f Text)
-> UpdateUserProfileResponse -> f UpdateUserProfileResponse
updateUserProfileResponse_userArn = (UpdateUserProfileResponse -> Text)
-> (UpdateUserProfileResponse -> Text -> UpdateUserProfileResponse)
-> Lens
     UpdateUserProfileResponse UpdateUserProfileResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfileResponse' {Text
userArn :: Text
$sel:userArn:UpdateUserProfileResponse' :: UpdateUserProfileResponse -> Text
userArn} -> Text
userArn) (\s :: UpdateUserProfileResponse
s@UpdateUserProfileResponse' {} Text
a -> UpdateUserProfileResponse
s {$sel:userArn:UpdateUserProfileResponse' :: Text
userArn = Text
a} :: UpdateUserProfileResponse)

instance Prelude.NFData UpdateUserProfileResponse