{-# 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.GameLift.DescribeGameSessionQueues
(
describeGameSessionQueues
, DescribeGameSessionQueues
, dgsqNextToken
, dgsqNames
, dgsqLimit
, describeGameSessionQueuesResponse
, DescribeGameSessionQueuesResponse
, drsNextToken
, drsGameSessionQueues
, drsResponseStatus
) 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 DescribeGameSessionQueues = DescribeGameSessionQueues'
{ _dgsqNextToken :: !(Maybe Text)
, _dgsqNames :: !(Maybe [Text])
, _dgsqLimit :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeGameSessionQueues
:: DescribeGameSessionQueues
describeGameSessionQueues =
DescribeGameSessionQueues'
{_dgsqNextToken = Nothing, _dgsqNames = Nothing, _dgsqLimit = Nothing}
dgsqNextToken :: Lens' DescribeGameSessionQueues (Maybe Text)
dgsqNextToken = lens _dgsqNextToken (\ s a -> s{_dgsqNextToken = a})
dgsqNames :: Lens' DescribeGameSessionQueues [Text]
dgsqNames = lens _dgsqNames (\ s a -> s{_dgsqNames = a}) . _Default . _Coerce
dgsqLimit :: Lens' DescribeGameSessionQueues (Maybe Natural)
dgsqLimit = lens _dgsqLimit (\ s a -> s{_dgsqLimit = a}) . mapping _Nat
instance AWSRequest DescribeGameSessionQueues where
type Rs DescribeGameSessionQueues =
DescribeGameSessionQueuesResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
DescribeGameSessionQueuesResponse' <$>
(x .?> "NextToken") <*>
(x .?> "GameSessionQueues" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeGameSessionQueues where
instance NFData DescribeGameSessionQueues where
instance ToHeaders DescribeGameSessionQueues where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.DescribeGameSessionQueues" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeGameSessionQueues where
toJSON DescribeGameSessionQueues'{..}
= object
(catMaybes
[("NextToken" .=) <$> _dgsqNextToken,
("Names" .=) <$> _dgsqNames,
("Limit" .=) <$> _dgsqLimit])
instance ToPath DescribeGameSessionQueues where
toPath = const "/"
instance ToQuery DescribeGameSessionQueues where
toQuery = const mempty
data DescribeGameSessionQueuesResponse = DescribeGameSessionQueuesResponse'
{ _drsNextToken :: !(Maybe Text)
, _drsGameSessionQueues :: !(Maybe [GameSessionQueue])
, _drsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeGameSessionQueuesResponse
:: Int
-> DescribeGameSessionQueuesResponse
describeGameSessionQueuesResponse pResponseStatus_ =
DescribeGameSessionQueuesResponse'
{ _drsNextToken = Nothing
, _drsGameSessionQueues = Nothing
, _drsResponseStatus = pResponseStatus_
}
drsNextToken :: Lens' DescribeGameSessionQueuesResponse (Maybe Text)
drsNextToken = lens _drsNextToken (\ s a -> s{_drsNextToken = a})
drsGameSessionQueues :: Lens' DescribeGameSessionQueuesResponse [GameSessionQueue]
drsGameSessionQueues = lens _drsGameSessionQueues (\ s a -> s{_drsGameSessionQueues = a}) . _Default . _Coerce
drsResponseStatus :: Lens' DescribeGameSessionQueuesResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a})
instance NFData DescribeGameSessionQueuesResponse
where