module Network.AWS.Lambda.GetEventSource
(
GetEventSource
, getEventSource
, gesUUID
, GetEventSourceResponse
, getEventSourceResponse
, gesrBatchSize
, gesrEventSource
, gesrFunctionName
, gesrIsActive
, gesrLastModified
, gesrParameters
, gesrRole
, gesrStatus
, gesrUUID
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestJSON
import Network.AWS.Lambda.Types
import qualified GHC.Exts
newtype GetEventSource = GetEventSource
{ _gesUUID :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
getEventSource :: Text
-> GetEventSource
getEventSource p1 = GetEventSource
{ _gesUUID = p1
}
gesUUID :: Lens' GetEventSource Text
gesUUID = lens _gesUUID (\s a -> s { _gesUUID = a })
data GetEventSourceResponse = GetEventSourceResponse
{ _gesrBatchSize :: Maybe Int
, _gesrEventSource :: Maybe Text
, _gesrFunctionName :: Maybe Text
, _gesrIsActive :: Maybe Bool
, _gesrLastModified :: Maybe POSIX
, _gesrParameters :: Map Text Text
, _gesrRole :: Maybe Text
, _gesrStatus :: Maybe Text
, _gesrUUID :: Maybe Text
} deriving (Eq, Read, Show)
getEventSourceResponse :: GetEventSourceResponse
getEventSourceResponse = GetEventSourceResponse
{ _gesrUUID = Nothing
, _gesrBatchSize = Nothing
, _gesrEventSource = Nothing
, _gesrFunctionName = Nothing
, _gesrParameters = mempty
, _gesrRole = Nothing
, _gesrLastModified = Nothing
, _gesrIsActive = Nothing
, _gesrStatus = Nothing
}
gesrBatchSize :: Lens' GetEventSourceResponse (Maybe Int)
gesrBatchSize = lens _gesrBatchSize (\s a -> s { _gesrBatchSize = a })
gesrEventSource :: Lens' GetEventSourceResponse (Maybe Text)
gesrEventSource = lens _gesrEventSource (\s a -> s { _gesrEventSource = a })
gesrFunctionName :: Lens' GetEventSourceResponse (Maybe Text)
gesrFunctionName = lens _gesrFunctionName (\s a -> s { _gesrFunctionName = a })
gesrIsActive :: Lens' GetEventSourceResponse (Maybe Bool)
gesrIsActive = lens _gesrIsActive (\s a -> s { _gesrIsActive = a })
gesrLastModified :: Lens' GetEventSourceResponse (Maybe UTCTime)
gesrLastModified = lens _gesrLastModified (\s a -> s { _gesrLastModified = a }) . mapping _Time
gesrParameters :: Lens' GetEventSourceResponse (HashMap Text Text)
gesrParameters = lens _gesrParameters (\s a -> s { _gesrParameters = a }) . _Map
gesrRole :: Lens' GetEventSourceResponse (Maybe Text)
gesrRole = lens _gesrRole (\s a -> s { _gesrRole = a })
gesrStatus :: Lens' GetEventSourceResponse (Maybe Text)
gesrStatus = lens _gesrStatus (\s a -> s { _gesrStatus = a })
gesrUUID :: Lens' GetEventSourceResponse (Maybe Text)
gesrUUID = lens _gesrUUID (\s a -> s { _gesrUUID = a })
instance ToPath GetEventSource where
toPath GetEventSource{..} = mconcat
[ "/2014-11-13/event-source-mappings/"
, toText _gesUUID
]
instance ToQuery GetEventSource where
toQuery = const mempty
instance ToHeaders GetEventSource
instance ToJSON GetEventSource where
toJSON = const (toJSON Empty)
instance AWSRequest GetEventSource where
type Sv GetEventSource = Lambda
type Rs GetEventSource = GetEventSourceResponse
request = get
response = jsonResponse
instance FromJSON GetEventSourceResponse where
parseJSON = withObject "GetEventSourceResponse" $ \o -> GetEventSourceResponse
<$> o .:? "BatchSize"
<*> o .:? "EventSource"
<*> o .:? "FunctionName"
<*> o .:? "IsActive"
<*> o .:? "LastModified"
<*> o .:? "Parameters" .!= mempty
<*> o .:? "Role"
<*> o .:? "Status"
<*> o .:? "UUID"