{-# 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.ModifyTargetGroup
(
modifyTargetGroup
, ModifyTargetGroup
, mtgMatcher
, mtgHealthCheckPath
, mtgUnhealthyThresholdCount
, mtgHealthCheckIntervalSeconds
, mtgHealthyThresholdCount
, mtgHealthCheckProtocol
, mtgHealthCheckTimeoutSeconds
, mtgHealthCheckPort
, mtgTargetGroupARN
, modifyTargetGroupResponse
, ModifyTargetGroupResponse
, mtgrsTargetGroups
, mtgrsResponseStatus
) 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 ModifyTargetGroup = ModifyTargetGroup'
{ _mtgMatcher :: !(Maybe Matcher)
, _mtgHealthCheckPath :: !(Maybe Text)
, _mtgUnhealthyThresholdCount :: !(Maybe Nat)
, _mtgHealthCheckIntervalSeconds :: !(Maybe Nat)
, _mtgHealthyThresholdCount :: !(Maybe Nat)
, _mtgHealthCheckProtocol :: !(Maybe ProtocolEnum)
, _mtgHealthCheckTimeoutSeconds :: !(Maybe Nat)
, _mtgHealthCheckPort :: !(Maybe Text)
, _mtgTargetGroupARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifyTargetGroup
:: Text
-> ModifyTargetGroup
modifyTargetGroup pTargetGroupARN_ =
ModifyTargetGroup'
{ _mtgMatcher = Nothing
, _mtgHealthCheckPath = Nothing
, _mtgUnhealthyThresholdCount = Nothing
, _mtgHealthCheckIntervalSeconds = Nothing
, _mtgHealthyThresholdCount = Nothing
, _mtgHealthCheckProtocol = Nothing
, _mtgHealthCheckTimeoutSeconds = Nothing
, _mtgHealthCheckPort = Nothing
, _mtgTargetGroupARN = pTargetGroupARN_
}
mtgMatcher :: Lens' ModifyTargetGroup (Maybe Matcher)
mtgMatcher = lens _mtgMatcher (\ s a -> s{_mtgMatcher = a})
mtgHealthCheckPath :: Lens' ModifyTargetGroup (Maybe Text)
mtgHealthCheckPath = lens _mtgHealthCheckPath (\ s a -> s{_mtgHealthCheckPath = a})
mtgUnhealthyThresholdCount :: Lens' ModifyTargetGroup (Maybe Natural)
mtgUnhealthyThresholdCount = lens _mtgUnhealthyThresholdCount (\ s a -> s{_mtgUnhealthyThresholdCount = a}) . mapping _Nat
mtgHealthCheckIntervalSeconds :: Lens' ModifyTargetGroup (Maybe Natural)
mtgHealthCheckIntervalSeconds = lens _mtgHealthCheckIntervalSeconds (\ s a -> s{_mtgHealthCheckIntervalSeconds = a}) . mapping _Nat
mtgHealthyThresholdCount :: Lens' ModifyTargetGroup (Maybe Natural)
mtgHealthyThresholdCount = lens _mtgHealthyThresholdCount (\ s a -> s{_mtgHealthyThresholdCount = a}) . mapping _Nat
mtgHealthCheckProtocol :: Lens' ModifyTargetGroup (Maybe ProtocolEnum)
mtgHealthCheckProtocol = lens _mtgHealthCheckProtocol (\ s a -> s{_mtgHealthCheckProtocol = a})
mtgHealthCheckTimeoutSeconds :: Lens' ModifyTargetGroup (Maybe Natural)
mtgHealthCheckTimeoutSeconds = lens _mtgHealthCheckTimeoutSeconds (\ s a -> s{_mtgHealthCheckTimeoutSeconds = a}) . mapping _Nat
mtgHealthCheckPort :: Lens' ModifyTargetGroup (Maybe Text)
mtgHealthCheckPort = lens _mtgHealthCheckPort (\ s a -> s{_mtgHealthCheckPort = a})
mtgTargetGroupARN :: Lens' ModifyTargetGroup Text
mtgTargetGroupARN = lens _mtgTargetGroupARN (\ s a -> s{_mtgTargetGroupARN = a})
instance AWSRequest ModifyTargetGroup where
type Rs ModifyTargetGroup = ModifyTargetGroupResponse
request = postQuery eLBv2
response
= receiveXMLWrapper "ModifyTargetGroupResult"
(\ s h x ->
ModifyTargetGroupResponse' <$>
(x .@? "TargetGroups" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance Hashable ModifyTargetGroup where
instance NFData ModifyTargetGroup where
instance ToHeaders ModifyTargetGroup where
toHeaders = const mempty
instance ToPath ModifyTargetGroup where
toPath = const "/"
instance ToQuery ModifyTargetGroup where
toQuery ModifyTargetGroup'{..}
= mconcat
["Action" =: ("ModifyTargetGroup" :: ByteString),
"Version" =: ("2015-12-01" :: ByteString),
"Matcher" =: _mtgMatcher,
"HealthCheckPath" =: _mtgHealthCheckPath,
"UnhealthyThresholdCount" =:
_mtgUnhealthyThresholdCount,
"HealthCheckIntervalSeconds" =:
_mtgHealthCheckIntervalSeconds,
"HealthyThresholdCount" =: _mtgHealthyThresholdCount,
"HealthCheckProtocol" =: _mtgHealthCheckProtocol,
"HealthCheckTimeoutSeconds" =:
_mtgHealthCheckTimeoutSeconds,
"HealthCheckPort" =: _mtgHealthCheckPort,
"TargetGroupArn" =: _mtgTargetGroupARN]
data ModifyTargetGroupResponse = ModifyTargetGroupResponse'
{ _mtgrsTargetGroups :: !(Maybe [TargetGroup])
, _mtgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifyTargetGroupResponse
:: Int
-> ModifyTargetGroupResponse
modifyTargetGroupResponse pResponseStatus_ =
ModifyTargetGroupResponse'
{_mtgrsTargetGroups = Nothing, _mtgrsResponseStatus = pResponseStatus_}
mtgrsTargetGroups :: Lens' ModifyTargetGroupResponse [TargetGroup]
mtgrsTargetGroups = lens _mtgrsTargetGroups (\ s a -> s{_mtgrsTargetGroups = a}) . _Default . _Coerce
mtgrsResponseStatus :: Lens' ModifyTargetGroupResponse Int
mtgrsResponseStatus = lens _mtgrsResponseStatus (\ s a -> s{_mtgrsResponseStatus = a})
instance NFData ModifyTargetGroupResponse where