{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:allowSelfManagement:UpdateUserProfile' :: Maybe Bool
allowSelfManagement =
forall a. Maybe a
Prelude.Nothing,
$sel:sshPublicKey:UpdateUserProfile' :: Maybe Text
sshPublicKey = forall a. Maybe a
Prelude.Nothing,
$sel:sshUsername:UpdateUserProfile' :: Maybe Text
sshUsername = forall a. Maybe a
Prelude.Nothing,
$sel:iamUserArn:UpdateUserProfile' :: Text
iamUserArn = Text
pIamUserArn_
}
updateUserProfile_allowSelfManagement :: Lens.Lens' UpdateUserProfile (Prelude.Maybe Prelude.Bool)
updateUserProfile_allowSelfManagement :: Lens' UpdateUserProfile (Maybe Bool)
updateUserProfile_allowSelfManagement = 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 :: Lens' UpdateUserProfile (Maybe Text)
updateUserProfile_sshPublicKey = 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 :: Lens' UpdateUserProfile (Maybe Text)
updateUserProfile_sshUsername = 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 :: Lens' UpdateUserProfile Text
updateUserProfile_iamUserArn = 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 :: (Service -> Service)
-> UpdateUserProfile -> Request UpdateUserProfile
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 UpdateUserProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserProfile)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UpdateUserProfileResponse
UpdateUserProfileResponse'
instance Prelude.Hashable UpdateUserProfile where
hashWithSalt :: Int -> UpdateUserProfile -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowSelfManagement
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sshPublicKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sshUsername
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
iamUserArn
instance Prelude.NFData UpdateUserProfile where
rnf :: UpdateUserProfile -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowSelfManagement
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sshPublicKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sshUsername
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
iamUserArn
instance Data.ToHeaders UpdateUserProfile where
toHeaders :: UpdateUserProfile -> [Header]
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 -> [Header]
Data.=# ( ByteString
"OpsWorks_20130218.UpdateUserProfile" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AllowSelfManagement" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
allowSelfManagement,
(Key
"SshPublicKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sshPublicKey,
(Key
"SshUsername" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sshUsername,
forall a. a -> Maybe a
Prelude.Just (Key
"IamUserArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
iamUserArn)
]
)
instance Data.ToPath UpdateUserProfile where
toPath :: UpdateUserProfile -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateUserProfile where
toQuery :: UpdateUserProfile -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateUserProfileResponse = UpdateUserProfileResponse'
{
}
deriving (UpdateUserProfileResponse -> UpdateUserProfileResponse -> Bool
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]
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
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.
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 where
rnf :: UpdateUserProfileResponse -> ()
rnf UpdateUserProfileResponse
_ = ()