amazonka-rds-1.3.7: gen/Network/AWS/RDS/ModifyDBSubnetGroup.hs
{-# 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 #-}
-- Derived from AWS service descriptions, licensed under Apache 2.0.
-- |
-- Module : Network.AWS.RDS.ModifyDBSubnetGroup
-- Copyright : (c) 2013-2015 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies an existing DB subnet group. DB subnet groups must contain at
-- least one subnet in at least two AZs in the region.
--
-- /See:/ <http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBSubnetGroup.html AWS API Reference> for ModifyDBSubnetGroup.
module Network.AWS.RDS.ModifyDBSubnetGroup
(
-- * Creating a Request
modifyDBSubnetGroup
, ModifyDBSubnetGroup
-- * Request Lenses
, mdsgDBSubnetGroupDescription
, mdsgDBSubnetGroupName
, mdsgSubnetIds
-- * Destructuring the Response
, modifyDBSubnetGroupResponse
, ModifyDBSubnetGroupResponse
-- * Response Lenses
, mdsgrsDBSubnetGroup
, mdsgrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
-- |
--
-- /See:/ 'modifyDBSubnetGroup' smart constructor.
data ModifyDBSubnetGroup = ModifyDBSubnetGroup'
{ _mdsgDBSubnetGroupDescription :: !(Maybe Text)
, _mdsgDBSubnetGroupName :: !Text
, _mdsgSubnetIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
-- | Creates a value of 'ModifyDBSubnetGroup' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mdsgDBSubnetGroupDescription'
--
-- * 'mdsgDBSubnetGroupName'
--
-- * 'mdsgSubnetIds'
modifyDBSubnetGroup
:: Text -- ^ 'mdsgDBSubnetGroupName'
-> ModifyDBSubnetGroup
modifyDBSubnetGroup pDBSubnetGroupName_ =
ModifyDBSubnetGroup'
{ _mdsgDBSubnetGroupDescription = Nothing
, _mdsgDBSubnetGroupName = pDBSubnetGroupName_
, _mdsgSubnetIds = mempty
}
-- | The description for the DB subnet group.
mdsgDBSubnetGroupDescription :: Lens' ModifyDBSubnetGroup (Maybe Text)
mdsgDBSubnetGroupDescription = lens _mdsgDBSubnetGroupDescription (\ s a -> s{_mdsgDBSubnetGroupDescription = a});
-- | The name for the DB subnet group. This value is stored as a lowercase
-- string.
--
-- Constraints: Must contain no more than 255 alphanumeric characters or
-- hyphens. Must not be \"Default\".
--
-- Example: 'mySubnetgroup'
mdsgDBSubnetGroupName :: Lens' ModifyDBSubnetGroup Text
mdsgDBSubnetGroupName = lens _mdsgDBSubnetGroupName (\ s a -> s{_mdsgDBSubnetGroupName = a});
-- | The EC2 subnet IDs for the DB subnet group.
mdsgSubnetIds :: Lens' ModifyDBSubnetGroup [Text]
mdsgSubnetIds = lens _mdsgSubnetIds (\ s a -> s{_mdsgSubnetIds = a}) . _Coerce;
instance AWSRequest ModifyDBSubnetGroup where
type Rs ModifyDBSubnetGroup =
ModifyDBSubnetGroupResponse
request = postQuery rDS
response
= receiveXMLWrapper "ModifyDBSubnetGroupResult"
(\ s h x ->
ModifyDBSubnetGroupResponse' <$>
(x .@? "DBSubnetGroup") <*> (pure (fromEnum s)))
instance ToHeaders ModifyDBSubnetGroup where
toHeaders = const mempty
instance ToPath ModifyDBSubnetGroup where
toPath = const "/"
instance ToQuery ModifyDBSubnetGroup where
toQuery ModifyDBSubnetGroup'{..}
= mconcat
["Action" =: ("ModifyDBSubnetGroup" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"DBSubnetGroupDescription" =:
_mdsgDBSubnetGroupDescription,
"DBSubnetGroupName" =: _mdsgDBSubnetGroupName,
"SubnetIds" =:
toQueryList "SubnetIdentifier" _mdsgSubnetIds]
-- | /See:/ 'modifyDBSubnetGroupResponse' smart constructor.
data ModifyDBSubnetGroupResponse = ModifyDBSubnetGroupResponse'
{ _mdsgrsDBSubnetGroup :: !(Maybe DBSubnetGroup)
, _mdsgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
-- | Creates a value of 'ModifyDBSubnetGroupResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mdsgrsDBSubnetGroup'
--
-- * 'mdsgrsResponseStatus'
modifyDBSubnetGroupResponse
:: Int -- ^ 'mdsgrsResponseStatus'
-> ModifyDBSubnetGroupResponse
modifyDBSubnetGroupResponse pResponseStatus_ =
ModifyDBSubnetGroupResponse'
{ _mdsgrsDBSubnetGroup = Nothing
, _mdsgrsResponseStatus = pResponseStatus_
}
-- | Undocumented member.
mdsgrsDBSubnetGroup :: Lens' ModifyDBSubnetGroupResponse (Maybe DBSubnetGroup)
mdsgrsDBSubnetGroup = lens _mdsgrsDBSubnetGroup (\ s a -> s{_mdsgrsDBSubnetGroup = a});
-- | The response status code.
mdsgrsResponseStatus :: Lens' ModifyDBSubnetGroupResponse Int
mdsgrsResponseStatus = lens _mdsgrsResponseStatus (\ s a -> s{_mdsgrsResponseStatus = a});