{-# 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.CertificateManagerPCA.DescribeCertificateAuthority
(
describeCertificateAuthority
, DescribeCertificateAuthority
, dCertificateAuthorityARN
, describeCertificateAuthorityResponse
, DescribeCertificateAuthorityResponse
, dcarsCertificateAuthority
, dcarsResponseStatus
) where
import Network.AWS.CertificateManagerPCA.Types
import Network.AWS.CertificateManagerPCA.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeCertificateAuthority = DescribeCertificateAuthority'
{ _dCertificateAuthorityARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeCertificateAuthority
:: Text
-> DescribeCertificateAuthority
describeCertificateAuthority pCertificateAuthorityARN_ =
DescribeCertificateAuthority'
{_dCertificateAuthorityARN = pCertificateAuthorityARN_}
dCertificateAuthorityARN :: Lens' DescribeCertificateAuthority Text
dCertificateAuthorityARN = lens _dCertificateAuthorityARN (\ s a -> s{_dCertificateAuthorityARN = a})
instance AWSRequest DescribeCertificateAuthority
where
type Rs DescribeCertificateAuthority =
DescribeCertificateAuthorityResponse
request = postJSON certificateManagerPCA
response
= receiveJSON
(\ s h x ->
DescribeCertificateAuthorityResponse' <$>
(x .?> "CertificateAuthority") <*>
(pure (fromEnum s)))
instance Hashable DescribeCertificateAuthority where
instance NFData DescribeCertificateAuthority where
instance ToHeaders DescribeCertificateAuthority where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("ACMPrivateCA.DescribeCertificateAuthority" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeCertificateAuthority where
toJSON DescribeCertificateAuthority'{..}
= object
(catMaybes
[Just
("CertificateAuthorityArn" .=
_dCertificateAuthorityARN)])
instance ToPath DescribeCertificateAuthority where
toPath = const "/"
instance ToQuery DescribeCertificateAuthority where
toQuery = const mempty
data DescribeCertificateAuthorityResponse = DescribeCertificateAuthorityResponse'
{ _dcarsCertificateAuthority :: !(Maybe CertificateAuthority)
, _dcarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeCertificateAuthorityResponse
:: Int
-> DescribeCertificateAuthorityResponse
describeCertificateAuthorityResponse pResponseStatus_ =
DescribeCertificateAuthorityResponse'
{ _dcarsCertificateAuthority = Nothing
, _dcarsResponseStatus = pResponseStatus_
}
dcarsCertificateAuthority :: Lens' DescribeCertificateAuthorityResponse (Maybe CertificateAuthority)
dcarsCertificateAuthority = lens _dcarsCertificateAuthority (\ s a -> s{_dcarsCertificateAuthority = a})
dcarsResponseStatus :: Lens' DescribeCertificateAuthorityResponse Int
dcarsResponseStatus = lens _dcarsResponseStatus (\ s a -> s{_dcarsResponseStatus = a})
instance NFData DescribeCertificateAuthorityResponse
where