{-# 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.AttachLoadBalancerToSubnets
(
attachLoadBalancerToSubnets
, AttachLoadBalancerToSubnets
, albtsLoadBalancerName
, albtsSubnets
, attachLoadBalancerToSubnetsResponse
, AttachLoadBalancerToSubnetsResponse
, albtsrsSubnets
, albtsrsResponseStatus
) 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 AttachLoadBalancerToSubnets = AttachLoadBalancerToSubnets'
{ _albtsLoadBalancerName :: !Text
, _albtsSubnets :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attachLoadBalancerToSubnets
:: Text
-> AttachLoadBalancerToSubnets
attachLoadBalancerToSubnets pLoadBalancerName_ =
AttachLoadBalancerToSubnets'
{ _albtsLoadBalancerName = pLoadBalancerName_
, _albtsSubnets = mempty
}
albtsLoadBalancerName :: Lens' AttachLoadBalancerToSubnets Text
albtsLoadBalancerName = lens _albtsLoadBalancerName (\ s a -> s{_albtsLoadBalancerName = a});
albtsSubnets :: Lens' AttachLoadBalancerToSubnets [Text]
albtsSubnets = lens _albtsSubnets (\ s a -> s{_albtsSubnets = a}) . _Coerce;
instance AWSRequest AttachLoadBalancerToSubnets where
type Rs AttachLoadBalancerToSubnets =
AttachLoadBalancerToSubnetsResponse
request = postQuery elb
response
= receiveXMLWrapper
"AttachLoadBalancerToSubnetsResult"
(\ s h x ->
AttachLoadBalancerToSubnetsResponse' <$>
(x .@? "Subnets" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable AttachLoadBalancerToSubnets
instance NFData AttachLoadBalancerToSubnets
instance ToHeaders AttachLoadBalancerToSubnets where
toHeaders = const mempty
instance ToPath AttachLoadBalancerToSubnets where
toPath = const "/"
instance ToQuery AttachLoadBalancerToSubnets where
toQuery AttachLoadBalancerToSubnets'{..}
= mconcat
["Action" =:
("AttachLoadBalancerToSubnets" :: ByteString),
"Version" =: ("2012-06-01" :: ByteString),
"LoadBalancerName" =: _albtsLoadBalancerName,
"Subnets" =: toQueryList "member" _albtsSubnets]
data AttachLoadBalancerToSubnetsResponse = AttachLoadBalancerToSubnetsResponse'
{ _albtsrsSubnets :: !(Maybe [Text])
, _albtsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attachLoadBalancerToSubnetsResponse
:: Int
-> AttachLoadBalancerToSubnetsResponse
attachLoadBalancerToSubnetsResponse pResponseStatus_ =
AttachLoadBalancerToSubnetsResponse'
{ _albtsrsSubnets = Nothing
, _albtsrsResponseStatus = pResponseStatus_
}
albtsrsSubnets :: Lens' AttachLoadBalancerToSubnetsResponse [Text]
albtsrsSubnets = lens _albtsrsSubnets (\ s a -> s{_albtsrsSubnets = a}) . _Default . _Coerce;
albtsrsResponseStatus :: Lens' AttachLoadBalancerToSubnetsResponse Int
albtsrsResponseStatus = lens _albtsrsResponseStatus (\ s a -> s{_albtsrsResponseStatus = a});
instance NFData AttachLoadBalancerToSubnetsResponse