{-# 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.ELBv2.ModifyTargetGroupAttributes
(
modifyTargetGroupAttributes
, ModifyTargetGroupAttributes
, mtgaTargetGroupARN
, mtgaAttributes
, modifyTargetGroupAttributesResponse
, ModifyTargetGroupAttributesResponse
, mtgarsAttributes
, mtgarsResponseStatus
) where
import Network.AWS.ELBv2.Types
import Network.AWS.ELBv2.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ModifyTargetGroupAttributes = ModifyTargetGroupAttributes'
{ _mtgaTargetGroupARN :: !Text
, _mtgaAttributes :: ![TargetGroupAttribute]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifyTargetGroupAttributes
:: Text
-> ModifyTargetGroupAttributes
modifyTargetGroupAttributes pTargetGroupARN_ =
ModifyTargetGroupAttributes'
{_mtgaTargetGroupARN = pTargetGroupARN_, _mtgaAttributes = mempty}
mtgaTargetGroupARN :: Lens' ModifyTargetGroupAttributes Text
mtgaTargetGroupARN = lens _mtgaTargetGroupARN (\ s a -> s{_mtgaTargetGroupARN = a})
mtgaAttributes :: Lens' ModifyTargetGroupAttributes [TargetGroupAttribute]
mtgaAttributes = lens _mtgaAttributes (\ s a -> s{_mtgaAttributes = a}) . _Coerce
instance AWSRequest ModifyTargetGroupAttributes where
type Rs ModifyTargetGroupAttributes =
ModifyTargetGroupAttributesResponse
request = postQuery eLBv2
response
= receiveXMLWrapper
"ModifyTargetGroupAttributesResult"
(\ s h x ->
ModifyTargetGroupAttributesResponse' <$>
(x .@? "Attributes" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable ModifyTargetGroupAttributes where
instance NFData ModifyTargetGroupAttributes where
instance ToHeaders ModifyTargetGroupAttributes where
toHeaders = const mempty
instance ToPath ModifyTargetGroupAttributes where
toPath = const "/"
instance ToQuery ModifyTargetGroupAttributes where
toQuery ModifyTargetGroupAttributes'{..}
= mconcat
["Action" =:
("ModifyTargetGroupAttributes" :: ByteString),
"Version" =: ("2015-12-01" :: ByteString),
"TargetGroupArn" =: _mtgaTargetGroupARN,
"Attributes" =: toQueryList "member" _mtgaAttributes]
data ModifyTargetGroupAttributesResponse = ModifyTargetGroupAttributesResponse'
{ _mtgarsAttributes :: !(Maybe [TargetGroupAttribute])
, _mtgarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifyTargetGroupAttributesResponse
:: Int
-> ModifyTargetGroupAttributesResponse
modifyTargetGroupAttributesResponse pResponseStatus_ =
ModifyTargetGroupAttributesResponse'
{_mtgarsAttributes = Nothing, _mtgarsResponseStatus = pResponseStatus_}
mtgarsAttributes :: Lens' ModifyTargetGroupAttributesResponse [TargetGroupAttribute]
mtgarsAttributes = lens _mtgarsAttributes (\ s a -> s{_mtgarsAttributes = a}) . _Default . _Coerce
mtgarsResponseStatus :: Lens' ModifyTargetGroupAttributesResponse Int
mtgarsResponseStatus = lens _mtgarsResponseStatus (\ s a -> s{_mtgarsResponseStatus = a})
instance NFData ModifyTargetGroupAttributesResponse
where