module Network.AWS.CloudHSM.ModifyHSM
(
modifyHSM
, ModifyHSM
, mhIAMRoleARN
, mhSubnetId
, mhSyslogIP
, mhExternalId
, mhEniIP
, mhHSMARN
, modifyHSMResponse
, ModifyHSMResponse
, mhsmrsHSMARN
, mhsmrsResponseStatus
) where
import Network.AWS.CloudHSM.Types
import Network.AWS.CloudHSM.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ModifyHSM = ModifyHSM'
{ _mhIAMRoleARN :: !(Maybe Text)
, _mhSubnetId :: !(Maybe Text)
, _mhSyslogIP :: !(Maybe Text)
, _mhExternalId :: !(Maybe Text)
, _mhEniIP :: !(Maybe Text)
, _mhHSMARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyHSM
:: Text
-> ModifyHSM
modifyHSM pHSMARN_ =
ModifyHSM'
{ _mhIAMRoleARN = Nothing
, _mhSubnetId = Nothing
, _mhSyslogIP = Nothing
, _mhExternalId = Nothing
, _mhEniIP = Nothing
, _mhHSMARN = pHSMARN_
}
mhIAMRoleARN :: Lens' ModifyHSM (Maybe Text)
mhIAMRoleARN = lens _mhIAMRoleARN (\ s a -> s{_mhIAMRoleARN = a});
mhSubnetId :: Lens' ModifyHSM (Maybe Text)
mhSubnetId = lens _mhSubnetId (\ s a -> s{_mhSubnetId = a});
mhSyslogIP :: Lens' ModifyHSM (Maybe Text)
mhSyslogIP = lens _mhSyslogIP (\ s a -> s{_mhSyslogIP = a});
mhExternalId :: Lens' ModifyHSM (Maybe Text)
mhExternalId = lens _mhExternalId (\ s a -> s{_mhExternalId = a});
mhEniIP :: Lens' ModifyHSM (Maybe Text)
mhEniIP = lens _mhEniIP (\ s a -> s{_mhEniIP = a});
mhHSMARN :: Lens' ModifyHSM Text
mhHSMARN = lens _mhHSMARN (\ s a -> s{_mhHSMARN = a});
instance AWSRequest ModifyHSM where
type Rs ModifyHSM = ModifyHSMResponse
request = postJSON cloudHSM
response
= receiveJSON
(\ s h x ->
ModifyHSMResponse' <$>
(x .?> "HsmArn") <*> (pure (fromEnum s)))
instance ToHeaders ModifyHSM where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CloudHsmFrontendService.ModifyHsm" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ModifyHSM where
toJSON ModifyHSM'{..}
= object
(catMaybes
[("IamRoleArn" .=) <$> _mhIAMRoleARN,
("SubnetId" .=) <$> _mhSubnetId,
("SyslogIp" .=) <$> _mhSyslogIP,
("ExternalId" .=) <$> _mhExternalId,
("EniIp" .=) <$> _mhEniIP,
Just ("HsmArn" .= _mhHSMARN)])
instance ToPath ModifyHSM where
toPath = const "/"
instance ToQuery ModifyHSM where
toQuery = const mempty
data ModifyHSMResponse = ModifyHSMResponse'
{ _mhsmrsHSMARN :: !(Maybe Text)
, _mhsmrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyHSMResponse
:: Int
-> ModifyHSMResponse
modifyHSMResponse pResponseStatus_ =
ModifyHSMResponse'
{ _mhsmrsHSMARN = Nothing
, _mhsmrsResponseStatus = pResponseStatus_
}
mhsmrsHSMARN :: Lens' ModifyHSMResponse (Maybe Text)
mhsmrsHSMARN = lens _mhsmrsHSMARN (\ s a -> s{_mhsmrsHSMARN = a});
mhsmrsResponseStatus :: Lens' ModifyHSMResponse Int
mhsmrsResponseStatus = lens _mhsmrsResponseStatus (\ s a -> s{_mhsmrsResponseStatus = a});