{-# 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.DMS.ModifyReplicationSubnetGroup
(
modifyReplicationSubnetGroup
, ModifyReplicationSubnetGroup
, mrsgReplicationSubnetGroupDescription
, mrsgReplicationSubnetGroupIdentifier
, mrsgSubnetIds
, modifyReplicationSubnetGroupResponse
, ModifyReplicationSubnetGroupResponse
, mrsgrsReplicationSubnetGroup
, mrsgrsResponseStatus
) where
import Network.AWS.DMS.Types
import Network.AWS.DMS.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ModifyReplicationSubnetGroup = ModifyReplicationSubnetGroup'
{ _mrsgReplicationSubnetGroupDescription :: !(Maybe Text)
, _mrsgReplicationSubnetGroupIdentifier :: !Text
, _mrsgSubnetIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyReplicationSubnetGroup
:: Text
-> ModifyReplicationSubnetGroup
modifyReplicationSubnetGroup pReplicationSubnetGroupIdentifier_ =
ModifyReplicationSubnetGroup'
{ _mrsgReplicationSubnetGroupDescription = Nothing
, _mrsgReplicationSubnetGroupIdentifier = pReplicationSubnetGroupIdentifier_
, _mrsgSubnetIds = mempty
}
mrsgReplicationSubnetGroupDescription :: Lens' ModifyReplicationSubnetGroup (Maybe Text)
mrsgReplicationSubnetGroupDescription = lens _mrsgReplicationSubnetGroupDescription (\ s a -> s{_mrsgReplicationSubnetGroupDescription = a});
mrsgReplicationSubnetGroupIdentifier :: Lens' ModifyReplicationSubnetGroup Text
mrsgReplicationSubnetGroupIdentifier = lens _mrsgReplicationSubnetGroupIdentifier (\ s a -> s{_mrsgReplicationSubnetGroupIdentifier = a});
mrsgSubnetIds :: Lens' ModifyReplicationSubnetGroup [Text]
mrsgSubnetIds = lens _mrsgSubnetIds (\ s a -> s{_mrsgSubnetIds = a}) . _Coerce;
instance AWSRequest ModifyReplicationSubnetGroup
where
type Rs ModifyReplicationSubnetGroup =
ModifyReplicationSubnetGroupResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
ModifyReplicationSubnetGroupResponse' <$>
(x .?> "ReplicationSubnetGroup") <*>
(pure (fromEnum s)))
instance Hashable ModifyReplicationSubnetGroup
instance NFData ModifyReplicationSubnetGroup
instance ToHeaders ModifyReplicationSubnetGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.ModifyReplicationSubnetGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ModifyReplicationSubnetGroup where
toJSON ModifyReplicationSubnetGroup'{..}
= object
(catMaybes
[("ReplicationSubnetGroupDescription" .=) <$>
_mrsgReplicationSubnetGroupDescription,
Just
("ReplicationSubnetGroupIdentifier" .=
_mrsgReplicationSubnetGroupIdentifier),
Just ("SubnetIds" .= _mrsgSubnetIds)])
instance ToPath ModifyReplicationSubnetGroup where
toPath = const "/"
instance ToQuery ModifyReplicationSubnetGroup where
toQuery = const mempty
data ModifyReplicationSubnetGroupResponse = ModifyReplicationSubnetGroupResponse'
{ _mrsgrsReplicationSubnetGroup :: !(Maybe ReplicationSubnetGroup)
, _mrsgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
modifyReplicationSubnetGroupResponse
:: Int
-> ModifyReplicationSubnetGroupResponse
modifyReplicationSubnetGroupResponse pResponseStatus_ =
ModifyReplicationSubnetGroupResponse'
{ _mrsgrsReplicationSubnetGroup = Nothing
, _mrsgrsResponseStatus = pResponseStatus_
}
mrsgrsReplicationSubnetGroup :: Lens' ModifyReplicationSubnetGroupResponse (Maybe ReplicationSubnetGroup)
mrsgrsReplicationSubnetGroup = lens _mrsgrsReplicationSubnetGroup (\ s a -> s{_mrsgrsReplicationSubnetGroup = a});
mrsgrsResponseStatus :: Lens' ModifyReplicationSubnetGroupResponse Int
mrsgrsResponseStatus = lens _mrsgrsResponseStatus (\ s a -> s{_mrsgrsResponseStatus = a});
instance NFData ModifyReplicationSubnetGroupResponse