{-# 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.CloudTrail.RemoveTags
(
removeTags
, RemoveTags
, rtTagsList
, rtResourceId
, removeTagsResponse
, RemoveTagsResponse
, rtrsResponseStatus
) where
import Network.AWS.CloudTrail.Types
import Network.AWS.CloudTrail.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data RemoveTags = RemoveTags'
{ _rtTagsList :: !(Maybe [Tag])
, _rtResourceId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
removeTags
:: Text
-> RemoveTags
removeTags pResourceId_ =
RemoveTags' {_rtTagsList = Nothing, _rtResourceId = pResourceId_}
rtTagsList :: Lens' RemoveTags [Tag]
rtTagsList = lens _rtTagsList (\ s a -> s{_rtTagsList = a}) . _Default . _Coerce
rtResourceId :: Lens' RemoveTags Text
rtResourceId = lens _rtResourceId (\ s a -> s{_rtResourceId = a})
instance AWSRequest RemoveTags where
type Rs RemoveTags = RemoveTagsResponse
request = postJSON cloudTrail
response
= receiveEmpty
(\ s h x ->
RemoveTagsResponse' <$> (pure (fromEnum s)))
instance Hashable RemoveTags where
instance NFData RemoveTags where
instance ToHeaders RemoveTags where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.RemoveTags"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RemoveTags where
toJSON RemoveTags'{..}
= object
(catMaybes
[("TagsList" .=) <$> _rtTagsList,
Just ("ResourceId" .= _rtResourceId)])
instance ToPath RemoveTags where
toPath = const "/"
instance ToQuery RemoveTags where
toQuery = const mempty
newtype RemoveTagsResponse = RemoveTagsResponse'
{ _rtrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
removeTagsResponse
:: Int
-> RemoveTagsResponse
removeTagsResponse pResponseStatus_ =
RemoveTagsResponse' {_rtrsResponseStatus = pResponseStatus_}
rtrsResponseStatus :: Lens' RemoveTagsResponse Int
rtrsResponseStatus = lens _rtrsResponseStatus (\ s a -> s{_rtrsResponseStatus = a})
instance NFData RemoveTagsResponse where