{-# 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.MediaConvert.ListJobs
(
listJobs
, ListJobs
, ljStatus
, ljQueue
, ljNextToken
, ljOrder
, ljMaxResults
, listJobsResponse
, ListJobsResponse
, ljrsNextToken
, ljrsJobs
, ljrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MediaConvert.Types
import Network.AWS.MediaConvert.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListJobs = ListJobs'
{ _ljStatus :: !(Maybe JobStatus)
, _ljQueue :: !(Maybe Text)
, _ljNextToken :: !(Maybe Text)
, _ljOrder :: !(Maybe Order)
, _ljMaxResults :: !(Maybe Int)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listJobs
:: ListJobs
listJobs =
ListJobs'
{ _ljStatus = Nothing
, _ljQueue = Nothing
, _ljNextToken = Nothing
, _ljOrder = Nothing
, _ljMaxResults = Nothing
}
ljStatus :: Lens' ListJobs (Maybe JobStatus)
ljStatus = lens _ljStatus (\ s a -> s{_ljStatus = a})
ljQueue :: Lens' ListJobs (Maybe Text)
ljQueue = lens _ljQueue (\ s a -> s{_ljQueue = a})
ljNextToken :: Lens' ListJobs (Maybe Text)
ljNextToken = lens _ljNextToken (\ s a -> s{_ljNextToken = a})
ljOrder :: Lens' ListJobs (Maybe Order)
ljOrder = lens _ljOrder (\ s a -> s{_ljOrder = a})
ljMaxResults :: Lens' ListJobs (Maybe Int)
ljMaxResults = lens _ljMaxResults (\ s a -> s{_ljMaxResults = a})
instance AWSRequest ListJobs where
type Rs ListJobs = ListJobsResponse
request = get mediaConvert
response
= receiveJSON
(\ s h x ->
ListJobsResponse' <$>
(x .?> "nextToken") <*> (x .?> "jobs" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable ListJobs where
instance NFData ListJobs where
instance ToHeaders ListJobs where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath ListJobs where
toPath = const "/2017-08-29/jobs"
instance ToQuery ListJobs where
toQuery ListJobs'{..}
= mconcat
["status" =: _ljStatus, "queue" =: _ljQueue,
"nextToken" =: _ljNextToken, "order" =: _ljOrder,
"maxResults" =: _ljMaxResults]
data ListJobsResponse = ListJobsResponse'
{ _ljrsNextToken :: !(Maybe Text)
, _ljrsJobs :: !(Maybe [Job])
, _ljrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listJobsResponse
:: Int
-> ListJobsResponse
listJobsResponse pResponseStatus_ =
ListJobsResponse'
{ _ljrsNextToken = Nothing
, _ljrsJobs = Nothing
, _ljrsResponseStatus = pResponseStatus_
}
ljrsNextToken :: Lens' ListJobsResponse (Maybe Text)
ljrsNextToken = lens _ljrsNextToken (\ s a -> s{_ljrsNextToken = a})
ljrsJobs :: Lens' ListJobsResponse [Job]
ljrsJobs = lens _ljrsJobs (\ s a -> s{_ljrsJobs = a}) . _Default . _Coerce
ljrsResponseStatus :: Lens' ListJobsResponse Int
ljrsResponseStatus = lens _ljrsResponseStatus (\ s a -> s{_ljrsResponseStatus = a})
instance NFData ListJobsResponse where