module Network.AWS.GameLift.DescribeFleetEvents
(
describeFleetEvents
, DescribeFleetEvents
, dfeStartTime
, dfeNextToken
, dfeEndTime
, dfeLimit
, dfeFleetId
, describeFleetEventsResponse
, DescribeFleetEventsResponse
, dfersNextToken
, dfersEvents
, dfersResponseStatus
) where
import Network.AWS.GameLift.Types
import Network.AWS.GameLift.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeFleetEvents = DescribeFleetEvents'
{ _dfeStartTime :: !(Maybe POSIX)
, _dfeNextToken :: !(Maybe Text)
, _dfeEndTime :: !(Maybe POSIX)
, _dfeLimit :: !(Maybe Nat)
, _dfeFleetId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeFleetEvents
:: Text
-> DescribeFleetEvents
describeFleetEvents pFleetId_ =
DescribeFleetEvents'
{ _dfeStartTime = Nothing
, _dfeNextToken = Nothing
, _dfeEndTime = Nothing
, _dfeLimit = Nothing
, _dfeFleetId = pFleetId_
}
dfeStartTime :: Lens' DescribeFleetEvents (Maybe UTCTime)
dfeStartTime = lens _dfeStartTime (\ s a -> s{_dfeStartTime = a}) . mapping _Time;
dfeNextToken :: Lens' DescribeFleetEvents (Maybe Text)
dfeNextToken = lens _dfeNextToken (\ s a -> s{_dfeNextToken = a});
dfeEndTime :: Lens' DescribeFleetEvents (Maybe UTCTime)
dfeEndTime = lens _dfeEndTime (\ s a -> s{_dfeEndTime = a}) . mapping _Time;
dfeLimit :: Lens' DescribeFleetEvents (Maybe Natural)
dfeLimit = lens _dfeLimit (\ s a -> s{_dfeLimit = a}) . mapping _Nat;
dfeFleetId :: Lens' DescribeFleetEvents Text
dfeFleetId = lens _dfeFleetId (\ s a -> s{_dfeFleetId = a});
instance AWSRequest DescribeFleetEvents where
type Rs DescribeFleetEvents =
DescribeFleetEventsResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
DescribeFleetEventsResponse' <$>
(x .?> "NextToken") <*> (x .?> "Events" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeFleetEvents
instance NFData DescribeFleetEvents
instance ToHeaders DescribeFleetEvents where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.DescribeFleetEvents" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeFleetEvents where
toJSON DescribeFleetEvents'{..}
= object
(catMaybes
[("StartTime" .=) <$> _dfeStartTime,
("NextToken" .=) <$> _dfeNextToken,
("EndTime" .=) <$> _dfeEndTime,
("Limit" .=) <$> _dfeLimit,
Just ("FleetId" .= _dfeFleetId)])
instance ToPath DescribeFleetEvents where
toPath = const "/"
instance ToQuery DescribeFleetEvents where
toQuery = const mempty
data DescribeFleetEventsResponse = DescribeFleetEventsResponse'
{ _dfersNextToken :: !(Maybe Text)
, _dfersEvents :: !(Maybe [Event])
, _dfersResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeFleetEventsResponse
:: Int
-> DescribeFleetEventsResponse
describeFleetEventsResponse pResponseStatus_ =
DescribeFleetEventsResponse'
{ _dfersNextToken = Nothing
, _dfersEvents = Nothing
, _dfersResponseStatus = pResponseStatus_
}
dfersNextToken :: Lens' DescribeFleetEventsResponse (Maybe Text)
dfersNextToken = lens _dfersNextToken (\ s a -> s{_dfersNextToken = a});
dfersEvents :: Lens' DescribeFleetEventsResponse [Event]
dfersEvents = lens _dfersEvents (\ s a -> s{_dfersEvents = a}) . _Default . _Coerce;
dfersResponseStatus :: Lens' DescribeFleetEventsResponse Int
dfersResponseStatus = lens _dfersResponseStatus (\ s a -> s{_dfersResponseStatus = a});
instance NFData DescribeFleetEventsResponse