module Network.AWS.Redshift.CreateHsmConfiguration
(
CreateHsmConfiguration
, createHsmConfiguration
, chcDescription
, chcHsmConfigurationIdentifier
, chcHsmIpAddress
, chcHsmPartitionName
, chcHsmPartitionPassword
, chcHsmServerPublicCertificate
, chcTags
, CreateHsmConfigurationResponse
, createHsmConfigurationResponse
, chcrHsmConfiguration
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data CreateHsmConfiguration = CreateHsmConfiguration
{ _chcDescription :: Text
, _chcHsmConfigurationIdentifier :: Text
, _chcHsmIpAddress :: Text
, _chcHsmPartitionName :: Text
, _chcHsmPartitionPassword :: Text
, _chcHsmServerPublicCertificate :: Text
, _chcTags :: List "member" Tag
} deriving (Eq, Read, Show)
createHsmConfiguration :: Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateHsmConfiguration
createHsmConfiguration p1 p2 p3 p4 p5 p6 = CreateHsmConfiguration
{ _chcHsmConfigurationIdentifier = p1
, _chcDescription = p2
, _chcHsmIpAddress = p3
, _chcHsmPartitionName = p4
, _chcHsmPartitionPassword = p5
, _chcHsmServerPublicCertificate = p6
, _chcTags = mempty
}
chcDescription :: Lens' CreateHsmConfiguration Text
chcDescription = lens _chcDescription (\s a -> s { _chcDescription = a })
chcHsmConfigurationIdentifier :: Lens' CreateHsmConfiguration Text
chcHsmConfigurationIdentifier =
lens _chcHsmConfigurationIdentifier
(\s a -> s { _chcHsmConfigurationIdentifier = 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 })
chcTags :: Lens' CreateHsmConfiguration [Tag]
chcTags = lens _chcTags (\s a -> s { _chcTags = a }) . _List
newtype CreateHsmConfigurationResponse = CreateHsmConfigurationResponse
{ _chcrHsmConfiguration :: Maybe HsmConfiguration
} deriving (Eq, Read, Show)
createHsmConfigurationResponse :: CreateHsmConfigurationResponse
createHsmConfigurationResponse = CreateHsmConfigurationResponse
{ _chcrHsmConfiguration = Nothing
}
chcrHsmConfiguration :: Lens' CreateHsmConfigurationResponse (Maybe HsmConfiguration)
chcrHsmConfiguration =
lens _chcrHsmConfiguration (\s a -> s { _chcrHsmConfiguration = a })
instance ToPath CreateHsmConfiguration where
toPath = const "/"
instance ToQuery CreateHsmConfiguration where
toQuery CreateHsmConfiguration{..} = mconcat
[ "Description" =? _chcDescription
, "HsmConfigurationIdentifier" =? _chcHsmConfigurationIdentifier
, "HsmIpAddress" =? _chcHsmIpAddress
, "HsmPartitionName" =? _chcHsmPartitionName
, "HsmPartitionPassword" =? _chcHsmPartitionPassword
, "HsmServerPublicCertificate" =? _chcHsmServerPublicCertificate
, "Tags" =? _chcTags
]
instance ToHeaders CreateHsmConfiguration
instance AWSRequest CreateHsmConfiguration where
type Sv CreateHsmConfiguration = Redshift
type Rs CreateHsmConfiguration = CreateHsmConfigurationResponse
request = post "CreateHsmConfiguration"
response = xmlResponse
instance FromXML CreateHsmConfigurationResponse where
parseXML = withElement "CreateHsmConfigurationResult" $ \x -> CreateHsmConfigurationResponse
<$> x .@? "HsmConfiguration"