{-# 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.SSM.DescribeAutomationStepExecutions
(
describeAutomationStepExecutions
, DescribeAutomationStepExecutions
, daseFilters
, daseReverseOrder
, daseNextToken
, daseMaxResults
, daseAutomationExecutionId
, describeAutomationStepExecutionsResponse
, DescribeAutomationStepExecutionsResponse
, dasersNextToken
, dasersStepExecutions
, dasersResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SSM.Types
import Network.AWS.SSM.Types.Product
data DescribeAutomationStepExecutions = DescribeAutomationStepExecutions'
{ _daseFilters :: !(Maybe (List1 StepExecutionFilter))
, _daseReverseOrder :: !(Maybe Bool)
, _daseNextToken :: !(Maybe Text)
, _daseMaxResults :: !(Maybe Nat)
, _daseAutomationExecutionId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeAutomationStepExecutions
:: Text
-> DescribeAutomationStepExecutions
describeAutomationStepExecutions pAutomationExecutionId_ =
DescribeAutomationStepExecutions'
{ _daseFilters = Nothing
, _daseReverseOrder = Nothing
, _daseNextToken = Nothing
, _daseMaxResults = Nothing
, _daseAutomationExecutionId = pAutomationExecutionId_
}
daseFilters :: Lens' DescribeAutomationStepExecutions (Maybe (NonEmpty StepExecutionFilter))
daseFilters = lens _daseFilters (\ s a -> s{_daseFilters = a}) . mapping _List1
daseReverseOrder :: Lens' DescribeAutomationStepExecutions (Maybe Bool)
daseReverseOrder = lens _daseReverseOrder (\ s a -> s{_daseReverseOrder = a})
daseNextToken :: Lens' DescribeAutomationStepExecutions (Maybe Text)
daseNextToken = lens _daseNextToken (\ s a -> s{_daseNextToken = a})
daseMaxResults :: Lens' DescribeAutomationStepExecutions (Maybe Natural)
daseMaxResults = lens _daseMaxResults (\ s a -> s{_daseMaxResults = a}) . mapping _Nat
daseAutomationExecutionId :: Lens' DescribeAutomationStepExecutions Text
daseAutomationExecutionId = lens _daseAutomationExecutionId (\ s a -> s{_daseAutomationExecutionId = a})
instance AWSRequest DescribeAutomationStepExecutions
where
type Rs DescribeAutomationStepExecutions =
DescribeAutomationStepExecutionsResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
DescribeAutomationStepExecutionsResponse' <$>
(x .?> "NextToken") <*>
(x .?> "StepExecutions" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeAutomationStepExecutions
where
instance NFData DescribeAutomationStepExecutions
where
instance ToHeaders DescribeAutomationStepExecutions
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.DescribeAutomationStepExecutions" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeAutomationStepExecutions
where
toJSON DescribeAutomationStepExecutions'{..}
= object
(catMaybes
[("Filters" .=) <$> _daseFilters,
("ReverseOrder" .=) <$> _daseReverseOrder,
("NextToken" .=) <$> _daseNextToken,
("MaxResults" .=) <$> _daseMaxResults,
Just
("AutomationExecutionId" .=
_daseAutomationExecutionId)])
instance ToPath DescribeAutomationStepExecutions
where
toPath = const "/"
instance ToQuery DescribeAutomationStepExecutions
where
toQuery = const mempty
data DescribeAutomationStepExecutionsResponse = DescribeAutomationStepExecutionsResponse'
{ _dasersNextToken :: !(Maybe Text)
, _dasersStepExecutions :: !(Maybe [StepExecution])
, _dasersResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeAutomationStepExecutionsResponse
:: Int
-> DescribeAutomationStepExecutionsResponse
describeAutomationStepExecutionsResponse pResponseStatus_ =
DescribeAutomationStepExecutionsResponse'
{ _dasersNextToken = Nothing
, _dasersStepExecutions = Nothing
, _dasersResponseStatus = pResponseStatus_
}
dasersNextToken :: Lens' DescribeAutomationStepExecutionsResponse (Maybe Text)
dasersNextToken = lens _dasersNextToken (\ s a -> s{_dasersNextToken = a})
dasersStepExecutions :: Lens' DescribeAutomationStepExecutionsResponse [StepExecution]
dasersStepExecutions = lens _dasersStepExecutions (\ s a -> s{_dasersStepExecutions = a}) . _Default . _Coerce
dasersResponseStatus :: Lens' DescribeAutomationStepExecutionsResponse Int
dasersResponseStatus = lens _dasersResponseStatus (\ s a -> s{_dasersResponseStatus = a})
instance NFData
DescribeAutomationStepExecutionsResponse
where