{-# 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.Pinpoint.GetEventStream
(
getEventStream
, GetEventStream
, gesApplicationId
, getEventStreamResponse
, GetEventStreamResponse
, gesrsResponseStatus
, gesrsEventStream
) where
import Network.AWS.Lens
import Network.AWS.Pinpoint.Types
import Network.AWS.Pinpoint.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetEventStream = GetEventStream'
{ _gesApplicationId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getEventStream
:: Text
-> GetEventStream
getEventStream pApplicationId_ =
GetEventStream' {_gesApplicationId = pApplicationId_}
gesApplicationId :: Lens' GetEventStream Text
gesApplicationId = lens _gesApplicationId (\ s a -> s{_gesApplicationId = a})
instance AWSRequest GetEventStream where
type Rs GetEventStream = GetEventStreamResponse
request = get pinpoint
response
= receiveJSON
(\ s h x ->
GetEventStreamResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable GetEventStream where
instance NFData GetEventStream where
instance ToHeaders GetEventStream where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetEventStream where
toPath GetEventStream'{..}
= mconcat
["/v1/apps/", toBS _gesApplicationId, "/eventstream"]
instance ToQuery GetEventStream where
toQuery = const mempty
data GetEventStreamResponse = GetEventStreamResponse'
{ _gesrsResponseStatus :: !Int
, _gesrsEventStream :: !EventStream
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getEventStreamResponse
:: Int
-> EventStream
-> GetEventStreamResponse
getEventStreamResponse pResponseStatus_ pEventStream_ =
GetEventStreamResponse'
{_gesrsResponseStatus = pResponseStatus_, _gesrsEventStream = pEventStream_}
gesrsResponseStatus :: Lens' GetEventStreamResponse Int
gesrsResponseStatus = lens _gesrsResponseStatus (\ s a -> s{_gesrsResponseStatus = a})
gesrsEventStream :: Lens' GetEventStreamResponse EventStream
gesrsEventStream = lens _gesrsEventStream (\ s a -> s{_gesrsEventStream = a})
instance NFData GetEventStreamResponse where