module Network.AWS.IoT.TransferCertificate
(
transferCertificate
, TransferCertificate
, tcTransferMessage
, tcCertificateId
, tcTargetAWSAccount
, transferCertificateResponse
, TransferCertificateResponse
, tcrsTransferredCertificateARN
, tcrsResponseStatus
) 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
data TransferCertificate = TransferCertificate'
{ _tcTransferMessage :: !(Maybe Text)
, _tcCertificateId :: !Text
, _tcTargetAWSAccount :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
transferCertificate
:: Text
-> Text
-> TransferCertificate
transferCertificate pCertificateId_ pTargetAWSAccount_ =
TransferCertificate'
{ _tcTransferMessage = Nothing
, _tcCertificateId = pCertificateId_
, _tcTargetAWSAccount = pTargetAWSAccount_
}
tcTransferMessage :: Lens' TransferCertificate (Maybe Text)
tcTransferMessage = lens _tcTransferMessage (\ s a -> s{_tcTransferMessage = a});
tcCertificateId :: Lens' TransferCertificate Text
tcCertificateId = lens _tcCertificateId (\ s a -> s{_tcCertificateId = a});
tcTargetAWSAccount :: Lens' TransferCertificate Text
tcTargetAWSAccount = lens _tcTargetAWSAccount (\ s a -> s{_tcTargetAWSAccount = a});
instance AWSRequest TransferCertificate where
type Rs TransferCertificate =
TransferCertificateResponse
request = patchJSON ioT
response
= receiveJSON
(\ s h x ->
TransferCertificateResponse' <$>
(x .?> "transferredCertificateArn") <*>
(pure (fromEnum s)))
instance Hashable TransferCertificate
instance NFData TransferCertificate
instance ToHeaders TransferCertificate where
toHeaders = const mempty
instance ToJSON TransferCertificate where
toJSON TransferCertificate'{..}
= object
(catMaybes
[("transferMessage" .=) <$> _tcTransferMessage])
instance ToPath TransferCertificate where
toPath TransferCertificate'{..}
= mconcat
["/transfer-certificate/", toBS _tcCertificateId]
instance ToQuery TransferCertificate where
toQuery TransferCertificate'{..}
= mconcat ["targetAwsAccount" =: _tcTargetAWSAccount]
data TransferCertificateResponse = TransferCertificateResponse'
{ _tcrsTransferredCertificateARN :: !(Maybe Text)
, _tcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
transferCertificateResponse
:: Int
-> TransferCertificateResponse
transferCertificateResponse pResponseStatus_ =
TransferCertificateResponse'
{ _tcrsTransferredCertificateARN = Nothing
, _tcrsResponseStatus = pResponseStatus_
}
tcrsTransferredCertificateARN :: Lens' TransferCertificateResponse (Maybe Text)
tcrsTransferredCertificateARN = lens _tcrsTransferredCertificateARN (\ s a -> s{_tcrsTransferredCertificateARN = a});
tcrsResponseStatus :: Lens' TransferCertificateResponse Int
tcrsResponseStatus = lens _tcrsResponseStatus (\ s a -> s{_tcrsResponseStatus = a});
instance NFData TransferCertificateResponse