module Network.AWS.GameLift.UpdateFleetAttributes
(
updateFleetAttributes
, UpdateFleetAttributes
, ufaNewGameSessionProtectionPolicy
, ufaName
, ufaDescription
, ufaFleetId
, updateFleetAttributesResponse
, UpdateFleetAttributesResponse
, ufarsFleetId
, ufarsResponseStatus
) 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 UpdateFleetAttributes = UpdateFleetAttributes'
{ _ufaNewGameSessionProtectionPolicy :: !(Maybe ProtectionPolicy)
, _ufaName :: !(Maybe Text)
, _ufaDescription :: !(Maybe Text)
, _ufaFleetId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateFleetAttributes
:: Text
-> UpdateFleetAttributes
updateFleetAttributes pFleetId_ =
UpdateFleetAttributes'
{ _ufaNewGameSessionProtectionPolicy = Nothing
, _ufaName = Nothing
, _ufaDescription = Nothing
, _ufaFleetId = pFleetId_
}
ufaNewGameSessionProtectionPolicy :: Lens' UpdateFleetAttributes (Maybe ProtectionPolicy)
ufaNewGameSessionProtectionPolicy = lens _ufaNewGameSessionProtectionPolicy (\ s a -> s{_ufaNewGameSessionProtectionPolicy = a});
ufaName :: Lens' UpdateFleetAttributes (Maybe Text)
ufaName = lens _ufaName (\ s a -> s{_ufaName = a});
ufaDescription :: Lens' UpdateFleetAttributes (Maybe Text)
ufaDescription = lens _ufaDescription (\ s a -> s{_ufaDescription = a});
ufaFleetId :: Lens' UpdateFleetAttributes Text
ufaFleetId = lens _ufaFleetId (\ s a -> s{_ufaFleetId = a});
instance AWSRequest UpdateFleetAttributes where
type Rs UpdateFleetAttributes =
UpdateFleetAttributesResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
UpdateFleetAttributesResponse' <$>
(x .?> "FleetId") <*> (pure (fromEnum s)))
instance Hashable UpdateFleetAttributes
instance NFData UpdateFleetAttributes
instance ToHeaders UpdateFleetAttributes where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.UpdateFleetAttributes" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateFleetAttributes where
toJSON UpdateFleetAttributes'{..}
= object
(catMaybes
[("NewGameSessionProtectionPolicy" .=) <$>
_ufaNewGameSessionProtectionPolicy,
("Name" .=) <$> _ufaName,
("Description" .=) <$> _ufaDescription,
Just ("FleetId" .= _ufaFleetId)])
instance ToPath UpdateFleetAttributes where
toPath = const "/"
instance ToQuery UpdateFleetAttributes where
toQuery = const mempty
data UpdateFleetAttributesResponse = UpdateFleetAttributesResponse'
{ _ufarsFleetId :: !(Maybe Text)
, _ufarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateFleetAttributesResponse
:: Int
-> UpdateFleetAttributesResponse
updateFleetAttributesResponse pResponseStatus_ =
UpdateFleetAttributesResponse'
{ _ufarsFleetId = Nothing
, _ufarsResponseStatus = pResponseStatus_
}
ufarsFleetId :: Lens' UpdateFleetAttributesResponse (Maybe Text)
ufarsFleetId = lens _ufarsFleetId (\ s a -> s{_ufarsFleetId = a});
ufarsResponseStatus :: Lens' UpdateFleetAttributesResponse Int
ufarsResponseStatus = lens _ufarsResponseStatus (\ s a -> s{_ufarsResponseStatus = a});
instance NFData UpdateFleetAttributesResponse