module Network.AWS.IAM.GetServerCertificate
(
getServerCertificate
, GetServerCertificate
, gscServerCertificateName
, getServerCertificateResponse
, GetServerCertificateResponse
, gscrsResponseStatus
, gscrsServerCertificate
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Lens
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 Rs GetServerCertificate =
GetServerCertificateResponse
request = postQuery iam
response
= receiveXMLWrapper "GetServerCertificateResult"
(\ s h x ->
GetServerCertificateResponse' <$>
(pure (fromEnum s)) <*> (x .@ "ServerCertificate"))
instance Hashable GetServerCertificate
instance NFData GetServerCertificate
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'
{ _gscrsResponseStatus :: !Int
, _gscrsServerCertificate :: !ServerCertificate
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getServerCertificateResponse
:: Int
-> ServerCertificate
-> GetServerCertificateResponse
getServerCertificateResponse pResponseStatus_ pServerCertificate_ =
GetServerCertificateResponse'
{ _gscrsResponseStatus = pResponseStatus_
, _gscrsServerCertificate = pServerCertificate_
}
gscrsResponseStatus :: Lens' GetServerCertificateResponse Int
gscrsResponseStatus = lens _gscrsResponseStatus (\ s a -> s{_gscrsResponseStatus = a});
gscrsServerCertificate :: Lens' GetServerCertificateResponse ServerCertificate
gscrsServerCertificate = lens _gscrsServerCertificate (\ s a -> s{_gscrsServerCertificate = a});
instance NFData GetServerCertificateResponse