module Network.AWS.Redshift.CreateHSMConfiguration
(
createHSMConfiguration
, CreateHSMConfiguration
, chcTags
, chcHSMConfigurationIdentifier
, chcDescription
, chcHSMIPAddress
, chcHSMPartitionName
, chcHSMPartitionPassword
, chcHSMServerPublicCertificate
, createHSMConfigurationResponse
, CreateHSMConfigurationResponse
, chcrsHSMConfiguration
, chcrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CreateHSMConfiguration = CreateHSMConfiguration'
{ _chcTags :: !(Maybe [Tag])
, _chcHSMConfigurationIdentifier :: !Text
, _chcDescription :: !Text
, _chcHSMIPAddress :: !Text
, _chcHSMPartitionName :: !Text
, _chcHSMPartitionPassword :: !Text
, _chcHSMServerPublicCertificate :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createHSMConfiguration
:: Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateHSMConfiguration
createHSMConfiguration pHSMConfigurationIdentifier_ pDescription_ pHSMIPAddress_ pHSMPartitionName_ pHSMPartitionPassword_ pHSMServerPublicCertificate_ =
CreateHSMConfiguration'
{ _chcTags = Nothing
, _chcHSMConfigurationIdentifier = pHSMConfigurationIdentifier_
, _chcDescription = pDescription_
, _chcHSMIPAddress = pHSMIPAddress_
, _chcHSMPartitionName = pHSMPartitionName_
, _chcHSMPartitionPassword = pHSMPartitionPassword_
, _chcHSMServerPublicCertificate = pHSMServerPublicCertificate_
}
chcTags :: Lens' CreateHSMConfiguration [Tag]
chcTags = lens _chcTags (\ s a -> s{_chcTags = a}) . _Default . _Coerce;
chcHSMConfigurationIdentifier :: Lens' CreateHSMConfiguration Text
chcHSMConfigurationIdentifier = lens _chcHSMConfigurationIdentifier (\ s a -> s{_chcHSMConfigurationIdentifier = a});
chcDescription :: Lens' CreateHSMConfiguration Text
chcDescription = lens _chcDescription (\ s a -> s{_chcDescription = a});
chcHSMIPAddress :: Lens' CreateHSMConfiguration Text
chcHSMIPAddress = lens _chcHSMIPAddress (\ s a -> s{_chcHSMIPAddress = a});
chcHSMPartitionName :: Lens' CreateHSMConfiguration Text
chcHSMPartitionName = lens _chcHSMPartitionName (\ s a -> s{_chcHSMPartitionName = a});
chcHSMPartitionPassword :: Lens' CreateHSMConfiguration Text
chcHSMPartitionPassword = lens _chcHSMPartitionPassword (\ s a -> s{_chcHSMPartitionPassword = a});
chcHSMServerPublicCertificate :: Lens' CreateHSMConfiguration Text
chcHSMServerPublicCertificate = lens _chcHSMServerPublicCertificate (\ s a -> s{_chcHSMServerPublicCertificate = a});
instance AWSRequest CreateHSMConfiguration where
type Rs CreateHSMConfiguration =
CreateHSMConfigurationResponse
request = postQuery redshift
response
= receiveXMLWrapper "CreateHsmConfigurationResult"
(\ s h x ->
CreateHSMConfigurationResponse' <$>
(x .@? "HsmConfiguration") <*> (pure (fromEnum s)))
instance ToHeaders CreateHSMConfiguration where
toHeaders = const mempty
instance ToPath CreateHSMConfiguration where
toPath = const "/"
instance ToQuery CreateHSMConfiguration where
toQuery CreateHSMConfiguration'{..}
= mconcat
["Action" =:
("CreateHsmConfiguration" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _chcTags),
"HsmConfigurationIdentifier" =:
_chcHSMConfigurationIdentifier,
"Description" =: _chcDescription,
"HsmIpAddress" =: _chcHSMIPAddress,
"HsmPartitionName" =: _chcHSMPartitionName,
"HsmPartitionPassword" =: _chcHSMPartitionPassword,
"HsmServerPublicCertificate" =:
_chcHSMServerPublicCertificate]
data CreateHSMConfigurationResponse = CreateHSMConfigurationResponse'
{ _chcrsHSMConfiguration :: !(Maybe HSMConfiguration)
, _chcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createHSMConfigurationResponse
:: Int
-> CreateHSMConfigurationResponse
createHSMConfigurationResponse pResponseStatus_ =
CreateHSMConfigurationResponse'
{ _chcrsHSMConfiguration = Nothing
, _chcrsResponseStatus = pResponseStatus_
}
chcrsHSMConfiguration :: Lens' CreateHSMConfigurationResponse (Maybe HSMConfiguration)
chcrsHSMConfiguration = lens _chcrsHSMConfiguration (\ s a -> s{_chcrsHSMConfiguration = a});
chcrsResponseStatus :: Lens' CreateHSMConfigurationResponse Int
chcrsResponseStatus = lens _chcrsResponseStatus (\ s a -> s{_chcrsResponseStatus = a});