{-# 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.CreateEndpoint
(
createEndpoint
, CreateEndpoint
, ceCertificateARN
, ceExtraConnectionAttributes
, ceKMSKeyId
, ceSSLMode
, ceDatabaseName
, ceTags
, ceEndpointIdentifier
, ceEndpointType
, ceEngineName
, ceUsername
, cePassword
, ceServerName
, cePort
, createEndpointResponse
, CreateEndpointResponse
, cersEndpoint
, cersResponseStatus
) 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 CreateEndpoint = CreateEndpoint'
{ _ceCertificateARN :: !(Maybe Text)
, _ceExtraConnectionAttributes :: !(Maybe Text)
, _ceKMSKeyId :: !(Maybe Text)
, _ceSSLMode :: !(Maybe DmsSSLModeValue)
, _ceDatabaseName :: !(Maybe Text)
, _ceTags :: !(Maybe [Tag])
, _ceEndpointIdentifier :: !Text
, _ceEndpointType :: !ReplicationEndpointTypeValue
, _ceEngineName :: !Text
, _ceUsername :: !Text
, _cePassword :: !(Sensitive Text)
, _ceServerName :: !Text
, _cePort :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createEndpoint
:: Text
-> ReplicationEndpointTypeValue
-> Text
-> Text
-> Text
-> Text
-> Int
-> CreateEndpoint
createEndpoint pEndpointIdentifier_ pEndpointType_ pEngineName_ pUsername_ pPassword_ pServerName_ pPort_ =
CreateEndpoint'
{ _ceCertificateARN = Nothing
, _ceExtraConnectionAttributes = Nothing
, _ceKMSKeyId = Nothing
, _ceSSLMode = Nothing
, _ceDatabaseName = Nothing
, _ceTags = Nothing
, _ceEndpointIdentifier = pEndpointIdentifier_
, _ceEndpointType = pEndpointType_
, _ceEngineName = pEngineName_
, _ceUsername = pUsername_
, _cePassword = _Sensitive # pPassword_
, _ceServerName = pServerName_
, _cePort = pPort_
}
ceCertificateARN :: Lens' CreateEndpoint (Maybe Text)
ceCertificateARN = lens _ceCertificateARN (\ s a -> s{_ceCertificateARN = a});
ceExtraConnectionAttributes :: Lens' CreateEndpoint (Maybe Text)
ceExtraConnectionAttributes = lens _ceExtraConnectionAttributes (\ s a -> s{_ceExtraConnectionAttributes = a});
ceKMSKeyId :: Lens' CreateEndpoint (Maybe Text)
ceKMSKeyId = lens _ceKMSKeyId (\ s a -> s{_ceKMSKeyId = a});
ceSSLMode :: Lens' CreateEndpoint (Maybe DmsSSLModeValue)
ceSSLMode = lens _ceSSLMode (\ s a -> s{_ceSSLMode = a});
ceDatabaseName :: Lens' CreateEndpoint (Maybe Text)
ceDatabaseName = lens _ceDatabaseName (\ s a -> s{_ceDatabaseName = a});
ceTags :: Lens' CreateEndpoint [Tag]
ceTags = lens _ceTags (\ s a -> s{_ceTags = a}) . _Default . _Coerce;
ceEndpointIdentifier :: Lens' CreateEndpoint Text
ceEndpointIdentifier = lens _ceEndpointIdentifier (\ s a -> s{_ceEndpointIdentifier = a});
ceEndpointType :: Lens' CreateEndpoint ReplicationEndpointTypeValue
ceEndpointType = lens _ceEndpointType (\ s a -> s{_ceEndpointType = a});
ceEngineName :: Lens' CreateEndpoint Text
ceEngineName = lens _ceEngineName (\ s a -> s{_ceEngineName = a});
ceUsername :: Lens' CreateEndpoint Text
ceUsername = lens _ceUsername (\ s a -> s{_ceUsername = a});
cePassword :: Lens' CreateEndpoint Text
cePassword = lens _cePassword (\ s a -> s{_cePassword = a}) . _Sensitive;
ceServerName :: Lens' CreateEndpoint Text
ceServerName = lens _ceServerName (\ s a -> s{_ceServerName = a});
cePort :: Lens' CreateEndpoint Int
cePort = lens _cePort (\ s a -> s{_cePort = a});
instance AWSRequest CreateEndpoint where
type Rs CreateEndpoint = CreateEndpointResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
CreateEndpointResponse' <$>
(x .?> "Endpoint") <*> (pure (fromEnum s)))
instance Hashable CreateEndpoint
instance NFData CreateEndpoint
instance ToHeaders CreateEndpoint where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.CreateEndpoint" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateEndpoint where
toJSON CreateEndpoint'{..}
= object
(catMaybes
[("CertificateArn" .=) <$> _ceCertificateARN,
("ExtraConnectionAttributes" .=) <$>
_ceExtraConnectionAttributes,
("KmsKeyId" .=) <$> _ceKMSKeyId,
("SslMode" .=) <$> _ceSSLMode,
("DatabaseName" .=) <$> _ceDatabaseName,
("Tags" .=) <$> _ceTags,
Just ("EndpointIdentifier" .= _ceEndpointIdentifier),
Just ("EndpointType" .= _ceEndpointType),
Just ("EngineName" .= _ceEngineName),
Just ("Username" .= _ceUsername),
Just ("Password" .= _cePassword),
Just ("ServerName" .= _ceServerName),
Just ("Port" .= _cePort)])
instance ToPath CreateEndpoint where
toPath = const "/"
instance ToQuery CreateEndpoint where
toQuery = const mempty
data CreateEndpointResponse = CreateEndpointResponse'
{ _cersEndpoint :: !(Maybe Endpoint)
, _cersResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createEndpointResponse
:: Int
-> CreateEndpointResponse
createEndpointResponse pResponseStatus_ =
CreateEndpointResponse'
{ _cersEndpoint = Nothing
, _cersResponseStatus = pResponseStatus_
}
cersEndpoint :: Lens' CreateEndpointResponse (Maybe Endpoint)
cersEndpoint = lens _cersEndpoint (\ s a -> s{_cersEndpoint = a});
cersResponseStatus :: Lens' CreateEndpointResponse Int
cersResponseStatus = lens _cersResponseStatus (\ s a -> s{_cersResponseStatus = a});
instance NFData CreateEndpointResponse