{-# 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 #-}
module Amazonka.OpsWorks.UpdateUserProfile
(
UpdateUserProfile (..),
newUpdateUserProfile,
updateUserProfile_allowSelfManagement,
updateUserProfile_sshPublicKey,
updateUserProfile_sshUsername,
updateUserProfile_iamUserArn,
UpdateUserProfileResponse (..),
newUpdateUserProfileResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateUserProfile = UpdateUserProfile'
{
UpdateUserProfile -> Maybe Bool
allowSelfManagement :: Prelude.Maybe Prelude.Bool,
UpdateUserProfile -> Maybe Text
sshPublicKey :: Prelude.Maybe Prelude.Text,
UpdateUserProfile -> Maybe Text
sshUsername :: Prelude.Maybe Prelude.Text,
UpdateUserProfile -> Text
iamUserArn :: 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, ReadPrec [UpdateUserProfile]
ReadPrec UpdateUserProfile
Int -> ReadS UpdateUserProfile
ReadS [UpdateUserProfile]
(Int -> ReadS UpdateUserProfile)
-> ReadS [UpdateUserProfile]
-> ReadPrec UpdateUserProfile
-> ReadPrec [UpdateUserProfile]
-> Read UpdateUserProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserProfile]
$creadListPrec :: ReadPrec [UpdateUserProfile]
readPrec :: ReadPrec UpdateUserProfile
$creadPrec :: ReadPrec UpdateUserProfile
readList :: ReadS [UpdateUserProfile]
$creadList :: ReadS [UpdateUserProfile]
readsPrec :: Int -> ReadS UpdateUserProfile
$creadsPrec :: Int -> ReadS UpdateUserProfile
Prelude.Read, 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)
newUpdateUserProfile ::
Prelude.Text ->
UpdateUserProfile
newUpdateUserProfile :: Text -> UpdateUserProfile
newUpdateUserProfile Text
pIamUserArn_ =
UpdateUserProfile' :: Maybe Bool -> Maybe Text -> Maybe Text -> Text -> UpdateUserProfile
UpdateUserProfile'
{ $sel:allowSelfManagement:UpdateUserProfile' :: Maybe Bool
allowSelfManagement =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:sshPublicKey:UpdateUserProfile' :: Maybe Text
sshPublicKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sshUsername:UpdateUserProfile' :: Maybe Text
sshUsername = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:iamUserArn:UpdateUserProfile' :: Text
iamUserArn = Text
pIamUserArn_
}
updateUserProfile_allowSelfManagement :: Lens.Lens' UpdateUserProfile (Prelude.Maybe Prelude.Bool)
updateUserProfile_allowSelfManagement :: (Maybe Bool -> f (Maybe Bool))
-> UpdateUserProfile -> f UpdateUserProfile
updateUserProfile_allowSelfManagement = (UpdateUserProfile -> Maybe Bool)
-> (UpdateUserProfile -> Maybe Bool -> UpdateUserProfile)
-> Lens
UpdateUserProfile UpdateUserProfile (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserProfile' {Maybe Bool
allowSelfManagement :: Maybe Bool
$sel:allowSelfManagement:UpdateUserProfile' :: UpdateUserProfile -> Maybe Bool
allowSelfManagement} -> Maybe Bool
allowSelfManagement) (\s :: UpdateUserProfile
s@UpdateUserProfile' {} Maybe Bool
a -> UpdateUserProfile
s {$sel:allowSelfManagement:UpdateUserProfile' :: Maybe Bool
allowSelfManagement = Maybe Bool
a} :: UpdateUserProfile)
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)
updateUserProfile_sshUsername :: Lens.Lens' UpdateUserProfile (Prelude.Maybe Prelude.Text)
updateUserProfile_sshUsername :: (Maybe Text -> f (Maybe Text))
-> UpdateUserProfile -> f UpdateUserProfile
updateUserProfile_sshUsername = (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
sshUsername :: Maybe Text
$sel:sshUsername:UpdateUserProfile' :: UpdateUserProfile -> Maybe Text
sshUsername} -> Maybe Text
sshUsername) (\s :: UpdateUserProfile
s@UpdateUserProfile' {} Maybe Text
a -> UpdateUserProfile
s {$sel:sshUsername:UpdateUserProfile' :: Maybe Text
sshUsername = Maybe Text
a} :: UpdateUserProfile)
updateUserProfile_iamUserArn :: Lens.Lens' UpdateUserProfile Prelude.Text
updateUserProfile_iamUserArn :: (Text -> f Text) -> UpdateUserProfile -> f UpdateUserProfile
updateUserProfile_iamUserArn = (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
iamUserArn :: Text
$sel:iamUserArn:UpdateUserProfile' :: UpdateUserProfile -> Text
iamUserArn} -> Text
iamUserArn) (\s :: UpdateUserProfile
s@UpdateUserProfile' {} Text
a -> UpdateUserProfile
s {$sel:iamUserArn:UpdateUserProfile' :: Text
iamUserArn = 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 =
AWSResponse UpdateUserProfile
-> Logger
-> Service
-> Proxy UpdateUserProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserProfile)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateUserProfile
UpdateUserProfileResponse
UpdateUserProfileResponse'
instance Prelude.Hashable UpdateUserProfile
instance Prelude.NFData UpdateUserProfile
instance Core.ToHeaders UpdateUserProfile where
toHeaders :: UpdateUserProfile -> [Header]
toHeaders =
[Header] -> UpdateUserProfile -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"OpsWorks_20130218.UpdateUserProfile" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateUserProfile where
toJSON :: UpdateUserProfile -> Value
toJSON UpdateUserProfile' {Maybe Bool
Maybe Text
Text
iamUserArn :: Text
sshUsername :: Maybe Text
sshPublicKey :: Maybe Text
allowSelfManagement :: Maybe Bool
$sel:iamUserArn:UpdateUserProfile' :: UpdateUserProfile -> Text
$sel:sshUsername:UpdateUserProfile' :: UpdateUserProfile -> Maybe Text
$sel:sshPublicKey:UpdateUserProfile' :: UpdateUserProfile -> Maybe Text
$sel:allowSelfManagement:UpdateUserProfile' :: UpdateUserProfile -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AllowSelfManagement" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
allowSelfManagement,
(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
"SshUsername" 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
sshUsername,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IamUserArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
iamUserArn)
]
)
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
data UpdateUserProfileResponse = UpdateUserProfileResponse'
{
}
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, ReadPrec [UpdateUserProfileResponse]
ReadPrec UpdateUserProfileResponse
Int -> ReadS UpdateUserProfileResponse
ReadS [UpdateUserProfileResponse]
(Int -> ReadS UpdateUserProfileResponse)
-> ReadS [UpdateUserProfileResponse]
-> ReadPrec UpdateUserProfileResponse
-> ReadPrec [UpdateUserProfileResponse]
-> Read UpdateUserProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserProfileResponse]
$creadListPrec :: ReadPrec [UpdateUserProfileResponse]
readPrec :: ReadPrec UpdateUserProfileResponse
$creadPrec :: ReadPrec UpdateUserProfileResponse
readList :: ReadS [UpdateUserProfileResponse]
$creadList :: ReadS [UpdateUserProfileResponse]
readsPrec :: Int -> ReadS UpdateUserProfileResponse
$creadsPrec :: Int -> ReadS UpdateUserProfileResponse
Prelude.Read, 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)
newUpdateUserProfileResponse ::
UpdateUserProfileResponse
newUpdateUserProfileResponse :: UpdateUserProfileResponse
newUpdateUserProfileResponse =
UpdateUserProfileResponse
UpdateUserProfileResponse'
instance Prelude.NFData UpdateUserProfileResponse