module Network.AWS.DMS.CreateReplicationTask
(
createReplicationTask
, CreateReplicationTask
, crtReplicationTaskSettings
, crtTags
, crtCdcStartTime
, crtReplicationTaskIdentifier
, crtSourceEndpointARN
, crtTargetEndpointARN
, crtReplicationInstanceARN
, crtMigrationType
, crtTableMappings
, createReplicationTaskResponse
, CreateReplicationTaskResponse
, crtrsReplicationTask
, crtrsResponseStatus
) 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 CreateReplicationTask = CreateReplicationTask'
{ _crtReplicationTaskSettings :: !(Maybe Text)
, _crtTags :: !(Maybe [Tag])
, _crtCdcStartTime :: !(Maybe POSIX)
, _crtReplicationTaskIdentifier :: !Text
, _crtSourceEndpointARN :: !Text
, _crtTargetEndpointARN :: !Text
, _crtReplicationInstanceARN :: !Text
, _crtMigrationType :: !MigrationTypeValue
, _crtTableMappings :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createReplicationTask
:: Text
-> Text
-> Text
-> Text
-> MigrationTypeValue
-> Text
-> CreateReplicationTask
createReplicationTask pReplicationTaskIdentifier_ pSourceEndpointARN_ pTargetEndpointARN_ pReplicationInstanceARN_ pMigrationType_ pTableMappings_ =
CreateReplicationTask'
{ _crtReplicationTaskSettings = Nothing
, _crtTags = Nothing
, _crtCdcStartTime = Nothing
, _crtReplicationTaskIdentifier = pReplicationTaskIdentifier_
, _crtSourceEndpointARN = pSourceEndpointARN_
, _crtTargetEndpointARN = pTargetEndpointARN_
, _crtReplicationInstanceARN = pReplicationInstanceARN_
, _crtMigrationType = pMigrationType_
, _crtTableMappings = pTableMappings_
}
crtReplicationTaskSettings :: Lens' CreateReplicationTask (Maybe Text)
crtReplicationTaskSettings = lens _crtReplicationTaskSettings (\ s a -> s{_crtReplicationTaskSettings = a});
crtTags :: Lens' CreateReplicationTask [Tag]
crtTags = lens _crtTags (\ s a -> s{_crtTags = a}) . _Default . _Coerce;
crtCdcStartTime :: Lens' CreateReplicationTask (Maybe UTCTime)
crtCdcStartTime = lens _crtCdcStartTime (\ s a -> s{_crtCdcStartTime = a}) . mapping _Time;
crtReplicationTaskIdentifier :: Lens' CreateReplicationTask Text
crtReplicationTaskIdentifier = lens _crtReplicationTaskIdentifier (\ s a -> s{_crtReplicationTaskIdentifier = a});
crtSourceEndpointARN :: Lens' CreateReplicationTask Text
crtSourceEndpointARN = lens _crtSourceEndpointARN (\ s a -> s{_crtSourceEndpointARN = a});
crtTargetEndpointARN :: Lens' CreateReplicationTask Text
crtTargetEndpointARN = lens _crtTargetEndpointARN (\ s a -> s{_crtTargetEndpointARN = a});
crtReplicationInstanceARN :: Lens' CreateReplicationTask Text
crtReplicationInstanceARN = lens _crtReplicationInstanceARN (\ s a -> s{_crtReplicationInstanceARN = a});
crtMigrationType :: Lens' CreateReplicationTask MigrationTypeValue
crtMigrationType = lens _crtMigrationType (\ s a -> s{_crtMigrationType = a});
crtTableMappings :: Lens' CreateReplicationTask Text
crtTableMappings = lens _crtTableMappings (\ s a -> s{_crtTableMappings = a});
instance AWSRequest CreateReplicationTask where
type Rs CreateReplicationTask =
CreateReplicationTaskResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
CreateReplicationTaskResponse' <$>
(x .?> "ReplicationTask") <*> (pure (fromEnum s)))
instance Hashable CreateReplicationTask
instance NFData CreateReplicationTask
instance ToHeaders CreateReplicationTask where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.CreateReplicationTask" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateReplicationTask where
toJSON CreateReplicationTask'{..}
= object
(catMaybes
[("ReplicationTaskSettings" .=) <$>
_crtReplicationTaskSettings,
("Tags" .=) <$> _crtTags,
("CdcStartTime" .=) <$> _crtCdcStartTime,
Just
("ReplicationTaskIdentifier" .=
_crtReplicationTaskIdentifier),
Just ("SourceEndpointArn" .= _crtSourceEndpointARN),
Just ("TargetEndpointArn" .= _crtTargetEndpointARN),
Just
("ReplicationInstanceArn" .=
_crtReplicationInstanceARN),
Just ("MigrationType" .= _crtMigrationType),
Just ("TableMappings" .= _crtTableMappings)])
instance ToPath CreateReplicationTask where
toPath = const "/"
instance ToQuery CreateReplicationTask where
toQuery = const mempty
data CreateReplicationTaskResponse = CreateReplicationTaskResponse'
{ _crtrsReplicationTask :: !(Maybe ReplicationTask)
, _crtrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createReplicationTaskResponse
:: Int
-> CreateReplicationTaskResponse
createReplicationTaskResponse pResponseStatus_ =
CreateReplicationTaskResponse'
{ _crtrsReplicationTask = Nothing
, _crtrsResponseStatus = pResponseStatus_
}
crtrsReplicationTask :: Lens' CreateReplicationTaskResponse (Maybe ReplicationTask)
crtrsReplicationTask = lens _crtrsReplicationTask (\ s a -> s{_crtrsReplicationTask = a});
crtrsResponseStatus :: Lens' CreateReplicationTaskResponse Int
crtrsResponseStatus = lens _crtrsResponseStatus (\ s a -> s{_crtrsResponseStatus = a});
instance NFData CreateReplicationTaskResponse