{-# 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.DescribeCertificateAuthorityAuditReport
(
describeCertificateAuthorityAuditReport
, DescribeCertificateAuthorityAuditReport
, dcaarCertificateAuthorityARN
, dcaarAuditReportId
, describeCertificateAuthorityAuditReportResponse
, DescribeCertificateAuthorityAuditReportResponse
, dcaarrsS3Key
, dcaarrsCreatedAt
, dcaarrsAuditReportStatus
, dcaarrsS3BucketName
, dcaarrsResponseStatus
) 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
data DescribeCertificateAuthorityAuditReport = DescribeCertificateAuthorityAuditReport'
{ _dcaarCertificateAuthorityARN :: !Text
, _dcaarAuditReportId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeCertificateAuthorityAuditReport
:: Text
-> Text
-> DescribeCertificateAuthorityAuditReport
describeCertificateAuthorityAuditReport pCertificateAuthorityARN_ pAuditReportId_ =
DescribeCertificateAuthorityAuditReport'
{ _dcaarCertificateAuthorityARN = pCertificateAuthorityARN_
, _dcaarAuditReportId = pAuditReportId_
}
dcaarCertificateAuthorityARN :: Lens' DescribeCertificateAuthorityAuditReport Text
dcaarCertificateAuthorityARN = lens _dcaarCertificateAuthorityARN (\ s a -> s{_dcaarCertificateAuthorityARN = a})
dcaarAuditReportId :: Lens' DescribeCertificateAuthorityAuditReport Text
dcaarAuditReportId = lens _dcaarAuditReportId (\ s a -> s{_dcaarAuditReportId = a})
instance AWSRequest
DescribeCertificateAuthorityAuditReport
where
type Rs DescribeCertificateAuthorityAuditReport =
DescribeCertificateAuthorityAuditReportResponse
request = postJSON certificateManagerPCA
response
= receiveJSON
(\ s h x ->
DescribeCertificateAuthorityAuditReportResponse' <$>
(x .?> "S3Key") <*> (x .?> "CreatedAt") <*>
(x .?> "AuditReportStatus")
<*> (x .?> "S3BucketName")
<*> (pure (fromEnum s)))
instance Hashable
DescribeCertificateAuthorityAuditReport
where
instance NFData
DescribeCertificateAuthorityAuditReport
where
instance ToHeaders
DescribeCertificateAuthorityAuditReport
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("ACMPrivateCA.DescribeCertificateAuthorityAuditReport"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON
DescribeCertificateAuthorityAuditReport
where
toJSON DescribeCertificateAuthorityAuditReport'{..}
= object
(catMaybes
[Just
("CertificateAuthorityArn" .=
_dcaarCertificateAuthorityARN),
Just ("AuditReportId" .= _dcaarAuditReportId)])
instance ToPath
DescribeCertificateAuthorityAuditReport
where
toPath = const "/"
instance ToQuery
DescribeCertificateAuthorityAuditReport
where
toQuery = const mempty
data DescribeCertificateAuthorityAuditReportResponse = DescribeCertificateAuthorityAuditReportResponse'
{ _dcaarrsS3Key :: !(Maybe Text)
, _dcaarrsCreatedAt :: !(Maybe POSIX)
, _dcaarrsAuditReportStatus :: !(Maybe AuditReportStatus)
, _dcaarrsS3BucketName :: !(Maybe Text)
, _dcaarrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeCertificateAuthorityAuditReportResponse
:: Int
-> DescribeCertificateAuthorityAuditReportResponse
describeCertificateAuthorityAuditReportResponse pResponseStatus_ =
DescribeCertificateAuthorityAuditReportResponse'
{ _dcaarrsS3Key = Nothing
, _dcaarrsCreatedAt = Nothing
, _dcaarrsAuditReportStatus = Nothing
, _dcaarrsS3BucketName = Nothing
, _dcaarrsResponseStatus = pResponseStatus_
}
dcaarrsS3Key :: Lens' DescribeCertificateAuthorityAuditReportResponse (Maybe Text)
dcaarrsS3Key = lens _dcaarrsS3Key (\ s a -> s{_dcaarrsS3Key = a})
dcaarrsCreatedAt :: Lens' DescribeCertificateAuthorityAuditReportResponse (Maybe UTCTime)
dcaarrsCreatedAt = lens _dcaarrsCreatedAt (\ s a -> s{_dcaarrsCreatedAt = a}) . mapping _Time
dcaarrsAuditReportStatus :: Lens' DescribeCertificateAuthorityAuditReportResponse (Maybe AuditReportStatus)
dcaarrsAuditReportStatus = lens _dcaarrsAuditReportStatus (\ s a -> s{_dcaarrsAuditReportStatus = a})
dcaarrsS3BucketName :: Lens' DescribeCertificateAuthorityAuditReportResponse (Maybe Text)
dcaarrsS3BucketName = lens _dcaarrsS3BucketName (\ s a -> s{_dcaarrsS3BucketName = a})
dcaarrsResponseStatus :: Lens' DescribeCertificateAuthorityAuditReportResponse Int
dcaarrsResponseStatus = lens _dcaarrsResponseStatus (\ s a -> s{_dcaarrsResponseStatus = a})
instance NFData
DescribeCertificateAuthorityAuditReportResponse
where