{-# 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.CodeDeploy.UpdateDeploymentGroup
(
updateDeploymentGroup
, UpdateDeploymentGroup
, udgServiceRoleARN
, udgEc2TagSet
, udgDeploymentConfigName
, udgOnPremisesTagSet
, udgNewDeploymentGroupName
, udgEc2TagFilters
, udgBlueGreenDeploymentConfiguration
, udgLoadBalancerInfo
, udgOnPremisesInstanceTagFilters
, udgAlarmConfiguration
, udgTriggerConfigurations
, udgAutoScalingGroups
, udgDeploymentStyle
, udgAutoRollbackConfiguration
, udgApplicationName
, udgCurrentDeploymentGroupName
, updateDeploymentGroupResponse
, UpdateDeploymentGroupResponse
, udgrsHooksNotCleanedUp
, udgrsResponseStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateDeploymentGroup = UpdateDeploymentGroup'
{ _udgServiceRoleARN :: !(Maybe Text)
, _udgEc2TagSet :: !(Maybe EC2TagSet)
, _udgDeploymentConfigName :: !(Maybe Text)
, _udgOnPremisesTagSet :: !(Maybe OnPremisesTagSet)
, _udgNewDeploymentGroupName :: !(Maybe Text)
, _udgEc2TagFilters :: !(Maybe [EC2TagFilter])
, _udgBlueGreenDeploymentConfiguration :: !(Maybe BlueGreenDeploymentConfiguration)
, _udgLoadBalancerInfo :: !(Maybe LoadBalancerInfo)
, _udgOnPremisesInstanceTagFilters :: !(Maybe [TagFilter])
, _udgAlarmConfiguration :: !(Maybe AlarmConfiguration)
, _udgTriggerConfigurations :: !(Maybe [TriggerConfig])
, _udgAutoScalingGroups :: !(Maybe [Text])
, _udgDeploymentStyle :: !(Maybe DeploymentStyle)
, _udgAutoRollbackConfiguration :: !(Maybe AutoRollbackConfiguration)
, _udgApplicationName :: !Text
, _udgCurrentDeploymentGroupName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateDeploymentGroup
:: Text
-> Text
-> UpdateDeploymentGroup
updateDeploymentGroup pApplicationName_ pCurrentDeploymentGroupName_ =
UpdateDeploymentGroup'
{ _udgServiceRoleARN = Nothing
, _udgEc2TagSet = Nothing
, _udgDeploymentConfigName = Nothing
, _udgOnPremisesTagSet = Nothing
, _udgNewDeploymentGroupName = Nothing
, _udgEc2TagFilters = Nothing
, _udgBlueGreenDeploymentConfiguration = Nothing
, _udgLoadBalancerInfo = Nothing
, _udgOnPremisesInstanceTagFilters = Nothing
, _udgAlarmConfiguration = Nothing
, _udgTriggerConfigurations = Nothing
, _udgAutoScalingGroups = Nothing
, _udgDeploymentStyle = Nothing
, _udgAutoRollbackConfiguration = Nothing
, _udgApplicationName = pApplicationName_
, _udgCurrentDeploymentGroupName = pCurrentDeploymentGroupName_
}
udgServiceRoleARN :: Lens' UpdateDeploymentGroup (Maybe Text)
udgServiceRoleARN = lens _udgServiceRoleARN (\ s a -> s{_udgServiceRoleARN = a})
udgEc2TagSet :: Lens' UpdateDeploymentGroup (Maybe EC2TagSet)
udgEc2TagSet = lens _udgEc2TagSet (\ s a -> s{_udgEc2TagSet = a})
udgDeploymentConfigName :: Lens' UpdateDeploymentGroup (Maybe Text)
udgDeploymentConfigName = lens _udgDeploymentConfigName (\ s a -> s{_udgDeploymentConfigName = a})
udgOnPremisesTagSet :: Lens' UpdateDeploymentGroup (Maybe OnPremisesTagSet)
udgOnPremisesTagSet = lens _udgOnPremisesTagSet (\ s a -> s{_udgOnPremisesTagSet = a})
udgNewDeploymentGroupName :: Lens' UpdateDeploymentGroup (Maybe Text)
udgNewDeploymentGroupName = lens _udgNewDeploymentGroupName (\ s a -> s{_udgNewDeploymentGroupName = a})
udgEc2TagFilters :: Lens' UpdateDeploymentGroup [EC2TagFilter]
udgEc2TagFilters = lens _udgEc2TagFilters (\ s a -> s{_udgEc2TagFilters = a}) . _Default . _Coerce
udgBlueGreenDeploymentConfiguration :: Lens' UpdateDeploymentGroup (Maybe BlueGreenDeploymentConfiguration)
udgBlueGreenDeploymentConfiguration = lens _udgBlueGreenDeploymentConfiguration (\ s a -> s{_udgBlueGreenDeploymentConfiguration = a})
udgLoadBalancerInfo :: Lens' UpdateDeploymentGroup (Maybe LoadBalancerInfo)
udgLoadBalancerInfo = lens _udgLoadBalancerInfo (\ s a -> s{_udgLoadBalancerInfo = a})
udgOnPremisesInstanceTagFilters :: Lens' UpdateDeploymentGroup [TagFilter]
udgOnPremisesInstanceTagFilters = lens _udgOnPremisesInstanceTagFilters (\ s a -> s{_udgOnPremisesInstanceTagFilters = a}) . _Default . _Coerce
udgAlarmConfiguration :: Lens' UpdateDeploymentGroup (Maybe AlarmConfiguration)
udgAlarmConfiguration = lens _udgAlarmConfiguration (\ s a -> s{_udgAlarmConfiguration = a})
udgTriggerConfigurations :: Lens' UpdateDeploymentGroup [TriggerConfig]
udgTriggerConfigurations = lens _udgTriggerConfigurations (\ s a -> s{_udgTriggerConfigurations = a}) . _Default . _Coerce
udgAutoScalingGroups :: Lens' UpdateDeploymentGroup [Text]
udgAutoScalingGroups = lens _udgAutoScalingGroups (\ s a -> s{_udgAutoScalingGroups = a}) . _Default . _Coerce
udgDeploymentStyle :: Lens' UpdateDeploymentGroup (Maybe DeploymentStyle)
udgDeploymentStyle = lens _udgDeploymentStyle (\ s a -> s{_udgDeploymentStyle = a})
udgAutoRollbackConfiguration :: Lens' UpdateDeploymentGroup (Maybe AutoRollbackConfiguration)
udgAutoRollbackConfiguration = lens _udgAutoRollbackConfiguration (\ s a -> s{_udgAutoRollbackConfiguration = a})
udgApplicationName :: Lens' UpdateDeploymentGroup Text
udgApplicationName = lens _udgApplicationName (\ s a -> s{_udgApplicationName = a})
udgCurrentDeploymentGroupName :: Lens' UpdateDeploymentGroup Text
udgCurrentDeploymentGroupName = lens _udgCurrentDeploymentGroupName (\ s a -> s{_udgCurrentDeploymentGroupName = a})
instance AWSRequest UpdateDeploymentGroup where
type Rs UpdateDeploymentGroup =
UpdateDeploymentGroupResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
UpdateDeploymentGroupResponse' <$>
(x .?> "hooksNotCleanedUp" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable UpdateDeploymentGroup where
instance NFData UpdateDeploymentGroup where
instance ToHeaders UpdateDeploymentGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.UpdateDeploymentGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateDeploymentGroup where
toJSON UpdateDeploymentGroup'{..}
= object
(catMaybes
[("serviceRoleArn" .=) <$> _udgServiceRoleARN,
("ec2TagSet" .=) <$> _udgEc2TagSet,
("deploymentConfigName" .=) <$>
_udgDeploymentConfigName,
("onPremisesTagSet" .=) <$> _udgOnPremisesTagSet,
("newDeploymentGroupName" .=) <$>
_udgNewDeploymentGroupName,
("ec2TagFilters" .=) <$> _udgEc2TagFilters,
("blueGreenDeploymentConfiguration" .=) <$>
_udgBlueGreenDeploymentConfiguration,
("loadBalancerInfo" .=) <$> _udgLoadBalancerInfo,
("onPremisesInstanceTagFilters" .=) <$>
_udgOnPremisesInstanceTagFilters,
("alarmConfiguration" .=) <$> _udgAlarmConfiguration,
("triggerConfigurations" .=) <$>
_udgTriggerConfigurations,
("autoScalingGroups" .=) <$> _udgAutoScalingGroups,
("deploymentStyle" .=) <$> _udgDeploymentStyle,
("autoRollbackConfiguration" .=) <$>
_udgAutoRollbackConfiguration,
Just ("applicationName" .= _udgApplicationName),
Just
("currentDeploymentGroupName" .=
_udgCurrentDeploymentGroupName)])
instance ToPath UpdateDeploymentGroup where
toPath = const "/"
instance ToQuery UpdateDeploymentGroup where
toQuery = const mempty
data UpdateDeploymentGroupResponse = UpdateDeploymentGroupResponse'
{ _udgrsHooksNotCleanedUp :: !(Maybe [AutoScalingGroup])
, _udgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateDeploymentGroupResponse
:: Int
-> UpdateDeploymentGroupResponse
updateDeploymentGroupResponse pResponseStatus_ =
UpdateDeploymentGroupResponse'
{_udgrsHooksNotCleanedUp = Nothing, _udgrsResponseStatus = pResponseStatus_}
udgrsHooksNotCleanedUp :: Lens' UpdateDeploymentGroupResponse [AutoScalingGroup]
udgrsHooksNotCleanedUp = lens _udgrsHooksNotCleanedUp (\ s a -> s{_udgrsHooksNotCleanedUp = a}) . _Default . _Coerce
udgrsResponseStatus :: Lens' UpdateDeploymentGroupResponse Int
udgrsResponseStatus = lens _udgrsResponseStatus (\ s a -> s{_udgrsResponseStatus = a})
instance NFData UpdateDeploymentGroupResponse where