module Network.AWS.IAM.GetServerCertificate
(
GetServerCertificate
, getServerCertificate
, gscServerCertificateName
, GetServerCertificateResponse
, getServerCertificateResponse
, gscrServerCertificate
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.IAM.Types
import qualified GHC.Exts
newtype GetServerCertificate = GetServerCertificate
{ _gscServerCertificateName :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
getServerCertificate :: Text
-> GetServerCertificate
getServerCertificate p1 = GetServerCertificate
{ _gscServerCertificateName = p1
}
gscServerCertificateName :: Lens' GetServerCertificate Text
gscServerCertificateName =
lens _gscServerCertificateName
(\s a -> s { _gscServerCertificateName = a })
newtype GetServerCertificateResponse = GetServerCertificateResponse
{ _gscrServerCertificate :: ServerCertificate
} deriving (Eq, Read, Show)
getServerCertificateResponse :: ServerCertificate
-> GetServerCertificateResponse
getServerCertificateResponse p1 = GetServerCertificateResponse
{ _gscrServerCertificate = p1
}
gscrServerCertificate :: Lens' GetServerCertificateResponse ServerCertificate
gscrServerCertificate =
lens _gscrServerCertificate (\s a -> s { _gscrServerCertificate = a })
instance ToPath GetServerCertificate where
toPath = const "/"
instance ToQuery GetServerCertificate where
toQuery GetServerCertificate{..} = mconcat
[ "ServerCertificateName" =? _gscServerCertificateName
]
instance ToHeaders GetServerCertificate
instance AWSRequest GetServerCertificate where
type Sv GetServerCertificate = IAM
type Rs GetServerCertificate = GetServerCertificateResponse
request = post "GetServerCertificate"
response = xmlResponse
instance FromXML GetServerCertificateResponse where
parseXML = withElement "GetServerCertificateResult" $ \x -> GetServerCertificateResponse
<$> x .@ "ServerCertificate"