module Network.AWS.OpsWorks.CreateUserProfile
(
CreateUserProfile
, createUserProfile
, cupAllowSelfManagement
, cupIamUserArn
, cupSshPublicKey
, cupSshUsername
, CreateUserProfileResponse
, createUserProfileResponse
, cuprIamUserArn
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.OpsWorks.Types
import qualified GHC.Exts
data CreateUserProfile = CreateUserProfile
{ _cupAllowSelfManagement :: Maybe Bool
, _cupIamUserArn :: Text
, _cupSshPublicKey :: Maybe Text
, _cupSshUsername :: Maybe Text
} deriving (Eq, Ord, Show)
createUserProfile :: Text
-> CreateUserProfile
createUserProfile p1 = CreateUserProfile
{ _cupIamUserArn = p1
, _cupSshUsername = Nothing
, _cupSshPublicKey = Nothing
, _cupAllowSelfManagement = Nothing
}
cupAllowSelfManagement :: Lens' CreateUserProfile (Maybe Bool)
cupAllowSelfManagement =
lens _cupAllowSelfManagement (\s a -> s { _cupAllowSelfManagement = a })
cupIamUserArn :: Lens' CreateUserProfile Text
cupIamUserArn = lens _cupIamUserArn (\s a -> s { _cupIamUserArn = a })
cupSshPublicKey :: Lens' CreateUserProfile (Maybe Text)
cupSshPublicKey = lens _cupSshPublicKey (\s a -> s { _cupSshPublicKey = a })
cupSshUsername :: Lens' CreateUserProfile (Maybe Text)
cupSshUsername = lens _cupSshUsername (\s a -> s { _cupSshUsername = a })
newtype CreateUserProfileResponse = CreateUserProfileResponse
{ _cuprIamUserArn :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
createUserProfileResponse :: CreateUserProfileResponse
createUserProfileResponse = CreateUserProfileResponse
{ _cuprIamUserArn = Nothing
}
cuprIamUserArn :: Lens' CreateUserProfileResponse (Maybe Text)
cuprIamUserArn = lens _cuprIamUserArn (\s a -> s { _cuprIamUserArn = a })
instance ToPath CreateUserProfile where
toPath = const "/"
instance ToQuery CreateUserProfile where
toQuery = const mempty
instance ToHeaders CreateUserProfile
instance ToJSON CreateUserProfile where
toJSON CreateUserProfile{..} = object
[ "IamUserArn" .= _cupIamUserArn
, "SshUsername" .= _cupSshUsername
, "SshPublicKey" .= _cupSshPublicKey
, "AllowSelfManagement" .= _cupAllowSelfManagement
]
instance AWSRequest CreateUserProfile where
type Sv CreateUserProfile = OpsWorks
type Rs CreateUserProfile = CreateUserProfileResponse
request = post "CreateUserProfile"
response = jsonResponse
instance FromJSON CreateUserProfileResponse where
parseJSON = withObject "CreateUserProfileResponse" $ \o -> CreateUserProfileResponse
<$> o .:? "IamUserArn"