{-# 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.CreateCertificateAuthorityAuditReport
(
createCertificateAuthorityAuditReport
, CreateCertificateAuthorityAuditReport
, ccaarCertificateAuthorityARN
, ccaarS3BucketName
, ccaarAuditReportResponseFormat
, createCertificateAuthorityAuditReportResponse
, CreateCertificateAuthorityAuditReportResponse
, ccaarrsS3Key
, ccaarrsAuditReportId
, ccaarrsResponseStatus
) 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 CreateCertificateAuthorityAuditReport = CreateCertificateAuthorityAuditReport'
{ _ccaarCertificateAuthorityARN :: !Text
, _ccaarS3BucketName :: !Text
, _ccaarAuditReportResponseFormat :: !AuditReportResponseFormat
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createCertificateAuthorityAuditReport
:: Text
-> Text
-> AuditReportResponseFormat
-> CreateCertificateAuthorityAuditReport
createCertificateAuthorityAuditReport pCertificateAuthorityARN_ pS3BucketName_ pAuditReportResponseFormat_ =
CreateCertificateAuthorityAuditReport'
{ _ccaarCertificateAuthorityARN = pCertificateAuthorityARN_
, _ccaarS3BucketName = pS3BucketName_
, _ccaarAuditReportResponseFormat = pAuditReportResponseFormat_
}
ccaarCertificateAuthorityARN :: Lens' CreateCertificateAuthorityAuditReport Text
ccaarCertificateAuthorityARN = lens _ccaarCertificateAuthorityARN (\ s a -> s{_ccaarCertificateAuthorityARN = a})
ccaarS3BucketName :: Lens' CreateCertificateAuthorityAuditReport Text
ccaarS3BucketName = lens _ccaarS3BucketName (\ s a -> s{_ccaarS3BucketName = a})
ccaarAuditReportResponseFormat :: Lens' CreateCertificateAuthorityAuditReport AuditReportResponseFormat
ccaarAuditReportResponseFormat = lens _ccaarAuditReportResponseFormat (\ s a -> s{_ccaarAuditReportResponseFormat = a})
instance AWSRequest
CreateCertificateAuthorityAuditReport
where
type Rs CreateCertificateAuthorityAuditReport =
CreateCertificateAuthorityAuditReportResponse
request = postJSON certificateManagerPCA
response
= receiveJSON
(\ s h x ->
CreateCertificateAuthorityAuditReportResponse' <$>
(x .?> "S3Key") <*> (x .?> "AuditReportId") <*>
(pure (fromEnum s)))
instance Hashable
CreateCertificateAuthorityAuditReport
where
instance NFData CreateCertificateAuthorityAuditReport
where
instance ToHeaders
CreateCertificateAuthorityAuditReport
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("ACMPrivateCA.CreateCertificateAuthorityAuditReport"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateCertificateAuthorityAuditReport
where
toJSON CreateCertificateAuthorityAuditReport'{..}
= object
(catMaybes
[Just
("CertificateAuthorityArn" .=
_ccaarCertificateAuthorityARN),
Just ("S3BucketName" .= _ccaarS3BucketName),
Just
("AuditReportResponseFormat" .=
_ccaarAuditReportResponseFormat)])
instance ToPath CreateCertificateAuthorityAuditReport
where
toPath = const "/"
instance ToQuery
CreateCertificateAuthorityAuditReport
where
toQuery = const mempty
data CreateCertificateAuthorityAuditReportResponse = CreateCertificateAuthorityAuditReportResponse'
{ _ccaarrsS3Key :: !(Maybe Text)
, _ccaarrsAuditReportId :: !(Maybe Text)
, _ccaarrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createCertificateAuthorityAuditReportResponse
:: Int
-> CreateCertificateAuthorityAuditReportResponse
createCertificateAuthorityAuditReportResponse pResponseStatus_ =
CreateCertificateAuthorityAuditReportResponse'
{ _ccaarrsS3Key = Nothing
, _ccaarrsAuditReportId = Nothing
, _ccaarrsResponseStatus = pResponseStatus_
}
ccaarrsS3Key :: Lens' CreateCertificateAuthorityAuditReportResponse (Maybe Text)
ccaarrsS3Key = lens _ccaarrsS3Key (\ s a -> s{_ccaarrsS3Key = a})
ccaarrsAuditReportId :: Lens' CreateCertificateAuthorityAuditReportResponse (Maybe Text)
ccaarrsAuditReportId = lens _ccaarrsAuditReportId (\ s a -> s{_ccaarrsAuditReportId = a})
ccaarrsResponseStatus :: Lens' CreateCertificateAuthorityAuditReportResponse Int
ccaarrsResponseStatus = lens _ccaarrsResponseStatus (\ s a -> s{_ccaarrsResponseStatus = a})
instance NFData
CreateCertificateAuthorityAuditReportResponse
where