module Network.AWS.IAM.GetServerCertificate
(
getServerCertificate
, GetServerCertificate
, gscServerCertificateName
, getServerCertificateResponse
, GetServerCertificateResponse
, gscrsStatus
, gscrsServerCertificate
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetServerCertificate = GetServerCertificate'
{ _gscServerCertificateName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getServerCertificate
:: Text
-> GetServerCertificate
getServerCertificate pServerCertificateName_ =
GetServerCertificate'
{ _gscServerCertificateName = pServerCertificateName_
}
gscServerCertificateName :: Lens' GetServerCertificate Text
gscServerCertificateName = lens _gscServerCertificateName (\ s a -> s{_gscServerCertificateName = a});
instance AWSRequest GetServerCertificate where
type Sv GetServerCertificate = IAM
type Rs GetServerCertificate =
GetServerCertificateResponse
request = postQuery
response
= receiveXMLWrapper "GetServerCertificateResult"
(\ s h x ->
GetServerCertificateResponse' <$>
(pure (fromEnum s)) <*> (x .@ "ServerCertificate"))
instance ToHeaders GetServerCertificate where
toHeaders = const mempty
instance ToPath GetServerCertificate where
toPath = const "/"
instance ToQuery GetServerCertificate where
toQuery GetServerCertificate'{..}
= mconcat
["Action" =: ("GetServerCertificate" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"ServerCertificateName" =: _gscServerCertificateName]
data GetServerCertificateResponse = GetServerCertificateResponse'
{ _gscrsStatus :: !Int
, _gscrsServerCertificate :: !ServerCertificate
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getServerCertificateResponse
:: Int
-> ServerCertificate
-> GetServerCertificateResponse
getServerCertificateResponse pStatus_ pServerCertificate_ =
GetServerCertificateResponse'
{ _gscrsStatus = pStatus_
, _gscrsServerCertificate = pServerCertificate_
}
gscrsStatus :: Lens' GetServerCertificateResponse Int
gscrsStatus = lens _gscrsStatus (\ s a -> s{_gscrsStatus = a});
gscrsServerCertificate :: Lens' GetServerCertificateResponse ServerCertificate
gscrsServerCertificate = lens _gscrsServerCertificate (\ s a -> s{_gscrsServerCertificate = a});