{-# 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.EMR.RemoveTags
(
removeTags
, RemoveTags
, rtResourceId
, rtTagKeys
, removeTagsResponse
, RemoveTagsResponse
, rtrsResponseStatus
) where
import Network.AWS.EMR.Types
import Network.AWS.EMR.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data RemoveTags = RemoveTags'
{ _rtResourceId :: !Text
, _rtTagKeys :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
removeTags
:: Text
-> RemoveTags
removeTags pResourceId_ =
RemoveTags' {_rtResourceId = pResourceId_, _rtTagKeys = mempty}
rtResourceId :: Lens' RemoveTags Text
rtResourceId = lens _rtResourceId (\ s a -> s{_rtResourceId = a})
rtTagKeys :: Lens' RemoveTags [Text]
rtTagKeys = lens _rtTagKeys (\ s a -> s{_rtTagKeys = a}) . _Coerce
instance AWSRequest RemoveTags where
type Rs RemoveTags = RemoveTagsResponse
request = postJSON emr
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" =#
("ElasticMapReduce.RemoveTags" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RemoveTags where
toJSON RemoveTags'{..}
= object
(catMaybes
[Just ("ResourceId" .= _rtResourceId),
Just ("TagKeys" .= _rtTagKeys)])
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