module Network.AWS.OpsWorks.SetPermission
(
setPermission
, SetPermission
, spAllowSudo
, spLevel
, spAllowSSH
, spStackId
, spIAMUserARN
, setPermissionResponse
, SetPermissionResponse
) where
import Network.AWS.Lens
import Network.AWS.OpsWorks.Types
import Network.AWS.OpsWorks.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data SetPermission = SetPermission'
{ _spAllowSudo :: !(Maybe Bool)
, _spLevel :: !(Maybe Text)
, _spAllowSSH :: !(Maybe Bool)
, _spStackId :: !Text
, _spIAMUserARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
setPermission
:: Text
-> Text
-> SetPermission
setPermission pStackId_ pIAMUserARN_ =
SetPermission'
{ _spAllowSudo = Nothing
, _spLevel = Nothing
, _spAllowSSH = Nothing
, _spStackId = pStackId_
, _spIAMUserARN = pIAMUserARN_
}
spAllowSudo :: Lens' SetPermission (Maybe Bool)
spAllowSudo = lens _spAllowSudo (\ s a -> s{_spAllowSudo = a});
spLevel :: Lens' SetPermission (Maybe Text)
spLevel = lens _spLevel (\ s a -> s{_spLevel = a});
spAllowSSH :: Lens' SetPermission (Maybe Bool)
spAllowSSH = lens _spAllowSSH (\ s a -> s{_spAllowSSH = a});
spStackId :: Lens' SetPermission Text
spStackId = lens _spStackId (\ s a -> s{_spStackId = a});
spIAMUserARN :: Lens' SetPermission Text
spIAMUserARN = lens _spIAMUserARN (\ s a -> s{_spIAMUserARN = a});
instance AWSRequest SetPermission where
type Rs SetPermission = SetPermissionResponse
request = postJSON opsWorks
response = receiveNull SetPermissionResponse'
instance Hashable SetPermission
instance NFData SetPermission
instance ToHeaders SetPermission where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("OpsWorks_20130218.SetPermission" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON SetPermission where
toJSON SetPermission'{..}
= object
(catMaybes
[("AllowSudo" .=) <$> _spAllowSudo,
("Level" .=) <$> _spLevel,
("AllowSsh" .=) <$> _spAllowSSH,
Just ("StackId" .= _spStackId),
Just ("IamUserArn" .= _spIAMUserARN)])
instance ToPath SetPermission where
toPath = const "/"
instance ToQuery SetPermission where
toQuery = const mempty
data SetPermissionResponse =
SetPermissionResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
setPermissionResponse
:: SetPermissionResponse
setPermissionResponse = SetPermissionResponse'
instance NFData SetPermissionResponse