{-# 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.DataPipeline.AddTags
(
addTags
, AddTags
, atPipelineId
, atTags
, addTagsResponse
, AddTagsResponse
, atrsResponseStatus
) where
import Network.AWS.DataPipeline.Types
import Network.AWS.DataPipeline.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AddTags = AddTags'
{ _atPipelineId :: !Text
, _atTags :: ![Tag]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addTags
:: Text
-> AddTags
addTags pPipelineId_ = AddTags' {_atPipelineId = pPipelineId_, _atTags = mempty}
atPipelineId :: Lens' AddTags Text
atPipelineId = lens _atPipelineId (\ s a -> s{_atPipelineId = a})
atTags :: Lens' AddTags [Tag]
atTags = lens _atTags (\ s a -> s{_atTags = a}) . _Coerce
instance AWSRequest AddTags where
type Rs AddTags = AddTagsResponse
request = postJSON dataPipeline
response
= receiveEmpty
(\ s h x -> AddTagsResponse' <$> (pure (fromEnum s)))
instance Hashable AddTags where
instance NFData AddTags where
instance ToHeaders AddTags where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("DataPipeline.AddTags" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AddTags where
toJSON AddTags'{..}
= object
(catMaybes
[Just ("pipelineId" .= _atPipelineId),
Just ("tags" .= _atTags)])
instance ToPath AddTags where
toPath = const "/"
instance ToQuery AddTags where
toQuery = const mempty
newtype AddTagsResponse = AddTagsResponse'
{ _atrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addTagsResponse
:: Int
-> AddTagsResponse
addTagsResponse pResponseStatus_ =
AddTagsResponse' {_atrsResponseStatus = pResponseStatus_}
atrsResponseStatus :: Lens' AddTagsResponse Int
atrsResponseStatus = lens _atrsResponseStatus (\ s a -> s{_atrsResponseStatus = a})
instance NFData AddTagsResponse where