module Network.AWS.GameLift.DescribeFleetUtilization
(
describeFleetUtilization
, DescribeFleetUtilization
, dfuNextToken
, dfuLimit
, dfuFleetIds
, describeFleetUtilizationResponse
, DescribeFleetUtilizationResponse
, dfursNextToken
, dfursFleetUtilization
, dfursResponseStatus
) 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 DescribeFleetUtilization = DescribeFleetUtilization'
{ _dfuNextToken :: !(Maybe Text)
, _dfuLimit :: !(Maybe Nat)
, _dfuFleetIds :: !(Maybe (List1 Text))
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeFleetUtilization
:: DescribeFleetUtilization
describeFleetUtilization =
DescribeFleetUtilization'
{ _dfuNextToken = Nothing
, _dfuLimit = Nothing
, _dfuFleetIds = Nothing
}
dfuNextToken :: Lens' DescribeFleetUtilization (Maybe Text)
dfuNextToken = lens _dfuNextToken (\ s a -> s{_dfuNextToken = a});
dfuLimit :: Lens' DescribeFleetUtilization (Maybe Natural)
dfuLimit = lens _dfuLimit (\ s a -> s{_dfuLimit = a}) . mapping _Nat;
dfuFleetIds :: Lens' DescribeFleetUtilization (Maybe (NonEmpty Text))
dfuFleetIds = lens _dfuFleetIds (\ s a -> s{_dfuFleetIds = a}) . mapping _List1;
instance AWSRequest DescribeFleetUtilization where
type Rs DescribeFleetUtilization =
DescribeFleetUtilizationResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
DescribeFleetUtilizationResponse' <$>
(x .?> "NextToken") <*>
(x .?> "FleetUtilization" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeFleetUtilization
instance NFData DescribeFleetUtilization
instance ToHeaders DescribeFleetUtilization where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.DescribeFleetUtilization" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeFleetUtilization where
toJSON DescribeFleetUtilization'{..}
= object
(catMaybes
[("NextToken" .=) <$> _dfuNextToken,
("Limit" .=) <$> _dfuLimit,
("FleetIds" .=) <$> _dfuFleetIds])
instance ToPath DescribeFleetUtilization where
toPath = const "/"
instance ToQuery DescribeFleetUtilization where
toQuery = const mempty
data DescribeFleetUtilizationResponse = DescribeFleetUtilizationResponse'
{ _dfursNextToken :: !(Maybe Text)
, _dfursFleetUtilization :: !(Maybe [FleetUtilization])
, _dfursResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeFleetUtilizationResponse
:: Int
-> DescribeFleetUtilizationResponse
describeFleetUtilizationResponse pResponseStatus_ =
DescribeFleetUtilizationResponse'
{ _dfursNextToken = Nothing
, _dfursFleetUtilization = Nothing
, _dfursResponseStatus = pResponseStatus_
}
dfursNextToken :: Lens' DescribeFleetUtilizationResponse (Maybe Text)
dfursNextToken = lens _dfursNextToken (\ s a -> s{_dfursNextToken = a});
dfursFleetUtilization :: Lens' DescribeFleetUtilizationResponse [FleetUtilization]
dfursFleetUtilization = lens _dfursFleetUtilization (\ s a -> s{_dfursFleetUtilization = a}) . _Default . _Coerce;
dfursResponseStatus :: Lens' DescribeFleetUtilizationResponse Int
dfursResponseStatus = lens _dfursResponseStatus (\ s a -> s{_dfursResponseStatus = a});
instance NFData DescribeFleetUtilizationResponse