{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Batch.UpdateJobQueue
(
updateJobQueue
, UpdateJobQueue
, ujqState
, ujqPriority
, ujqComputeEnvironmentOrder
, ujqJobQueue
, updateJobQueueResponse
, UpdateJobQueueResponse
, ujqrsJobQueueARN
, ujqrsJobQueueName
, ujqrsResponseStatus
) where
import Network.AWS.Batch.Types
import Network.AWS.Batch.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateJobQueue = UpdateJobQueue'
{ _ujqState :: !(Maybe JQState)
, _ujqPriority :: !(Maybe Int)
, _ujqComputeEnvironmentOrder :: !(Maybe [ComputeEnvironmentOrder])
, _ujqJobQueue :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateJobQueue
:: Text
-> UpdateJobQueue
updateJobQueue pJobQueue_ =
UpdateJobQueue'
{ _ujqState = Nothing
, _ujqPriority = Nothing
, _ujqComputeEnvironmentOrder = Nothing
, _ujqJobQueue = pJobQueue_
}
ujqState :: Lens' UpdateJobQueue (Maybe JQState)
ujqState = lens _ujqState (\ s a -> s{_ujqState = a})
ujqPriority :: Lens' UpdateJobQueue (Maybe Int)
ujqPriority = lens _ujqPriority (\ s a -> s{_ujqPriority = a})
ujqComputeEnvironmentOrder :: Lens' UpdateJobQueue [ComputeEnvironmentOrder]
ujqComputeEnvironmentOrder = lens _ujqComputeEnvironmentOrder (\ s a -> s{_ujqComputeEnvironmentOrder = a}) . _Default . _Coerce
ujqJobQueue :: Lens' UpdateJobQueue Text
ujqJobQueue = lens _ujqJobQueue (\ s a -> s{_ujqJobQueue = a})
instance AWSRequest UpdateJobQueue where
type Rs UpdateJobQueue = UpdateJobQueueResponse
request = postJSON batch
response
= receiveJSON
(\ s h x ->
UpdateJobQueueResponse' <$>
(x .?> "jobQueueArn") <*> (x .?> "jobQueueName") <*>
(pure (fromEnum s)))
instance Hashable UpdateJobQueue where
instance NFData UpdateJobQueue where
instance ToHeaders UpdateJobQueue where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateJobQueue where
toJSON UpdateJobQueue'{..}
= object
(catMaybes
[("state" .=) <$> _ujqState,
("priority" .=) <$> _ujqPriority,
("computeEnvironmentOrder" .=) <$>
_ujqComputeEnvironmentOrder,
Just ("jobQueue" .= _ujqJobQueue)])
instance ToPath UpdateJobQueue where
toPath = const "/v1/updatejobqueue"
instance ToQuery UpdateJobQueue where
toQuery = const mempty
data UpdateJobQueueResponse = UpdateJobQueueResponse'
{ _ujqrsJobQueueARN :: !(Maybe Text)
, _ujqrsJobQueueName :: !(Maybe Text)
, _ujqrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateJobQueueResponse
:: Int
-> UpdateJobQueueResponse
updateJobQueueResponse pResponseStatus_ =
UpdateJobQueueResponse'
{ _ujqrsJobQueueARN = Nothing
, _ujqrsJobQueueName = Nothing
, _ujqrsResponseStatus = pResponseStatus_
}
ujqrsJobQueueARN :: Lens' UpdateJobQueueResponse (Maybe Text)
ujqrsJobQueueARN = lens _ujqrsJobQueueARN (\ s a -> s{_ujqrsJobQueueARN = a})
ujqrsJobQueueName :: Lens' UpdateJobQueueResponse (Maybe Text)
ujqrsJobQueueName = lens _ujqrsJobQueueName (\ s a -> s{_ujqrsJobQueueName = a})
ujqrsResponseStatus :: Lens' UpdateJobQueueResponse Int
ujqrsResponseStatus = lens _ujqrsResponseStatus (\ s a -> s{_ujqrsResponseStatus = a})
instance NFData UpdateJobQueueResponse where