{-# 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.GetCertificateAuthorityCSR
(
getCertificateAuthorityCSR
, GetCertificateAuthorityCSR
, gcacsrCertificateAuthorityARN
, getCertificateAuthorityCSRResponse
, GetCertificateAuthorityCSRResponse
, gcacsrrsCSR
, gcacsrrsResponseStatus
) 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 GetCertificateAuthorityCSR = GetCertificateAuthorityCSR'
{ _gcacsrCertificateAuthorityARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getCertificateAuthorityCSR
:: Text
-> GetCertificateAuthorityCSR
getCertificateAuthorityCSR pCertificateAuthorityARN_ =
GetCertificateAuthorityCSR'
{_gcacsrCertificateAuthorityARN = pCertificateAuthorityARN_}
gcacsrCertificateAuthorityARN :: Lens' GetCertificateAuthorityCSR Text
gcacsrCertificateAuthorityARN = lens _gcacsrCertificateAuthorityARN (\ s a -> s{_gcacsrCertificateAuthorityARN = a})
instance AWSRequest GetCertificateAuthorityCSR where
type Rs GetCertificateAuthorityCSR =
GetCertificateAuthorityCSRResponse
request = postJSON certificateManagerPCA
response
= receiveJSON
(\ s h x ->
GetCertificateAuthorityCSRResponse' <$>
(x .?> "Csr") <*> (pure (fromEnum s)))
instance Hashable GetCertificateAuthorityCSR where
instance NFData GetCertificateAuthorityCSR where
instance ToHeaders GetCertificateAuthorityCSR where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("ACMPrivateCA.GetCertificateAuthorityCsr" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetCertificateAuthorityCSR where
toJSON GetCertificateAuthorityCSR'{..}
= object
(catMaybes
[Just
("CertificateAuthorityArn" .=
_gcacsrCertificateAuthorityARN)])
instance ToPath GetCertificateAuthorityCSR where
toPath = const "/"
instance ToQuery GetCertificateAuthorityCSR where
toQuery = const mempty
data GetCertificateAuthorityCSRResponse = GetCertificateAuthorityCSRResponse'
{ _gcacsrrsCSR :: !(Maybe Text)
, _gcacsrrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getCertificateAuthorityCSRResponse
:: Int
-> GetCertificateAuthorityCSRResponse
getCertificateAuthorityCSRResponse pResponseStatus_ =
GetCertificateAuthorityCSRResponse'
{_gcacsrrsCSR = Nothing, _gcacsrrsResponseStatus = pResponseStatus_}
gcacsrrsCSR :: Lens' GetCertificateAuthorityCSRResponse (Maybe Text)
gcacsrrsCSR = lens _gcacsrrsCSR (\ s a -> s{_gcacsrrsCSR = a})
gcacsrrsResponseStatus :: Lens' GetCertificateAuthorityCSRResponse Int
gcacsrrsResponseStatus = lens _gcacsrrsResponseStatus (\ s a -> s{_gcacsrrsResponseStatus = a})
instance NFData GetCertificateAuthorityCSRResponse
where