{-# 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.IoT.ListJobExecutionsForJob
(
listJobExecutionsForJob
, ListJobExecutionsForJob
, ljefjStatus
, ljefjNextToken
, ljefjMaxResults
, ljefjJobId
, listJobExecutionsForJobResponse
, ListJobExecutionsForJobResponse
, ljefjrsExecutionSummaries
, ljefjrsNextToken
, ljefjrsResponseStatus
) where
import Network.AWS.IoT.Types
import Network.AWS.IoT.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListJobExecutionsForJob = ListJobExecutionsForJob'
{ _ljefjStatus :: !(Maybe JobExecutionStatus)
, _ljefjNextToken :: !(Maybe Text)
, _ljefjMaxResults :: !(Maybe Nat)
, _ljefjJobId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listJobExecutionsForJob
:: Text
-> ListJobExecutionsForJob
listJobExecutionsForJob pJobId_ =
ListJobExecutionsForJob'
{ _ljefjStatus = Nothing
, _ljefjNextToken = Nothing
, _ljefjMaxResults = Nothing
, _ljefjJobId = pJobId_
}
ljefjStatus :: Lens' ListJobExecutionsForJob (Maybe JobExecutionStatus)
ljefjStatus = lens _ljefjStatus (\ s a -> s{_ljefjStatus = a})
ljefjNextToken :: Lens' ListJobExecutionsForJob (Maybe Text)
ljefjNextToken = lens _ljefjNextToken (\ s a -> s{_ljefjNextToken = a})
ljefjMaxResults :: Lens' ListJobExecutionsForJob (Maybe Natural)
ljefjMaxResults = lens _ljefjMaxResults (\ s a -> s{_ljefjMaxResults = a}) . mapping _Nat
ljefjJobId :: Lens' ListJobExecutionsForJob Text
ljefjJobId = lens _ljefjJobId (\ s a -> s{_ljefjJobId = a})
instance AWSRequest ListJobExecutionsForJob where
type Rs ListJobExecutionsForJob =
ListJobExecutionsForJobResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
ListJobExecutionsForJobResponse' <$>
(x .?> "executionSummaries" .!@ mempty) <*>
(x .?> "nextToken")
<*> (pure (fromEnum s)))
instance Hashable ListJobExecutionsForJob where
instance NFData ListJobExecutionsForJob where
instance ToHeaders ListJobExecutionsForJob where
toHeaders = const mempty
instance ToPath ListJobExecutionsForJob where
toPath ListJobExecutionsForJob'{..}
= mconcat ["/jobs/", toBS _ljefjJobId, "/things"]
instance ToQuery ListJobExecutionsForJob where
toQuery ListJobExecutionsForJob'{..}
= mconcat
["status" =: _ljefjStatus,
"nextToken" =: _ljefjNextToken,
"maxResults" =: _ljefjMaxResults]
data ListJobExecutionsForJobResponse = ListJobExecutionsForJobResponse'
{ _ljefjrsExecutionSummaries :: !(Maybe [JobExecutionSummaryForJob])
, _ljefjrsNextToken :: !(Maybe Text)
, _ljefjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listJobExecutionsForJobResponse
:: Int
-> ListJobExecutionsForJobResponse
listJobExecutionsForJobResponse pResponseStatus_ =
ListJobExecutionsForJobResponse'
{ _ljefjrsExecutionSummaries = Nothing
, _ljefjrsNextToken = Nothing
, _ljefjrsResponseStatus = pResponseStatus_
}
ljefjrsExecutionSummaries :: Lens' ListJobExecutionsForJobResponse [JobExecutionSummaryForJob]
ljefjrsExecutionSummaries = lens _ljefjrsExecutionSummaries (\ s a -> s{_ljefjrsExecutionSummaries = a}) . _Default . _Coerce
ljefjrsNextToken :: Lens' ListJobExecutionsForJobResponse (Maybe Text)
ljefjrsNextToken = lens _ljefjrsNextToken (\ s a -> s{_ljefjrsNextToken = a})
ljefjrsResponseStatus :: Lens' ListJobExecutionsForJobResponse Int
ljefjrsResponseStatus = lens _ljefjrsResponseStatus (\ s a -> s{_ljefjrsResponseStatus = a})
instance NFData ListJobExecutionsForJobResponse where