{-# 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.ECS.UpdateContainerAgent
(
updateContainerAgent
, UpdateContainerAgent
, ucaCluster
, ucaContainerInstance
, updateContainerAgentResponse
, UpdateContainerAgentResponse
, ucarsContainerInstance
, ucarsResponseStatus
) where
import Network.AWS.ECS.Types
import Network.AWS.ECS.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateContainerAgent = UpdateContainerAgent'
{ _ucaCluster :: !(Maybe Text)
, _ucaContainerInstance :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateContainerAgent
:: Text
-> UpdateContainerAgent
updateContainerAgent pContainerInstance_ =
UpdateContainerAgent'
{_ucaCluster = Nothing, _ucaContainerInstance = pContainerInstance_}
ucaCluster :: Lens' UpdateContainerAgent (Maybe Text)
ucaCluster = lens _ucaCluster (\ s a -> s{_ucaCluster = a})
ucaContainerInstance :: Lens' UpdateContainerAgent Text
ucaContainerInstance = lens _ucaContainerInstance (\ s a -> s{_ucaContainerInstance = a})
instance AWSRequest UpdateContainerAgent where
type Rs UpdateContainerAgent =
UpdateContainerAgentResponse
request = postJSON ecs
response
= receiveJSON
(\ s h x ->
UpdateContainerAgentResponse' <$>
(x .?> "containerInstance") <*> (pure (fromEnum s)))
instance Hashable UpdateContainerAgent where
instance NFData UpdateContainerAgent where
instance ToHeaders UpdateContainerAgent where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerServiceV20141113.UpdateContainerAgent"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateContainerAgent where
toJSON UpdateContainerAgent'{..}
= object
(catMaybes
[("cluster" .=) <$> _ucaCluster,
Just ("containerInstance" .= _ucaContainerInstance)])
instance ToPath UpdateContainerAgent where
toPath = const "/"
instance ToQuery UpdateContainerAgent where
toQuery = const mempty
data UpdateContainerAgentResponse = UpdateContainerAgentResponse'
{ _ucarsContainerInstance :: !(Maybe ContainerInstance)
, _ucarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateContainerAgentResponse
:: Int
-> UpdateContainerAgentResponse
updateContainerAgentResponse pResponseStatus_ =
UpdateContainerAgentResponse'
{_ucarsContainerInstance = Nothing, _ucarsResponseStatus = pResponseStatus_}
ucarsContainerInstance :: Lens' UpdateContainerAgentResponse (Maybe ContainerInstance)
ucarsContainerInstance = lens _ucarsContainerInstance (\ s a -> s{_ucarsContainerInstance = a})
ucarsResponseStatus :: Lens' UpdateContainerAgentResponse Int
ucarsResponseStatus = lens _ucarsResponseStatus (\ s a -> s{_ucarsResponseStatus = a})
instance NFData UpdateContainerAgentResponse where