module Network.AWS.GameLift.UpdateBuild
(
updateBuild
, UpdateBuild
, ubName
, ubVersion
, ubBuildId
, updateBuildResponse
, UpdateBuildResponse
, ubrsBuild
, ubrsResponseStatus
) 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 UpdateBuild = UpdateBuild'
{ _ubName :: !(Maybe Text)
, _ubVersion :: !(Maybe Text)
, _ubBuildId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateBuild
:: Text
-> UpdateBuild
updateBuild pBuildId_ =
UpdateBuild'
{ _ubName = Nothing
, _ubVersion = Nothing
, _ubBuildId = pBuildId_
}
ubName :: Lens' UpdateBuild (Maybe Text)
ubName = lens _ubName (\ s a -> s{_ubName = a});
ubVersion :: Lens' UpdateBuild (Maybe Text)
ubVersion = lens _ubVersion (\ s a -> s{_ubVersion = a});
ubBuildId :: Lens' UpdateBuild Text
ubBuildId = lens _ubBuildId (\ s a -> s{_ubBuildId = a});
instance AWSRequest UpdateBuild where
type Rs UpdateBuild = UpdateBuildResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
UpdateBuildResponse' <$>
(x .?> "Build") <*> (pure (fromEnum s)))
instance Hashable UpdateBuild
instance NFData UpdateBuild
instance ToHeaders UpdateBuild where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.UpdateBuild" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateBuild where
toJSON UpdateBuild'{..}
= object
(catMaybes
[("Name" .=) <$> _ubName,
("Version" .=) <$> _ubVersion,
Just ("BuildId" .= _ubBuildId)])
instance ToPath UpdateBuild where
toPath = const "/"
instance ToQuery UpdateBuild where
toQuery = const mempty
data UpdateBuildResponse = UpdateBuildResponse'
{ _ubrsBuild :: !(Maybe Build)
, _ubrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateBuildResponse
:: Int
-> UpdateBuildResponse
updateBuildResponse pResponseStatus_ =
UpdateBuildResponse'
{ _ubrsBuild = Nothing
, _ubrsResponseStatus = pResponseStatus_
}
ubrsBuild :: Lens' UpdateBuildResponse (Maybe Build)
ubrsBuild = lens _ubrsBuild (\ s a -> s{_ubrsBuild = a});
ubrsResponseStatus :: Lens' UpdateBuildResponse Int
ubrsResponseStatus = lens _ubrsResponseStatus (\ s a -> s{_ubrsResponseStatus = a});
instance NFData UpdateBuildResponse