{-# 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.Glue.UpdateConnection
(
updateConnection
, UpdateConnection
, ucCatalogId
, ucName
, ucConnectionInput
, updateConnectionResponse
, UpdateConnectionResponse
, ucrsResponseStatus
) where
import Network.AWS.Glue.Types
import Network.AWS.Glue.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateConnection = UpdateConnection'
{ _ucCatalogId :: !(Maybe Text)
, _ucName :: !Text
, _ucConnectionInput :: !ConnectionInput
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateConnection
:: Text
-> ConnectionInput
-> UpdateConnection
updateConnection pName_ pConnectionInput_ =
UpdateConnection'
{ _ucCatalogId = Nothing
, _ucName = pName_
, _ucConnectionInput = pConnectionInput_
}
ucCatalogId :: Lens' UpdateConnection (Maybe Text)
ucCatalogId = lens _ucCatalogId (\ s a -> s{_ucCatalogId = a})
ucName :: Lens' UpdateConnection Text
ucName = lens _ucName (\ s a -> s{_ucName = a})
ucConnectionInput :: Lens' UpdateConnection ConnectionInput
ucConnectionInput = lens _ucConnectionInput (\ s a -> s{_ucConnectionInput = a})
instance AWSRequest UpdateConnection where
type Rs UpdateConnection = UpdateConnectionResponse
request = postJSON glue
response
= receiveEmpty
(\ s h x ->
UpdateConnectionResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateConnection where
instance NFData UpdateConnection where
instance ToHeaders UpdateConnection where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.UpdateConnection" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateConnection where
toJSON UpdateConnection'{..}
= object
(catMaybes
[("CatalogId" .=) <$> _ucCatalogId,
Just ("Name" .= _ucName),
Just ("ConnectionInput" .= _ucConnectionInput)])
instance ToPath UpdateConnection where
toPath = const "/"
instance ToQuery UpdateConnection where
toQuery = const mempty
newtype UpdateConnectionResponse = UpdateConnectionResponse'
{ _ucrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateConnectionResponse
:: Int
-> UpdateConnectionResponse
updateConnectionResponse pResponseStatus_ =
UpdateConnectionResponse' {_ucrsResponseStatus = pResponseStatus_}
ucrsResponseStatus :: Lens' UpdateConnectionResponse Int
ucrsResponseStatus = lens _ucrsResponseStatus (\ s a -> s{_ucrsResponseStatus = a})
instance NFData UpdateConnectionResponse where