{-# 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.KinesisAnalytics.AddApplicationInput
(
addApplicationInput
, AddApplicationInput
, aaiApplicationName
, aaiCurrentApplicationVersionId
, aaiInput
, addApplicationInputResponse
, AddApplicationInputResponse
, aairsResponseStatus
) where
import Network.AWS.KinesisAnalytics.Types
import Network.AWS.KinesisAnalytics.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AddApplicationInput = AddApplicationInput'
{ _aaiApplicationName :: !Text
, _aaiCurrentApplicationVersionId :: !Nat
, _aaiInput :: !Input
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addApplicationInput
:: Text
-> Natural
-> Input
-> AddApplicationInput
addApplicationInput pApplicationName_ pCurrentApplicationVersionId_ pInput_ =
AddApplicationInput'
{ _aaiApplicationName = pApplicationName_
, _aaiCurrentApplicationVersionId = _Nat # pCurrentApplicationVersionId_
, _aaiInput = pInput_
}
aaiApplicationName :: Lens' AddApplicationInput Text
aaiApplicationName = lens _aaiApplicationName (\ s a -> s{_aaiApplicationName = a})
aaiCurrentApplicationVersionId :: Lens' AddApplicationInput Natural
aaiCurrentApplicationVersionId = lens _aaiCurrentApplicationVersionId (\ s a -> s{_aaiCurrentApplicationVersionId = a}) . _Nat
aaiInput :: Lens' AddApplicationInput Input
aaiInput = lens _aaiInput (\ s a -> s{_aaiInput = a})
instance AWSRequest AddApplicationInput where
type Rs AddApplicationInput =
AddApplicationInputResponse
request = postJSON kinesisAnalytics
response
= receiveEmpty
(\ s h x ->
AddApplicationInputResponse' <$> (pure (fromEnum s)))
instance Hashable AddApplicationInput where
instance NFData AddApplicationInput where
instance ToHeaders AddApplicationInput where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("KinesisAnalytics_20150814.AddApplicationInput" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AddApplicationInput where
toJSON AddApplicationInput'{..}
= object
(catMaybes
[Just ("ApplicationName" .= _aaiApplicationName),
Just
("CurrentApplicationVersionId" .=
_aaiCurrentApplicationVersionId),
Just ("Input" .= _aaiInput)])
instance ToPath AddApplicationInput where
toPath = const "/"
instance ToQuery AddApplicationInput where
toQuery = const mempty
newtype AddApplicationInputResponse = AddApplicationInputResponse'
{ _aairsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addApplicationInputResponse
:: Int
-> AddApplicationInputResponse
addApplicationInputResponse pResponseStatus_ =
AddApplicationInputResponse' {_aairsResponseStatus = pResponseStatus_}
aairsResponseStatus :: Lens' AddApplicationInputResponse Int
aairsResponseStatus = lens _aairsResponseStatus (\ s a -> s{_aairsResponseStatus = a})
instance NFData AddApplicationInputResponse where