{-# 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.CreateLoadBalancerPolicy
(
createLoadBalancerPolicy
, CreateLoadBalancerPolicy
, clbpPolicyAttributes
, clbpLoadBalancerName
, clbpPolicyName
, clbpPolicyTypeName
, createLoadBalancerPolicyResponse
, CreateLoadBalancerPolicyResponse
, clbprsResponseStatus
) 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 CreateLoadBalancerPolicy = CreateLoadBalancerPolicy'
{ _clbpPolicyAttributes :: !(Maybe [PolicyAttribute])
, _clbpLoadBalancerName :: !Text
, _clbpPolicyName :: !Text
, _clbpPolicyTypeName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createLoadBalancerPolicy
:: Text
-> Text
-> Text
-> CreateLoadBalancerPolicy
createLoadBalancerPolicy pLoadBalancerName_ pPolicyName_ pPolicyTypeName_ =
CreateLoadBalancerPolicy'
{ _clbpPolicyAttributes = Nothing
, _clbpLoadBalancerName = pLoadBalancerName_
, _clbpPolicyName = pPolicyName_
, _clbpPolicyTypeName = pPolicyTypeName_
}
clbpPolicyAttributes :: Lens' CreateLoadBalancerPolicy [PolicyAttribute]
clbpPolicyAttributes = lens _clbpPolicyAttributes (\ s a -> s{_clbpPolicyAttributes = a}) . _Default . _Coerce;
clbpLoadBalancerName :: Lens' CreateLoadBalancerPolicy Text
clbpLoadBalancerName = lens _clbpLoadBalancerName (\ s a -> s{_clbpLoadBalancerName = a});
clbpPolicyName :: Lens' CreateLoadBalancerPolicy Text
clbpPolicyName = lens _clbpPolicyName (\ s a -> s{_clbpPolicyName = a});
clbpPolicyTypeName :: Lens' CreateLoadBalancerPolicy Text
clbpPolicyTypeName = lens _clbpPolicyTypeName (\ s a -> s{_clbpPolicyTypeName = a});
instance AWSRequest CreateLoadBalancerPolicy where
type Rs CreateLoadBalancerPolicy =
CreateLoadBalancerPolicyResponse
request = postQuery elb
response
= receiveXMLWrapper "CreateLoadBalancerPolicyResult"
(\ s h x ->
CreateLoadBalancerPolicyResponse' <$>
(pure (fromEnum s)))
instance Hashable CreateLoadBalancerPolicy
instance NFData CreateLoadBalancerPolicy
instance ToHeaders CreateLoadBalancerPolicy where
toHeaders = const mempty
instance ToPath CreateLoadBalancerPolicy where
toPath = const "/"
instance ToQuery CreateLoadBalancerPolicy where
toQuery CreateLoadBalancerPolicy'{..}
= mconcat
["Action" =:
("CreateLoadBalancerPolicy" :: ByteString),
"Version" =: ("2012-06-01" :: ByteString),
"PolicyAttributes" =:
toQuery
(toQueryList "member" <$> _clbpPolicyAttributes),
"LoadBalancerName" =: _clbpLoadBalancerName,
"PolicyName" =: _clbpPolicyName,
"PolicyTypeName" =: _clbpPolicyTypeName]
newtype CreateLoadBalancerPolicyResponse = CreateLoadBalancerPolicyResponse'
{ _clbprsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createLoadBalancerPolicyResponse
:: Int
-> CreateLoadBalancerPolicyResponse
createLoadBalancerPolicyResponse pResponseStatus_ =
CreateLoadBalancerPolicyResponse'
{ _clbprsResponseStatus = pResponseStatus_
}
clbprsResponseStatus :: Lens' CreateLoadBalancerPolicyResponse Int
clbprsResponseStatus = lens _clbprsResponseStatus (\ s a -> s{_clbprsResponseStatus = a});
instance NFData CreateLoadBalancerPolicyResponse