module Network.AWS.Redshift.CreateHSMClientCertificate
(
createHSMClientCertificate
, CreateHSMClientCertificate
, chccTags
, chccHSMClientCertificateIdentifier
, createHSMClientCertificateResponse
, CreateHSMClientCertificateResponse
, chccrsHSMClientCertificate
, chccrsStatus
) 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 CreateHSMClientCertificate = CreateHSMClientCertificate'
{ _chccTags :: !(Maybe [Tag])
, _chccHSMClientCertificateIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createHSMClientCertificate
:: Text
-> CreateHSMClientCertificate
createHSMClientCertificate pHSMClientCertificateIdentifier_ =
CreateHSMClientCertificate'
{ _chccTags = Nothing
, _chccHSMClientCertificateIdentifier = pHSMClientCertificateIdentifier_
}
chccTags :: Lens' CreateHSMClientCertificate [Tag]
chccTags = lens _chccTags (\ s a -> s{_chccTags = a}) . _Default . _Coerce;
chccHSMClientCertificateIdentifier :: Lens' CreateHSMClientCertificate Text
chccHSMClientCertificateIdentifier = lens _chccHSMClientCertificateIdentifier (\ s a -> s{_chccHSMClientCertificateIdentifier = a});
instance AWSRequest CreateHSMClientCertificate where
type Rs CreateHSMClientCertificate =
CreateHSMClientCertificateResponse
request = postQuery redshift
response
= receiveXMLWrapper
"CreateHsmClientCertificateResult"
(\ s h x ->
CreateHSMClientCertificateResponse' <$>
(x .@? "HsmClientCertificate") <*>
(pure (fromEnum s)))
instance ToHeaders CreateHSMClientCertificate where
toHeaders = const mempty
instance ToPath CreateHSMClientCertificate where
toPath = const "/"
instance ToQuery CreateHSMClientCertificate where
toQuery CreateHSMClientCertificate'{..}
= mconcat
["Action" =:
("CreateHsmClientCertificate" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _chccTags),
"HsmClientCertificateIdentifier" =:
_chccHSMClientCertificateIdentifier]
data CreateHSMClientCertificateResponse = CreateHSMClientCertificateResponse'
{ _chccrsHSMClientCertificate :: !(Maybe HSMClientCertificate)
, _chccrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createHSMClientCertificateResponse
:: Int
-> CreateHSMClientCertificateResponse
createHSMClientCertificateResponse pStatus_ =
CreateHSMClientCertificateResponse'
{ _chccrsHSMClientCertificate = Nothing
, _chccrsStatus = pStatus_
}
chccrsHSMClientCertificate :: Lens' CreateHSMClientCertificateResponse (Maybe HSMClientCertificate)
chccrsHSMClientCertificate = lens _chccrsHSMClientCertificate (\ s a -> s{_chccrsHSMClientCertificate = a});
chccrsStatus :: Lens' CreateHSMClientCertificateResponse Int
chccrsStatus = lens _chccrsStatus (\ s a -> s{_chccrsStatus = a});