{-# 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.CertificateManager.ListTagsForCertificate
(
listTagsForCertificate
, ListTagsForCertificate
, ltfcCertificateARN
, listTagsForCertificateResponse
, ListTagsForCertificateResponse
, ltfcrsTags
, ltfcrsResponseStatus
) where
import Network.AWS.CertificateManager.Types
import Network.AWS.CertificateManager.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ListTagsForCertificate = ListTagsForCertificate'
{ _ltfcCertificateARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listTagsForCertificate
:: Text
-> ListTagsForCertificate
listTagsForCertificate pCertificateARN_ =
ListTagsForCertificate' {_ltfcCertificateARN = pCertificateARN_}
ltfcCertificateARN :: Lens' ListTagsForCertificate Text
ltfcCertificateARN = lens _ltfcCertificateARN (\ s a -> s{_ltfcCertificateARN = a})
instance AWSRequest ListTagsForCertificate where
type Rs ListTagsForCertificate =
ListTagsForCertificateResponse
request = postJSON certificateManager
response
= receiveJSON
(\ s h x ->
ListTagsForCertificateResponse' <$>
(x .?> "Tags") <*> (pure (fromEnum s)))
instance Hashable ListTagsForCertificate where
instance NFData ListTagsForCertificate where
instance ToHeaders ListTagsForCertificate where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CertificateManager.ListTagsForCertificate" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListTagsForCertificate where
toJSON ListTagsForCertificate'{..}
= object
(catMaybes
[Just ("CertificateArn" .= _ltfcCertificateARN)])
instance ToPath ListTagsForCertificate where
toPath = const "/"
instance ToQuery ListTagsForCertificate where
toQuery = const mempty
data ListTagsForCertificateResponse = ListTagsForCertificateResponse'
{ _ltfcrsTags :: !(Maybe (List1 Tag))
, _ltfcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listTagsForCertificateResponse
:: Int
-> ListTagsForCertificateResponse
listTagsForCertificateResponse pResponseStatus_ =
ListTagsForCertificateResponse'
{_ltfcrsTags = Nothing, _ltfcrsResponseStatus = pResponseStatus_}
ltfcrsTags :: Lens' ListTagsForCertificateResponse (Maybe (NonEmpty Tag))
ltfcrsTags = lens _ltfcrsTags (\ s a -> s{_ltfcrsTags = a}) . mapping _List1
ltfcrsResponseStatus :: Lens' ListTagsForCertificateResponse Int
ltfcrsResponseStatus = lens _ltfcrsResponseStatus (\ s a -> s{_ltfcrsResponseStatus = a})
instance NFData ListTagsForCertificateResponse where