{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Lightsail.DownloadDefaultKeyPair
(
downloadDefaultKeyPair
, DownloadDefaultKeyPair
, downloadDefaultKeyPairResponse
, DownloadDefaultKeyPairResponse
, ddkprsPublicKeyBase64
, ddkprsPrivateKeyBase64
, ddkprsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Lightsail.Types
import Network.AWS.Lightsail.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DownloadDefaultKeyPair =
DownloadDefaultKeyPair'
deriving (Eq, Read, Show, Data, Typeable, Generic)
downloadDefaultKeyPair
:: DownloadDefaultKeyPair
downloadDefaultKeyPair = DownloadDefaultKeyPair'
instance AWSRequest DownloadDefaultKeyPair where
type Rs DownloadDefaultKeyPair =
DownloadDefaultKeyPairResponse
request = postJSON lightsail
response
= receiveJSON
(\ s h x ->
DownloadDefaultKeyPairResponse' <$>
(x .?> "publicKeyBase64") <*>
(x .?> "privateKeyBase64")
<*> (pure (fromEnum s)))
instance Hashable DownloadDefaultKeyPair where
instance NFData DownloadDefaultKeyPair where
instance ToHeaders DownloadDefaultKeyPair where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Lightsail_20161128.DownloadDefaultKeyPair" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DownloadDefaultKeyPair where
toJSON = const (Object mempty)
instance ToPath DownloadDefaultKeyPair where
toPath = const "/"
instance ToQuery DownloadDefaultKeyPair where
toQuery = const mempty
data DownloadDefaultKeyPairResponse = DownloadDefaultKeyPairResponse'
{ _ddkprsPublicKeyBase64 :: !(Maybe Text)
, _ddkprsPrivateKeyBase64 :: !(Maybe Text)
, _ddkprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
downloadDefaultKeyPairResponse
:: Int
-> DownloadDefaultKeyPairResponse
downloadDefaultKeyPairResponse pResponseStatus_ =
DownloadDefaultKeyPairResponse'
{ _ddkprsPublicKeyBase64 = Nothing
, _ddkprsPrivateKeyBase64 = Nothing
, _ddkprsResponseStatus = pResponseStatus_
}
ddkprsPublicKeyBase64 :: Lens' DownloadDefaultKeyPairResponse (Maybe Text)
ddkprsPublicKeyBase64 = lens _ddkprsPublicKeyBase64 (\ s a -> s{_ddkprsPublicKeyBase64 = a})
ddkprsPrivateKeyBase64 :: Lens' DownloadDefaultKeyPairResponse (Maybe Text)
ddkprsPrivateKeyBase64 = lens _ddkprsPrivateKeyBase64 (\ s a -> s{_ddkprsPrivateKeyBase64 = a})
ddkprsResponseStatus :: Lens' DownloadDefaultKeyPairResponse Int
ddkprsResponseStatus = lens _ddkprsResponseStatus (\ s a -> s{_ddkprsResponseStatus = a})
instance NFData DownloadDefaultKeyPairResponse where