module Network.AWS.Glue.UpdateUserDefinedFunction
(
updateUserDefinedFunction
, UpdateUserDefinedFunction
, uudfCatalogId
, uudfDatabaseName
, uudfFunctionName
, uudfFunctionInput
, updateUserDefinedFunctionResponse
, UpdateUserDefinedFunctionResponse
, uudfrsResponseStatus
) 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 UpdateUserDefinedFunction = UpdateUserDefinedFunction'
{ _uudfCatalogId :: !(Maybe Text)
, _uudfDatabaseName :: !Text
, _uudfFunctionName :: !Text
, _uudfFunctionInput :: !UserDefinedFunctionInput
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateUserDefinedFunction
:: Text
-> Text
-> UserDefinedFunctionInput
-> UpdateUserDefinedFunction
updateUserDefinedFunction pDatabaseName_ pFunctionName_ pFunctionInput_ =
UpdateUserDefinedFunction'
{ _uudfCatalogId = Nothing
, _uudfDatabaseName = pDatabaseName_
, _uudfFunctionName = pFunctionName_
, _uudfFunctionInput = pFunctionInput_
}
uudfCatalogId :: Lens' UpdateUserDefinedFunction (Maybe Text)
uudfCatalogId = lens _uudfCatalogId (\ s a -> s{_uudfCatalogId = a});
uudfDatabaseName :: Lens' UpdateUserDefinedFunction Text
uudfDatabaseName = lens _uudfDatabaseName (\ s a -> s{_uudfDatabaseName = a});
uudfFunctionName :: Lens' UpdateUserDefinedFunction Text
uudfFunctionName = lens _uudfFunctionName (\ s a -> s{_uudfFunctionName = a});
uudfFunctionInput :: Lens' UpdateUserDefinedFunction UserDefinedFunctionInput
uudfFunctionInput = lens _uudfFunctionInput (\ s a -> s{_uudfFunctionInput = a});
instance AWSRequest UpdateUserDefinedFunction where
type Rs UpdateUserDefinedFunction =
UpdateUserDefinedFunctionResponse
request = postJSON glue
response
= receiveEmpty
(\ s h x ->
UpdateUserDefinedFunctionResponse' <$>
(pure (fromEnum s)))
instance Hashable UpdateUserDefinedFunction where
instance NFData UpdateUserDefinedFunction where
instance ToHeaders UpdateUserDefinedFunction where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSGlue.UpdateUserDefinedFunction" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateUserDefinedFunction where
toJSON UpdateUserDefinedFunction'{..}
= object
(catMaybes
[("CatalogId" .=) <$> _uudfCatalogId,
Just ("DatabaseName" .= _uudfDatabaseName),
Just ("FunctionName" .= _uudfFunctionName),
Just ("FunctionInput" .= _uudfFunctionInput)])
instance ToPath UpdateUserDefinedFunction where
toPath = const "/"
instance ToQuery UpdateUserDefinedFunction where
toQuery = const mempty
newtype UpdateUserDefinedFunctionResponse = UpdateUserDefinedFunctionResponse'
{ _uudfrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateUserDefinedFunctionResponse
:: Int
-> UpdateUserDefinedFunctionResponse
updateUserDefinedFunctionResponse pResponseStatus_ =
UpdateUserDefinedFunctionResponse' {_uudfrsResponseStatus = pResponseStatus_}
uudfrsResponseStatus :: Lens' UpdateUserDefinedFunctionResponse Int
uudfrsResponseStatus = lens _uudfrsResponseStatus (\ s a -> s{_uudfrsResponseStatus = a});
instance NFData UpdateUserDefinedFunctionResponse
where