module Network.AWS.ECS.SubmitContainerStateChange
(
submitContainerStateChange
, SubmitContainerStateChange
, scscNetworkBindings
, scscStatus
, scscCluster
, scscContainerName
, scscReason
, scscExitCode
, scscTask
, submitContainerStateChangeResponse
, SubmitContainerStateChangeResponse
, scscrsAcknowledgment
, scscrsStatus
) where
import Network.AWS.ECS.Types
import Network.AWS.ECS.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data SubmitContainerStateChange = SubmitContainerStateChange'
{ _scscNetworkBindings :: !(Maybe [NetworkBinding])
, _scscStatus :: !(Maybe Text)
, _scscCluster :: !(Maybe Text)
, _scscContainerName :: !(Maybe Text)
, _scscReason :: !(Maybe Text)
, _scscExitCode :: !(Maybe Int)
, _scscTask :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
submitContainerStateChange
:: SubmitContainerStateChange
submitContainerStateChange =
SubmitContainerStateChange'
{ _scscNetworkBindings = Nothing
, _scscStatus = Nothing
, _scscCluster = Nothing
, _scscContainerName = Nothing
, _scscReason = Nothing
, _scscExitCode = Nothing
, _scscTask = Nothing
}
scscNetworkBindings :: Lens' SubmitContainerStateChange [NetworkBinding]
scscNetworkBindings = lens _scscNetworkBindings (\ s a -> s{_scscNetworkBindings = a}) . _Default . _Coerce;
scscStatus :: Lens' SubmitContainerStateChange (Maybe Text)
scscStatus = lens _scscStatus (\ s a -> s{_scscStatus = a});
scscCluster :: Lens' SubmitContainerStateChange (Maybe Text)
scscCluster = lens _scscCluster (\ s a -> s{_scscCluster = a});
scscContainerName :: Lens' SubmitContainerStateChange (Maybe Text)
scscContainerName = lens _scscContainerName (\ s a -> s{_scscContainerName = a});
scscReason :: Lens' SubmitContainerStateChange (Maybe Text)
scscReason = lens _scscReason (\ s a -> s{_scscReason = a});
scscExitCode :: Lens' SubmitContainerStateChange (Maybe Int)
scscExitCode = lens _scscExitCode (\ s a -> s{_scscExitCode = a});
scscTask :: Lens' SubmitContainerStateChange (Maybe Text)
scscTask = lens _scscTask (\ s a -> s{_scscTask = a});
instance AWSRequest SubmitContainerStateChange where
type Sv SubmitContainerStateChange = ECS
type Rs SubmitContainerStateChange =
SubmitContainerStateChangeResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
SubmitContainerStateChangeResponse' <$>
(x .?> "acknowledgment") <*> (pure (fromEnum s)))
instance ToHeaders SubmitContainerStateChange where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerServiceV20141113.SubmitContainerStateChange"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON SubmitContainerStateChange where
toJSON SubmitContainerStateChange'{..}
= object
["networkBindings" .= _scscNetworkBindings,
"status" .= _scscStatus, "cluster" .= _scscCluster,
"containerName" .= _scscContainerName,
"reason" .= _scscReason, "exitCode" .= _scscExitCode,
"task" .= _scscTask]
instance ToPath SubmitContainerStateChange where
toPath = const "/"
instance ToQuery SubmitContainerStateChange where
toQuery = const mempty
data SubmitContainerStateChangeResponse = SubmitContainerStateChangeResponse'
{ _scscrsAcknowledgment :: !(Maybe Text)
, _scscrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
submitContainerStateChangeResponse
:: Int
-> SubmitContainerStateChangeResponse
submitContainerStateChangeResponse pStatus_ =
SubmitContainerStateChangeResponse'
{ _scscrsAcknowledgment = Nothing
, _scscrsStatus = pStatus_
}
scscrsAcknowledgment :: Lens' SubmitContainerStateChangeResponse (Maybe Text)
scscrsAcknowledgment = lens _scscrsAcknowledgment (\ s a -> s{_scscrsAcknowledgment = a});
scscrsStatus :: Lens' SubmitContainerStateChangeResponse Int
scscrsStatus = lens _scscrsStatus (\ s a -> s{_scscrsStatus = a});