module Network.AWS.DMS.CreateReplicationSubnetGroup
(
createReplicationSubnetGroup
, CreateReplicationSubnetGroup
, crsgTags
, crsgReplicationSubnetGroupIdentifier
, crsgReplicationSubnetGroupDescription
, crsgSubnetIds
, createReplicationSubnetGroupResponse
, CreateReplicationSubnetGroupResponse
, crsgrsReplicationSubnetGroup
, crsgrsResponseStatus
) 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 CreateReplicationSubnetGroup = CreateReplicationSubnetGroup'
{ _crsgTags :: !(Maybe [Tag])
, _crsgReplicationSubnetGroupIdentifier :: !Text
, _crsgReplicationSubnetGroupDescription :: !Text
, _crsgSubnetIds :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createReplicationSubnetGroup
:: Text
-> Text
-> CreateReplicationSubnetGroup
createReplicationSubnetGroup pReplicationSubnetGroupIdentifier_ pReplicationSubnetGroupDescription_ =
CreateReplicationSubnetGroup'
{ _crsgTags = Nothing
, _crsgReplicationSubnetGroupIdentifier = pReplicationSubnetGroupIdentifier_
, _crsgReplicationSubnetGroupDescription = pReplicationSubnetGroupDescription_
, _crsgSubnetIds = mempty
}
crsgTags :: Lens' CreateReplicationSubnetGroup [Tag]
crsgTags = lens _crsgTags (\ s a -> s{_crsgTags = a}) . _Default . _Coerce;
crsgReplicationSubnetGroupIdentifier :: Lens' CreateReplicationSubnetGroup Text
crsgReplicationSubnetGroupIdentifier = lens _crsgReplicationSubnetGroupIdentifier (\ s a -> s{_crsgReplicationSubnetGroupIdentifier = a});
crsgReplicationSubnetGroupDescription :: Lens' CreateReplicationSubnetGroup Text
crsgReplicationSubnetGroupDescription = lens _crsgReplicationSubnetGroupDescription (\ s a -> s{_crsgReplicationSubnetGroupDescription = a});
crsgSubnetIds :: Lens' CreateReplicationSubnetGroup [Text]
crsgSubnetIds = lens _crsgSubnetIds (\ s a -> s{_crsgSubnetIds = a}) . _Coerce;
instance AWSRequest CreateReplicationSubnetGroup
where
type Rs CreateReplicationSubnetGroup =
CreateReplicationSubnetGroupResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
CreateReplicationSubnetGroupResponse' <$>
(x .?> "ReplicationSubnetGroup") <*>
(pure (fromEnum s)))
instance Hashable CreateReplicationSubnetGroup
instance NFData CreateReplicationSubnetGroup
instance ToHeaders CreateReplicationSubnetGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.CreateReplicationSubnetGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateReplicationSubnetGroup where
toJSON CreateReplicationSubnetGroup'{..}
= object
(catMaybes
[("Tags" .=) <$> _crsgTags,
Just
("ReplicationSubnetGroupIdentifier" .=
_crsgReplicationSubnetGroupIdentifier),
Just
("ReplicationSubnetGroupDescription" .=
_crsgReplicationSubnetGroupDescription),
Just ("SubnetIds" .= _crsgSubnetIds)])
instance ToPath CreateReplicationSubnetGroup where
toPath = const "/"
instance ToQuery CreateReplicationSubnetGroup where
toQuery = const mempty
data CreateReplicationSubnetGroupResponse = CreateReplicationSubnetGroupResponse'
{ _crsgrsReplicationSubnetGroup :: !(Maybe ReplicationSubnetGroup)
, _crsgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createReplicationSubnetGroupResponse
:: Int
-> CreateReplicationSubnetGroupResponse
createReplicationSubnetGroupResponse pResponseStatus_ =
CreateReplicationSubnetGroupResponse'
{ _crsgrsReplicationSubnetGroup = Nothing
, _crsgrsResponseStatus = pResponseStatus_
}
crsgrsReplicationSubnetGroup :: Lens' CreateReplicationSubnetGroupResponse (Maybe ReplicationSubnetGroup)
crsgrsReplicationSubnetGroup = lens _crsgrsReplicationSubnetGroup (\ s a -> s{_crsgrsReplicationSubnetGroup = a});
crsgrsResponseStatus :: Lens' CreateReplicationSubnetGroupResponse Int
crsgrsResponseStatus = lens _crsgrsResponseStatus (\ s a -> s{_crsgrsResponseStatus = a});
instance NFData CreateReplicationSubnetGroupResponse