module Network.AWS.GameLift.DescribeScalingPolicies
(
describeScalingPolicies
, DescribeScalingPolicies
, dNextToken
, dStatusFilter
, dLimit
, dFleetId
, describeScalingPoliciesResponse
, DescribeScalingPoliciesResponse
, dsprsNextToken
, dsprsScalingPolicies
, dsprsResponseStatus
) 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 DescribeScalingPolicies = DescribeScalingPolicies'
{ _dNextToken :: !(Maybe Text)
, _dStatusFilter :: !(Maybe ScalingStatusType)
, _dLimit :: !(Maybe Nat)
, _dFleetId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeScalingPolicies
:: Text
-> DescribeScalingPolicies
describeScalingPolicies pFleetId_ =
DescribeScalingPolicies'
{ _dNextToken = Nothing
, _dStatusFilter = Nothing
, _dLimit = Nothing
, _dFleetId = pFleetId_
}
dNextToken :: Lens' DescribeScalingPolicies (Maybe Text)
dNextToken = lens _dNextToken (\ s a -> s{_dNextToken = a});
dStatusFilter :: Lens' DescribeScalingPolicies (Maybe ScalingStatusType)
dStatusFilter = lens _dStatusFilter (\ s a -> s{_dStatusFilter = a});
dLimit :: Lens' DescribeScalingPolicies (Maybe Natural)
dLimit = lens _dLimit (\ s a -> s{_dLimit = a}) . mapping _Nat;
dFleetId :: Lens' DescribeScalingPolicies Text
dFleetId = lens _dFleetId (\ s a -> s{_dFleetId = a});
instance AWSRequest DescribeScalingPolicies where
type Rs DescribeScalingPolicies =
DescribeScalingPoliciesResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
DescribeScalingPoliciesResponse' <$>
(x .?> "NextToken") <*>
(x .?> "ScalingPolicies" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeScalingPolicies
instance NFData DescribeScalingPolicies
instance ToHeaders DescribeScalingPolicies where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.DescribeScalingPolicies" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeScalingPolicies where
toJSON DescribeScalingPolicies'{..}
= object
(catMaybes
[("NextToken" .=) <$> _dNextToken,
("StatusFilter" .=) <$> _dStatusFilter,
("Limit" .=) <$> _dLimit,
Just ("FleetId" .= _dFleetId)])
instance ToPath DescribeScalingPolicies where
toPath = const "/"
instance ToQuery DescribeScalingPolicies where
toQuery = const mempty
data DescribeScalingPoliciesResponse = DescribeScalingPoliciesResponse'
{ _dsprsNextToken :: !(Maybe Text)
, _dsprsScalingPolicies :: !(Maybe [ScalingPolicy])
, _dsprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeScalingPoliciesResponse
:: Int
-> DescribeScalingPoliciesResponse
describeScalingPoliciesResponse pResponseStatus_ =
DescribeScalingPoliciesResponse'
{ _dsprsNextToken = Nothing
, _dsprsScalingPolicies = Nothing
, _dsprsResponseStatus = pResponseStatus_
}
dsprsNextToken :: Lens' DescribeScalingPoliciesResponse (Maybe Text)
dsprsNextToken = lens _dsprsNextToken (\ s a -> s{_dsprsNextToken = a});
dsprsScalingPolicies :: Lens' DescribeScalingPoliciesResponse [ScalingPolicy]
dsprsScalingPolicies = lens _dsprsScalingPolicies (\ s a -> s{_dsprsScalingPolicies = a}) . _Default . _Coerce;
dsprsResponseStatus :: Lens' DescribeScalingPoliciesResponse Int
dsprsResponseStatus = lens _dsprsResponseStatus (\ s a -> s{_dsprsResponseStatus = a});
instance NFData DescribeScalingPoliciesResponse