module Network.AWS.Redshift.CreateHsmClientCertificate
(
CreateHsmClientCertificate
, createHsmClientCertificate
, chccHsmClientCertificateIdentifier
, chccTags
, CreateHsmClientCertificateResponse
, createHsmClientCertificateResponse
, chccrHsmClientCertificate
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data CreateHsmClientCertificate = CreateHsmClientCertificate
{ _chccHsmClientCertificateIdentifier :: Text
, _chccTags :: List "member" Tag
} deriving (Eq, Read, Show)
createHsmClientCertificate :: Text
-> CreateHsmClientCertificate
createHsmClientCertificate p1 = CreateHsmClientCertificate
{ _chccHsmClientCertificateIdentifier = p1
, _chccTags = mempty
}
chccHsmClientCertificateIdentifier :: Lens' CreateHsmClientCertificate Text
chccHsmClientCertificateIdentifier =
lens _chccHsmClientCertificateIdentifier
(\s a -> s { _chccHsmClientCertificateIdentifier = a })
chccTags :: Lens' CreateHsmClientCertificate [Tag]
chccTags = lens _chccTags (\s a -> s { _chccTags = a }) . _List
newtype CreateHsmClientCertificateResponse = CreateHsmClientCertificateResponse
{ _chccrHsmClientCertificate :: Maybe HsmClientCertificate
} deriving (Eq, Read, Show)
createHsmClientCertificateResponse :: CreateHsmClientCertificateResponse
createHsmClientCertificateResponse = CreateHsmClientCertificateResponse
{ _chccrHsmClientCertificate = Nothing
}
chccrHsmClientCertificate :: Lens' CreateHsmClientCertificateResponse (Maybe HsmClientCertificate)
chccrHsmClientCertificate =
lens _chccrHsmClientCertificate
(\s a -> s { _chccrHsmClientCertificate = a })
instance ToPath CreateHsmClientCertificate where
toPath = const "/"
instance ToQuery CreateHsmClientCertificate where
toQuery CreateHsmClientCertificate{..} = mconcat
[ "HsmClientCertificateIdentifier" =? _chccHsmClientCertificateIdentifier
, "Tags" =? _chccTags
]
instance ToHeaders CreateHsmClientCertificate
instance AWSRequest CreateHsmClientCertificate where
type Sv CreateHsmClientCertificate = Redshift
type Rs CreateHsmClientCertificate = CreateHsmClientCertificateResponse
request = post "CreateHsmClientCertificate"
response = xmlResponse
instance FromXML CreateHsmClientCertificateResponse where
parseXML = withElement "CreateHsmClientCertificateResult" $ \x -> CreateHsmClientCertificateResponse
<$> x .@? "HsmClientCertificate"