module Network.AWS.CloudWatchLogs.TagLogGroup
(
tagLogGroup
, TagLogGroup
, tlgLogGroupName
, tlgTags
, tagLogGroupResponse
, TagLogGroupResponse
) where
import Network.AWS.CloudWatchLogs.Types
import Network.AWS.CloudWatchLogs.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data TagLogGroup = TagLogGroup'
{ _tlgLogGroupName :: !Text
, _tlgTags :: !(Map Text Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
tagLogGroup
:: Text
-> TagLogGroup
tagLogGroup pLogGroupName_ =
TagLogGroup' {_tlgLogGroupName = pLogGroupName_, _tlgTags = mempty}
tlgLogGroupName :: Lens' TagLogGroup Text
tlgLogGroupName = lens _tlgLogGroupName (\ s a -> s{_tlgLogGroupName = a});
tlgTags :: Lens' TagLogGroup (HashMap Text Text)
tlgTags = lens _tlgTags (\ s a -> s{_tlgTags = a}) . _Map;
instance AWSRequest TagLogGroup where
type Rs TagLogGroup = TagLogGroupResponse
request = postJSON cloudWatchLogs
response = receiveNull TagLogGroupResponse'
instance Hashable TagLogGroup where
instance NFData TagLogGroup where
instance ToHeaders TagLogGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Logs_20140328.TagLogGroup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON TagLogGroup where
toJSON TagLogGroup'{..}
= object
(catMaybes
[Just ("logGroupName" .= _tlgLogGroupName),
Just ("tags" .= _tlgTags)])
instance ToPath TagLogGroup where
toPath = const "/"
instance ToQuery TagLogGroup where
toQuery = const mempty
data TagLogGroupResponse =
TagLogGroupResponse'
deriving (Eq, Read, Show, Data, Typeable, Generic)
tagLogGroupResponse
:: TagLogGroupResponse
tagLogGroupResponse = TagLogGroupResponse'
instance NFData TagLogGroupResponse where