module Network.AWS.AutoScaling.AttachLoadBalancerTargetGroups
(
attachLoadBalancerTargetGroups
, AttachLoadBalancerTargetGroups
, albtgAutoScalingGroupName
, albtgTargetGroupARNs
, attachLoadBalancerTargetGroupsResponse
, AttachLoadBalancerTargetGroupsResponse
, albtgrsResponseStatus
) where
import Network.AWS.AutoScaling.Types
import Network.AWS.AutoScaling.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AttachLoadBalancerTargetGroups = AttachLoadBalancerTargetGroups'
{ _albtgAutoScalingGroupName :: !Text
, _albtgTargetGroupARNs :: ![Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
attachLoadBalancerTargetGroups
:: Text
-> AttachLoadBalancerTargetGroups
attachLoadBalancerTargetGroups pAutoScalingGroupName_ =
AttachLoadBalancerTargetGroups'
{ _albtgAutoScalingGroupName = pAutoScalingGroupName_
, _albtgTargetGroupARNs = mempty
}
albtgAutoScalingGroupName :: Lens' AttachLoadBalancerTargetGroups Text
albtgAutoScalingGroupName = lens _albtgAutoScalingGroupName (\ s a -> s{_albtgAutoScalingGroupName = a});
albtgTargetGroupARNs :: Lens' AttachLoadBalancerTargetGroups [Text]
albtgTargetGroupARNs = lens _albtgTargetGroupARNs (\ s a -> s{_albtgTargetGroupARNs = a}) . _Coerce;
instance AWSRequest AttachLoadBalancerTargetGroups
where
type Rs AttachLoadBalancerTargetGroups =
AttachLoadBalancerTargetGroupsResponse
request = postQuery autoScaling
response
= receiveXMLWrapper
"AttachLoadBalancerTargetGroupsResult"
(\ s h x ->
AttachLoadBalancerTargetGroupsResponse' <$>
(pure (fromEnum s)))
instance Hashable AttachLoadBalancerTargetGroups
where
instance NFData AttachLoadBalancerTargetGroups where
instance ToHeaders AttachLoadBalancerTargetGroups
where
toHeaders = const mempty
instance ToPath AttachLoadBalancerTargetGroups where
toPath = const "/"
instance ToQuery AttachLoadBalancerTargetGroups where
toQuery AttachLoadBalancerTargetGroups'{..}
= mconcat
["Action" =:
("AttachLoadBalancerTargetGroups" :: ByteString),
"Version" =: ("2011-01-01" :: ByteString),
"AutoScalingGroupName" =: _albtgAutoScalingGroupName,
"TargetGroupARNs" =:
toQueryList "member" _albtgTargetGroupARNs]
newtype AttachLoadBalancerTargetGroupsResponse = AttachLoadBalancerTargetGroupsResponse'
{ _albtgrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
attachLoadBalancerTargetGroupsResponse
:: Int
-> AttachLoadBalancerTargetGroupsResponse
attachLoadBalancerTargetGroupsResponse pResponseStatus_ =
AttachLoadBalancerTargetGroupsResponse'
{_albtgrsResponseStatus = pResponseStatus_}
albtgrsResponseStatus :: Lens' AttachLoadBalancerTargetGroupsResponse Int
albtgrsResponseStatus = lens _albtgrsResponseStatus (\ s a -> s{_albtgrsResponseStatus = a});
instance NFData
AttachLoadBalancerTargetGroupsResponse
where