{-# 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.ModifyEndpoint
(
modifyEndpoint
, ModifyEndpoint
, meServerName
, meCertificateARN
, meServiceAccessRoleARN
, meExtraConnectionAttributes
, meEndpointType
, meUsername
, meExternalTableDefinition
, meEngineName
, meMongoDBSettings
, meSSLMode
, mePassword
, meDatabaseName
, meS3Settings
, meEndpointIdentifier
, meDynamoDBSettings
, mePort
, meEndpointARN
, modifyEndpointResponse
, ModifyEndpointResponse
, mersEndpoint
, mersResponseStatus
) 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 ModifyEndpoint = ModifyEndpoint'
{ _meServerName :: !(Maybe Text)
, _meCertificateARN :: !(Maybe Text)
, _meServiceAccessRoleARN :: !(Maybe Text)
, _meExtraConnectionAttributes :: !(Maybe Text)
, _meEndpointType :: !(Maybe ReplicationEndpointTypeValue)
, _meUsername :: !(Maybe Text)
, _meExternalTableDefinition :: !(Maybe Text)
, _meEngineName :: !(Maybe Text)
, _meMongoDBSettings :: !(Maybe MongoDBSettings)
, _meSSLMode :: !(Maybe DmsSSLModeValue)
, _mePassword :: !(Maybe (Sensitive Text))
, _meDatabaseName :: !(Maybe Text)
, _meS3Settings :: !(Maybe S3Settings)
, _meEndpointIdentifier :: !(Maybe Text)
, _meDynamoDBSettings :: !(Maybe DynamoDBSettings)
, _mePort :: !(Maybe Int)
, _meEndpointARN :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
modifyEndpoint
:: Text
-> ModifyEndpoint
modifyEndpoint pEndpointARN_ =
ModifyEndpoint'
{ _meServerName = Nothing
, _meCertificateARN = Nothing
, _meServiceAccessRoleARN = Nothing
, _meExtraConnectionAttributes = Nothing
, _meEndpointType = Nothing
, _meUsername = Nothing
, _meExternalTableDefinition = Nothing
, _meEngineName = Nothing
, _meMongoDBSettings = Nothing
, _meSSLMode = Nothing
, _mePassword = Nothing
, _meDatabaseName = Nothing
, _meS3Settings = Nothing
, _meEndpointIdentifier = Nothing
, _meDynamoDBSettings = Nothing
, _mePort = Nothing
, _meEndpointARN = pEndpointARN_
}
meServerName :: Lens' ModifyEndpoint (Maybe Text)
meServerName = lens _meServerName (\ s a -> s{_meServerName = a})
meCertificateARN :: Lens' ModifyEndpoint (Maybe Text)
meCertificateARN = lens _meCertificateARN (\ s a -> s{_meCertificateARN = a})
meServiceAccessRoleARN :: Lens' ModifyEndpoint (Maybe Text)
meServiceAccessRoleARN = lens _meServiceAccessRoleARN (\ s a -> s{_meServiceAccessRoleARN = a})
meExtraConnectionAttributes :: Lens' ModifyEndpoint (Maybe Text)
meExtraConnectionAttributes = lens _meExtraConnectionAttributes (\ s a -> s{_meExtraConnectionAttributes = a})
meEndpointType :: Lens' ModifyEndpoint (Maybe ReplicationEndpointTypeValue)
meEndpointType = lens _meEndpointType (\ s a -> s{_meEndpointType = a})
meUsername :: Lens' ModifyEndpoint (Maybe Text)
meUsername = lens _meUsername (\ s a -> s{_meUsername = a})
meExternalTableDefinition :: Lens' ModifyEndpoint (Maybe Text)
meExternalTableDefinition = lens _meExternalTableDefinition (\ s a -> s{_meExternalTableDefinition = a})
meEngineName :: Lens' ModifyEndpoint (Maybe Text)
meEngineName = lens _meEngineName (\ s a -> s{_meEngineName = a})
meMongoDBSettings :: Lens' ModifyEndpoint (Maybe MongoDBSettings)
meMongoDBSettings = lens _meMongoDBSettings (\ s a -> s{_meMongoDBSettings = a})
meSSLMode :: Lens' ModifyEndpoint (Maybe DmsSSLModeValue)
meSSLMode = lens _meSSLMode (\ s a -> s{_meSSLMode = a})
mePassword :: Lens' ModifyEndpoint (Maybe Text)
mePassword = lens _mePassword (\ s a -> s{_mePassword = a}) . mapping _Sensitive
meDatabaseName :: Lens' ModifyEndpoint (Maybe Text)
meDatabaseName = lens _meDatabaseName (\ s a -> s{_meDatabaseName = a})
meS3Settings :: Lens' ModifyEndpoint (Maybe S3Settings)
meS3Settings = lens _meS3Settings (\ s a -> s{_meS3Settings = a})
meEndpointIdentifier :: Lens' ModifyEndpoint (Maybe Text)
meEndpointIdentifier = lens _meEndpointIdentifier (\ s a -> s{_meEndpointIdentifier = a})
meDynamoDBSettings :: Lens' ModifyEndpoint (Maybe DynamoDBSettings)
meDynamoDBSettings = lens _meDynamoDBSettings (\ s a -> s{_meDynamoDBSettings = a})
mePort :: Lens' ModifyEndpoint (Maybe Int)
mePort = lens _mePort (\ s a -> s{_mePort = a})
meEndpointARN :: Lens' ModifyEndpoint Text
meEndpointARN = lens _meEndpointARN (\ s a -> s{_meEndpointARN = a})
instance AWSRequest ModifyEndpoint where
type Rs ModifyEndpoint = ModifyEndpointResponse
request = postJSON dms
response
= receiveJSON
(\ s h x ->
ModifyEndpointResponse' <$>
(x .?> "Endpoint") <*> (pure (fromEnum s)))
instance Hashable ModifyEndpoint where
instance NFData ModifyEndpoint where
instance ToHeaders ModifyEndpoint where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonDMSv20160101.ModifyEndpoint" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ModifyEndpoint where
toJSON ModifyEndpoint'{..}
= object
(catMaybes
[("ServerName" .=) <$> _meServerName,
("CertificateArn" .=) <$> _meCertificateARN,
("ServiceAccessRoleArn" .=) <$>
_meServiceAccessRoleARN,
("ExtraConnectionAttributes" .=) <$>
_meExtraConnectionAttributes,
("EndpointType" .=) <$> _meEndpointType,
("Username" .=) <$> _meUsername,
("ExternalTableDefinition" .=) <$>
_meExternalTableDefinition,
("EngineName" .=) <$> _meEngineName,
("MongoDbSettings" .=) <$> _meMongoDBSettings,
("SslMode" .=) <$> _meSSLMode,
("Password" .=) <$> _mePassword,
("DatabaseName" .=) <$> _meDatabaseName,
("S3Settings" .=) <$> _meS3Settings,
("EndpointIdentifier" .=) <$> _meEndpointIdentifier,
("DynamoDbSettings" .=) <$> _meDynamoDBSettings,
("Port" .=) <$> _mePort,
Just ("EndpointArn" .= _meEndpointARN)])
instance ToPath ModifyEndpoint where
toPath = const "/"
instance ToQuery ModifyEndpoint where
toQuery = const mempty
data ModifyEndpointResponse = ModifyEndpointResponse'
{ _mersEndpoint :: !(Maybe Endpoint)
, _mersResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
modifyEndpointResponse
:: Int
-> ModifyEndpointResponse
modifyEndpointResponse pResponseStatus_ =
ModifyEndpointResponse'
{_mersEndpoint = Nothing, _mersResponseStatus = pResponseStatus_}
mersEndpoint :: Lens' ModifyEndpointResponse (Maybe Endpoint)
mersEndpoint = lens _mersEndpoint (\ s a -> s{_mersEndpoint = a})
mersResponseStatus :: Lens' ModifyEndpointResponse Int
mersResponseStatus = lens _mersResponseStatus (\ s a -> s{_mersResponseStatus = a})
instance NFData ModifyEndpointResponse where