{-# 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.ELB.AddTags
(
addTags
, AddTags
, atLoadBalancerNames
, atTags
, addTagsResponse
, AddTagsResponse
, atrsResponseStatus
) where
import Network.AWS.ELB.Types
import Network.AWS.ELB.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AddTags = AddTags'
{ _atLoadBalancerNames :: ![Text]
, _atTags :: !(List1 Tag)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addTags
:: NonEmpty Tag
-> AddTags
addTags pTags_ =
AddTags' {_atLoadBalancerNames = mempty, _atTags = _List1 # pTags_}
atLoadBalancerNames :: Lens' AddTags [Text]
atLoadBalancerNames = lens _atLoadBalancerNames (\ s a -> s{_atLoadBalancerNames = a}) . _Coerce
atTags :: Lens' AddTags (NonEmpty Tag)
atTags = lens _atTags (\ s a -> s{_atTags = a}) . _List1
instance AWSRequest AddTags where
type Rs AddTags = AddTagsResponse
request = postQuery elb
response
= receiveXMLWrapper "AddTagsResult"
(\ s h x -> AddTagsResponse' <$> (pure (fromEnum s)))
instance Hashable AddTags where
instance NFData AddTags where
instance ToHeaders AddTags where
toHeaders = const mempty
instance ToPath AddTags where
toPath = const "/"
instance ToQuery AddTags where
toQuery AddTags'{..}
= mconcat
["Action" =: ("AddTags" :: ByteString),
"Version" =: ("2012-06-01" :: ByteString),
"LoadBalancerNames" =:
toQueryList "member" _atLoadBalancerNames,
"Tags" =: toQueryList "member" _atTags]
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