module Network.AWS.IoT.CreateKeysAndCertificate
(
createKeysAndCertificate
, CreateKeysAndCertificate
, ckacSetAsActive
, createKeysAndCertificateResponse
, CreateKeysAndCertificateResponse
, ckacrsKeyPair
, ckacrsCertificatePem
, ckacrsCertificateARN
, ckacrsCertificateId
, ckacrsResponseStatus
) where
import Network.AWS.IoT.Types
import Network.AWS.IoT.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype CreateKeysAndCertificate = CreateKeysAndCertificate'
{ _ckacSetAsActive :: Maybe Bool
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createKeysAndCertificate
:: CreateKeysAndCertificate
createKeysAndCertificate =
CreateKeysAndCertificate'
{ _ckacSetAsActive = Nothing
}
ckacSetAsActive :: Lens' CreateKeysAndCertificate (Maybe Bool)
ckacSetAsActive = lens _ckacSetAsActive (\ s a -> s{_ckacSetAsActive = a});
instance AWSRequest CreateKeysAndCertificate where
type Rs CreateKeysAndCertificate =
CreateKeysAndCertificateResponse
request = postJSON ioT
response
= receiveJSON
(\ s h x ->
CreateKeysAndCertificateResponse' <$>
(x .?> "keyPair") <*> (x .?> "certificatePem") <*>
(x .?> "certificateArn")
<*> (x .?> "certificateId")
<*> (pure (fromEnum s)))
instance Hashable CreateKeysAndCertificate
instance NFData CreateKeysAndCertificate
instance ToHeaders CreateKeysAndCertificate where
toHeaders = const mempty
instance ToJSON CreateKeysAndCertificate where
toJSON = const (Object mempty)
instance ToPath CreateKeysAndCertificate where
toPath = const "/keys-and-certificate"
instance ToQuery CreateKeysAndCertificate where
toQuery CreateKeysAndCertificate'{..}
= mconcat ["setAsActive" =: _ckacSetAsActive]
data CreateKeysAndCertificateResponse = CreateKeysAndCertificateResponse'
{ _ckacrsKeyPair :: !(Maybe KeyPair)
, _ckacrsCertificatePem :: !(Maybe Text)
, _ckacrsCertificateARN :: !(Maybe Text)
, _ckacrsCertificateId :: !(Maybe Text)
, _ckacrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createKeysAndCertificateResponse
:: Int
-> CreateKeysAndCertificateResponse
createKeysAndCertificateResponse pResponseStatus_ =
CreateKeysAndCertificateResponse'
{ _ckacrsKeyPair = Nothing
, _ckacrsCertificatePem = Nothing
, _ckacrsCertificateARN = Nothing
, _ckacrsCertificateId = Nothing
, _ckacrsResponseStatus = pResponseStatus_
}
ckacrsKeyPair :: Lens' CreateKeysAndCertificateResponse (Maybe KeyPair)
ckacrsKeyPair = lens _ckacrsKeyPair (\ s a -> s{_ckacrsKeyPair = a});
ckacrsCertificatePem :: Lens' CreateKeysAndCertificateResponse (Maybe Text)
ckacrsCertificatePem = lens _ckacrsCertificatePem (\ s a -> s{_ckacrsCertificatePem = a});
ckacrsCertificateARN :: Lens' CreateKeysAndCertificateResponse (Maybe Text)
ckacrsCertificateARN = lens _ckacrsCertificateARN (\ s a -> s{_ckacrsCertificateARN = a});
ckacrsCertificateId :: Lens' CreateKeysAndCertificateResponse (Maybe Text)
ckacrsCertificateId = lens _ckacrsCertificateId (\ s a -> s{_ckacrsCertificateId = a});
ckacrsResponseStatus :: Lens' CreateKeysAndCertificateResponse Int
ckacrsResponseStatus = lens _ckacrsResponseStatus (\ s a -> s{_ckacrsResponseStatus = a});
instance NFData CreateKeysAndCertificateResponse