module Network.AWS.GameLift.UpdateFleetCapacity
(
updateFleetCapacity
, UpdateFleetCapacity
, ufcMaxSize
, ufcMinSize
, ufcDesiredInstances
, ufcFleetId
, updateFleetCapacityResponse
, UpdateFleetCapacityResponse
, ufcrsFleetId
, ufcrsResponseStatus
) 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 UpdateFleetCapacity = UpdateFleetCapacity'
{ _ufcMaxSize :: !(Maybe Nat)
, _ufcMinSize :: !(Maybe Nat)
, _ufcDesiredInstances :: !(Maybe Nat)
, _ufcFleetId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateFleetCapacity
:: Text
-> UpdateFleetCapacity
updateFleetCapacity pFleetId_ =
UpdateFleetCapacity'
{ _ufcMaxSize = Nothing
, _ufcMinSize = Nothing
, _ufcDesiredInstances = Nothing
, _ufcFleetId = pFleetId_
}
ufcMaxSize :: Lens' UpdateFleetCapacity (Maybe Natural)
ufcMaxSize = lens _ufcMaxSize (\ s a -> s{_ufcMaxSize = a}) . mapping _Nat;
ufcMinSize :: Lens' UpdateFleetCapacity (Maybe Natural)
ufcMinSize = lens _ufcMinSize (\ s a -> s{_ufcMinSize = a}) . mapping _Nat;
ufcDesiredInstances :: Lens' UpdateFleetCapacity (Maybe Natural)
ufcDesiredInstances = lens _ufcDesiredInstances (\ s a -> s{_ufcDesiredInstances = a}) . mapping _Nat;
ufcFleetId :: Lens' UpdateFleetCapacity Text
ufcFleetId = lens _ufcFleetId (\ s a -> s{_ufcFleetId = a});
instance AWSRequest UpdateFleetCapacity where
type Rs UpdateFleetCapacity =
UpdateFleetCapacityResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
UpdateFleetCapacityResponse' <$>
(x .?> "FleetId") <*> (pure (fromEnum s)))
instance Hashable UpdateFleetCapacity
instance NFData UpdateFleetCapacity
instance ToHeaders UpdateFleetCapacity where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.UpdateFleetCapacity" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateFleetCapacity where
toJSON UpdateFleetCapacity'{..}
= object
(catMaybes
[("MaxSize" .=) <$> _ufcMaxSize,
("MinSize" .=) <$> _ufcMinSize,
("DesiredInstances" .=) <$> _ufcDesiredInstances,
Just ("FleetId" .= _ufcFleetId)])
instance ToPath UpdateFleetCapacity where
toPath = const "/"
instance ToQuery UpdateFleetCapacity where
toQuery = const mempty
data UpdateFleetCapacityResponse = UpdateFleetCapacityResponse'
{ _ufcrsFleetId :: !(Maybe Text)
, _ufcrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateFleetCapacityResponse
:: Int
-> UpdateFleetCapacityResponse
updateFleetCapacityResponse pResponseStatus_ =
UpdateFleetCapacityResponse'
{ _ufcrsFleetId = Nothing
, _ufcrsResponseStatus = pResponseStatus_
}
ufcrsFleetId :: Lens' UpdateFleetCapacityResponse (Maybe Text)
ufcrsFleetId = lens _ufcrsFleetId (\ s a -> s{_ufcrsFleetId = a});
ufcrsResponseStatus :: Lens' UpdateFleetCapacityResponse Int
ufcrsResponseStatus = lens _ufcrsResponseStatus (\ s a -> s{_ufcrsResponseStatus = a});
instance NFData UpdateFleetCapacityResponse