{-# 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.DescribeTargetGroupAttributes
(
describeTargetGroupAttributes
, DescribeTargetGroupAttributes
, dtgaTargetGroupARN
, describeTargetGroupAttributesResponse
, DescribeTargetGroupAttributesResponse
, dtgarsAttributes
, dtgarsResponseStatus
) 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
newtype DescribeTargetGroupAttributes = DescribeTargetGroupAttributes'
{ _dtgaTargetGroupARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeTargetGroupAttributes
:: Text
-> DescribeTargetGroupAttributes
describeTargetGroupAttributes pTargetGroupARN_ =
DescribeTargetGroupAttributes'
{ _dtgaTargetGroupARN = pTargetGroupARN_
}
dtgaTargetGroupARN :: Lens' DescribeTargetGroupAttributes Text
dtgaTargetGroupARN = lens _dtgaTargetGroupARN (\ s a -> s{_dtgaTargetGroupARN = a});
instance AWSRequest DescribeTargetGroupAttributes
where
type Rs DescribeTargetGroupAttributes =
DescribeTargetGroupAttributesResponse
request = postQuery eLBv2
response
= receiveXMLWrapper
"DescribeTargetGroupAttributesResult"
(\ s h x ->
DescribeTargetGroupAttributesResponse' <$>
(x .@? "Attributes" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable DescribeTargetGroupAttributes
instance NFData DescribeTargetGroupAttributes
instance ToHeaders DescribeTargetGroupAttributes
where
toHeaders = const mempty
instance ToPath DescribeTargetGroupAttributes where
toPath = const "/"
instance ToQuery DescribeTargetGroupAttributes where
toQuery DescribeTargetGroupAttributes'{..}
= mconcat
["Action" =:
("DescribeTargetGroupAttributes" :: ByteString),
"Version" =: ("2015-12-01" :: ByteString),
"TargetGroupArn" =: _dtgaTargetGroupARN]
data DescribeTargetGroupAttributesResponse = DescribeTargetGroupAttributesResponse'
{ _dtgarsAttributes :: !(Maybe [TargetGroupAttribute])
, _dtgarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeTargetGroupAttributesResponse
:: Int
-> DescribeTargetGroupAttributesResponse
describeTargetGroupAttributesResponse pResponseStatus_ =
DescribeTargetGroupAttributesResponse'
{ _dtgarsAttributes = Nothing
, _dtgarsResponseStatus = pResponseStatus_
}
dtgarsAttributes :: Lens' DescribeTargetGroupAttributesResponse [TargetGroupAttribute]
dtgarsAttributes = lens _dtgarsAttributes (\ s a -> s{_dtgarsAttributes = a}) . _Default . _Coerce;
dtgarsResponseStatus :: Lens' DescribeTargetGroupAttributesResponse Int
dtgarsResponseStatus = lens _dtgarsResponseStatus (\ s a -> s{_dtgarsResponseStatus = a});
instance NFData DescribeTargetGroupAttributesResponse