{-# 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.TagCertificateAuthority
(
tagCertificateAuthority
, TagCertificateAuthority
, tcaCertificateAuthorityARN
, tcaTags
, tagCertificateAuthorityResponse
, TagCertificateAuthorityResponse
) 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 TagCertificateAuthority = TagCertificateAuthority'
{ _tcaCertificateAuthorityARN :: !Text
, _tcaTags :: !(List1 Tag)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
tagCertificateAuthority
:: Text
-> NonEmpty Tag
-> TagCertificateAuthority
tagCertificateAuthority pCertificateAuthorityARN_ pTags_ =
TagCertificateAuthority'
{ _tcaCertificateAuthorityARN = pCertificateAuthorityARN_
, _tcaTags = _List1 # pTags_
}
tcaCertificateAuthorityARN :: Lens' TagCertificateAuthority Text
tcaCertificateAuthorityARN = lens _tcaCertificateAuthorityARN (\ s a -> s{_tcaCertificateAuthorityARN = a})
tcaTags :: Lens' TagCertificateAuthority (NonEmpty Tag)
tcaTags = lens _tcaTags (\ s a -> s{_tcaTags = a}) . _List1
instance AWSRequest TagCertificateAuthority where
type Rs TagCertificateAuthority =
TagCertificateAuthorityResponse
request = postJSON certificateManagerPCA
response
= receiveNull TagCertificateAuthorityResponse'
instance Hashable TagCertificateAuthority where
instance NFData TagCertificateAuthority where
instance ToHeaders TagCertificateAuthority where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("ACMPrivateCA.TagCertificateAuthority" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON TagCertificateAuthority where
toJSON TagCertificateAuthority'{..}
= object
(catMaybes
[Just
("CertificateAuthorityArn" .=
_tcaCertificateAuthorityARN),
Just ("Tags" .= _tcaTags)])
instance ToPath TagCertificateAuthority where
toPath = const "/"
instance ToQuery TagCertificateAuthority where
toQuery = const mempty
data TagCertificateAuthorityResponse =
TagCertificateAuthorityResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
tagCertificateAuthorityResponse
:: TagCertificateAuthorityResponse
tagCertificateAuthorityResponse = TagCertificateAuthorityResponse'
instance NFData TagCertificateAuthorityResponse where