module Network.AWS.Lambda.GetEventSourceMapping
(
GetEventSourceMapping
, getEventSourceMapping
, gesmUUID
, GetEventSourceMappingResponse
, getEventSourceMappingResponse
, gesmrBatchSize
, gesmrEventSourceArn
, gesmrFunctionArn
, gesmrLastModified
, gesmrLastProcessingResult
, gesmrState
, gesmrStateTransitionReason
, gesmrUUID
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.RestJSON
import Network.AWS.Lambda.Types
import qualified GHC.Exts
newtype GetEventSourceMapping = GetEventSourceMapping
{ _gesmUUID :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
getEventSourceMapping :: Text
-> GetEventSourceMapping
getEventSourceMapping p1 = GetEventSourceMapping
{ _gesmUUID = p1
}
gesmUUID :: Lens' GetEventSourceMapping Text
gesmUUID = lens _gesmUUID (\s a -> s { _gesmUUID = a })
data GetEventSourceMappingResponse = GetEventSourceMappingResponse
{ _gesmrBatchSize :: Maybe Nat
, _gesmrEventSourceArn :: Maybe Text
, _gesmrFunctionArn :: Maybe Text
, _gesmrLastModified :: Maybe POSIX
, _gesmrLastProcessingResult :: Maybe Text
, _gesmrState :: Maybe Text
, _gesmrStateTransitionReason :: Maybe Text
, _gesmrUUID :: Maybe Text
} deriving (Eq, Ord, Read, Show)
getEventSourceMappingResponse :: GetEventSourceMappingResponse
getEventSourceMappingResponse = GetEventSourceMappingResponse
{ _gesmrUUID = Nothing
, _gesmrBatchSize = Nothing
, _gesmrEventSourceArn = Nothing
, _gesmrFunctionArn = Nothing
, _gesmrLastModified = Nothing
, _gesmrLastProcessingResult = Nothing
, _gesmrState = Nothing
, _gesmrStateTransitionReason = Nothing
}
gesmrBatchSize :: Lens' GetEventSourceMappingResponse (Maybe Natural)
gesmrBatchSize = lens _gesmrBatchSize (\s a -> s { _gesmrBatchSize = a }) . mapping _Nat
gesmrEventSourceArn :: Lens' GetEventSourceMappingResponse (Maybe Text)
gesmrEventSourceArn =
lens _gesmrEventSourceArn (\s a -> s { _gesmrEventSourceArn = a })
gesmrFunctionArn :: Lens' GetEventSourceMappingResponse (Maybe Text)
gesmrFunctionArn = lens _gesmrFunctionArn (\s a -> s { _gesmrFunctionArn = a })
gesmrLastModified :: Lens' GetEventSourceMappingResponse (Maybe UTCTime)
gesmrLastModified =
lens _gesmrLastModified (\s a -> s { _gesmrLastModified = a })
. mapping _Time
gesmrLastProcessingResult :: Lens' GetEventSourceMappingResponse (Maybe Text)
gesmrLastProcessingResult =
lens _gesmrLastProcessingResult
(\s a -> s { _gesmrLastProcessingResult = a })
gesmrState :: Lens' GetEventSourceMappingResponse (Maybe Text)
gesmrState = lens _gesmrState (\s a -> s { _gesmrState = a })
gesmrStateTransitionReason :: Lens' GetEventSourceMappingResponse (Maybe Text)
gesmrStateTransitionReason =
lens _gesmrStateTransitionReason
(\s a -> s { _gesmrStateTransitionReason = a })
gesmrUUID :: Lens' GetEventSourceMappingResponse (Maybe Text)
gesmrUUID = lens _gesmrUUID (\s a -> s { _gesmrUUID = a })
instance ToPath GetEventSourceMapping where
toPath GetEventSourceMapping{..} = mconcat
[ "/2015-03-31/event-source-mappings/"
, toText _gesmUUID
]
instance ToQuery GetEventSourceMapping where
toQuery = const mempty
instance ToHeaders GetEventSourceMapping
instance ToJSON GetEventSourceMapping where
toJSON = const (toJSON Empty)
instance AWSRequest GetEventSourceMapping where
type Sv GetEventSourceMapping = Lambda
type Rs GetEventSourceMapping = GetEventSourceMappingResponse
request = get
response = jsonResponse
instance FromJSON GetEventSourceMappingResponse where
parseJSON = withObject "GetEventSourceMappingResponse" $ \o -> GetEventSourceMappingResponse
<$> o .:? "BatchSize"
<*> o .:? "EventSourceArn"
<*> o .:? "FunctionArn"
<*> o .:? "LastModified"
<*> o .:? "LastProcessingResult"
<*> o .:? "State"
<*> o .:? "StateTransitionReason"
<*> o .:? "UUID"