{-# 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
, ceServerName
, ceCertificateARN
, ceServiceAccessRoleARN
, ceExtraConnectionAttributes
, ceUsername
, ceExternalTableDefinition
, ceKMSKeyId
, ceMongoDBSettings
, ceSSLMode
, cePassword
, ceDatabaseName
, ceS3Settings
, ceDynamoDBSettings
, ceTags
, cePort
, ceEndpointIdentifier
, ceEndpointType
, ceEngineName
, 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'
{ _ceServerName :: !(Maybe Text)
, _ceCertificateARN :: !(Maybe Text)
, _ceServiceAccessRoleARN :: !(Maybe Text)
, _ceExtraConnectionAttributes :: !(Maybe Text)
, _ceUsername :: !(Maybe Text)
, _ceExternalTableDefinition :: !(Maybe Text)
, _ceKMSKeyId :: !(Maybe Text)
, _ceMongoDBSettings :: !(Maybe MongoDBSettings)
, _ceSSLMode :: !(Maybe DmsSSLModeValue)
, _cePassword :: !(Maybe (Sensitive Text))
, _ceDatabaseName :: !(Maybe Text)
, _ceS3Settings :: !(Maybe S3Settings)
, _ceDynamoDBSettings :: !(Maybe DynamoDBSettings)
, _ceTags :: !(Maybe [Tag])
, _cePort :: !(Maybe Int)
, _ceEndpointIdentifier :: !Text
, _ceEndpointType :: !ReplicationEndpointTypeValue
, _ceEngineName :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
createEndpoint
:: Text
-> ReplicationEndpointTypeValue
-> Text
-> CreateEndpoint
createEndpoint pEndpointIdentifier_ pEndpointType_ pEngineName_ =
CreateEndpoint'
{ _ceServerName = Nothing
, _ceCertificateARN = Nothing
, _ceServiceAccessRoleARN = Nothing
, _ceExtraConnectionAttributes = Nothing
, _ceUsername = Nothing
, _ceExternalTableDefinition = Nothing
, _ceKMSKeyId = Nothing
, _ceMongoDBSettings = Nothing
, _ceSSLMode = Nothing
, _cePassword = Nothing
, _ceDatabaseName = Nothing
, _ceS3Settings = Nothing
, _ceDynamoDBSettings = Nothing
, _ceTags = Nothing
, _cePort = Nothing
, _ceEndpointIdentifier = pEndpointIdentifier_
, _ceEndpointType = pEndpointType_
, _ceEngineName = pEngineName_
}
ceServerName :: Lens' CreateEndpoint (Maybe Text)
ceServerName = lens _ceServerName (\ s a -> s{_ceServerName = a})
ceCertificateARN :: Lens' CreateEndpoint (Maybe Text)
ceCertificateARN = lens _ceCertificateARN (\ s a -> s{_ceCertificateARN = a})
ceServiceAccessRoleARN :: Lens' CreateEndpoint (Maybe Text)
ceServiceAccessRoleARN = lens _ceServiceAccessRoleARN (\ s a -> s{_ceServiceAccessRoleARN = a})
ceExtraConnectionAttributes :: Lens' CreateEndpoint (Maybe Text)
ceExtraConnectionAttributes = lens _ceExtraConnectionAttributes (\ s a -> s{_ceExtraConnectionAttributes = a})
ceUsername :: Lens' CreateEndpoint (Maybe Text)
ceUsername = lens _ceUsername (\ s a -> s{_ceUsername = a})
ceExternalTableDefinition :: Lens' CreateEndpoint (Maybe Text)
ceExternalTableDefinition = lens _ceExternalTableDefinition (\ s a -> s{_ceExternalTableDefinition = a})
ceKMSKeyId :: Lens' CreateEndpoint (Maybe Text)
ceKMSKeyId = lens _ceKMSKeyId (\ s a -> s{_ceKMSKeyId = a})
ceMongoDBSettings :: Lens' CreateEndpoint (Maybe MongoDBSettings)
ceMongoDBSettings = lens _ceMongoDBSettings (\ s a -> s{_ceMongoDBSettings = a})
ceSSLMode :: Lens' CreateEndpoint (Maybe DmsSSLModeValue)
ceSSLMode = lens _ceSSLMode (\ s a -> s{_ceSSLMode = a})
cePassword :: Lens' CreateEndpoint (Maybe Text)
cePassword = lens _cePassword (\ s a -> s{_cePassword = a}) . mapping _Sensitive
ceDatabaseName :: Lens' CreateEndpoint (Maybe Text)
ceDatabaseName = lens _ceDatabaseName (\ s a -> s{_ceDatabaseName = a})
ceS3Settings :: Lens' CreateEndpoint (Maybe S3Settings)
ceS3Settings = lens _ceS3Settings (\ s a -> s{_ceS3Settings = a})
ceDynamoDBSettings :: Lens' CreateEndpoint (Maybe DynamoDBSettings)
ceDynamoDBSettings = lens _ceDynamoDBSettings (\ s a -> s{_ceDynamoDBSettings = a})
ceTags :: Lens' CreateEndpoint [Tag]
ceTags = lens _ceTags (\ s a -> s{_ceTags = a}) . _Default . _Coerce
cePort :: Lens' CreateEndpoint (Maybe Int)
cePort = lens _cePort (\ s a -> s{_cePort = a})
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})
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 where
instance NFData CreateEndpoint where
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
[("ServerName" .=) <$> _ceServerName,
("CertificateArn" .=) <$> _ceCertificateARN,
("ServiceAccessRoleArn" .=) <$>
_ceServiceAccessRoleARN,
("ExtraConnectionAttributes" .=) <$>
_ceExtraConnectionAttributes,
("Username" .=) <$> _ceUsername,
("ExternalTableDefinition" .=) <$>
_ceExternalTableDefinition,
("KmsKeyId" .=) <$> _ceKMSKeyId,
("MongoDbSettings" .=) <$> _ceMongoDBSettings,
("SslMode" .=) <$> _ceSSLMode,
("Password" .=) <$> _cePassword,
("DatabaseName" .=) <$> _ceDatabaseName,
("S3Settings" .=) <$> _ceS3Settings,
("DynamoDbSettings" .=) <$> _ceDynamoDBSettings,
("Tags" .=) <$> _ceTags, ("Port" .=) <$> _cePort,
Just ("EndpointIdentifier" .= _ceEndpointIdentifier),
Just ("EndpointType" .= _ceEndpointType),
Just ("EngineName" .= _ceEngineName)])
instance ToPath CreateEndpoint where
toPath = const "/"
instance ToQuery CreateEndpoint where
toQuery = const mempty
data CreateEndpointResponse = CreateEndpointResponse'
{ _cersEndpoint :: !(Maybe Endpoint)
, _cersResponseStatus :: !Int
} deriving (Eq, 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 where