module Network.AWS.Inspector.SetTagsForResource
(
setTagsForResource
, SetTagsForResource
, stfrTags
, stfrResourceARN
, setTagsForResourceResponse
, SetTagsForResourceResponse
) where
import Network.AWS.Inspector.Types
import Network.AWS.Inspector.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data SetTagsForResource = SetTagsForResource'
{ _stfrTags :: !(Maybe [Tag])
, _stfrResourceARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
setTagsForResource
:: Text
-> SetTagsForResource
setTagsForResource pResourceARN_ =
SetTagsForResource' {_stfrTags = Nothing, _stfrResourceARN = pResourceARN_}
stfrTags :: Lens' SetTagsForResource [Tag]
stfrTags = lens _stfrTags (\ s a -> s{_stfrTags = a}) . _Default . _Coerce;
stfrResourceARN :: Lens' SetTagsForResource Text
stfrResourceARN = lens _stfrResourceARN (\ s a -> s{_stfrResourceARN = a});
instance AWSRequest SetTagsForResource where
type Rs SetTagsForResource =
SetTagsForResourceResponse
request = postJSON inspector
response = receiveNull SetTagsForResourceResponse'
instance Hashable SetTagsForResource where
instance NFData SetTagsForResource where
instance ToHeaders SetTagsForResource where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.SetTagsForResource" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON SetTagsForResource where
toJSON SetTagsForResource'{..}
= object
(catMaybes
[("tags" .=) <$> _stfrTags,
Just ("resourceArn" .= _stfrResourceARN)])
instance ToPath SetTagsForResource where
toPath = const "/"
instance ToQuery SetTagsForResource where
toQuery = const mempty
data SetTagsForResourceResponse =
SetTagsForResourceResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
setTagsForResourceResponse
:: SetTagsForResourceResponse
setTagsForResourceResponse = SetTagsForResourceResponse'
instance NFData SetTagsForResourceResponse where