{-# 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.ListJobTemplates
(
listJobTemplates
, ListJobTemplates
, ljtCategory
, ljtListBy
, ljtNextToken
, ljtOrder
, ljtMaxResults
, listJobTemplatesResponse
, ListJobTemplatesResponse
, ljtrsJobTemplates
, ljtrsNextToken
, ljtrsResponseStatus
) 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 ListJobTemplates = ListJobTemplates'
{ _ljtCategory :: !(Maybe Text)
, _ljtListBy :: !(Maybe JobTemplateListBy)
, _ljtNextToken :: !(Maybe Text)
, _ljtOrder :: !(Maybe Order)
, _ljtMaxResults :: !(Maybe Int)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listJobTemplates
:: ListJobTemplates
listJobTemplates =
ListJobTemplates'
{ _ljtCategory = Nothing
, _ljtListBy = Nothing
, _ljtNextToken = Nothing
, _ljtOrder = Nothing
, _ljtMaxResults = Nothing
}
ljtCategory :: Lens' ListJobTemplates (Maybe Text)
ljtCategory = lens _ljtCategory (\ s a -> s{_ljtCategory = a})
ljtListBy :: Lens' ListJobTemplates (Maybe JobTemplateListBy)
ljtListBy = lens _ljtListBy (\ s a -> s{_ljtListBy = a})
ljtNextToken :: Lens' ListJobTemplates (Maybe Text)
ljtNextToken = lens _ljtNextToken (\ s a -> s{_ljtNextToken = a})
ljtOrder :: Lens' ListJobTemplates (Maybe Order)
ljtOrder = lens _ljtOrder (\ s a -> s{_ljtOrder = a})
ljtMaxResults :: Lens' ListJobTemplates (Maybe Int)
ljtMaxResults = lens _ljtMaxResults (\ s a -> s{_ljtMaxResults = a})
instance AWSRequest ListJobTemplates where
type Rs ListJobTemplates = ListJobTemplatesResponse
request = get mediaConvert
response
= receiveJSON
(\ s h x ->
ListJobTemplatesResponse' <$>
(x .?> "jobTemplates" .!@ mempty) <*>
(x .?> "nextToken")
<*> (pure (fromEnum s)))
instance Hashable ListJobTemplates where
instance NFData ListJobTemplates where
instance ToHeaders ListJobTemplates where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath ListJobTemplates where
toPath = const "/2017-08-29/jobTemplates"
instance ToQuery ListJobTemplates where
toQuery ListJobTemplates'{..}
= mconcat
["category" =: _ljtCategory, "listBy" =: _ljtListBy,
"nextToken" =: _ljtNextToken, "order" =: _ljtOrder,
"maxResults" =: _ljtMaxResults]
data ListJobTemplatesResponse = ListJobTemplatesResponse'
{ _ljtrsJobTemplates :: !(Maybe [JobTemplate])
, _ljtrsNextToken :: !(Maybe Text)
, _ljtrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listJobTemplatesResponse
:: Int
-> ListJobTemplatesResponse
listJobTemplatesResponse pResponseStatus_ =
ListJobTemplatesResponse'
{ _ljtrsJobTemplates = Nothing
, _ljtrsNextToken = Nothing
, _ljtrsResponseStatus = pResponseStatus_
}
ljtrsJobTemplates :: Lens' ListJobTemplatesResponse [JobTemplate]
ljtrsJobTemplates = lens _ljtrsJobTemplates (\ s a -> s{_ljtrsJobTemplates = a}) . _Default . _Coerce
ljtrsNextToken :: Lens' ListJobTemplatesResponse (Maybe Text)
ljtrsNextToken = lens _ljtrsNextToken (\ s a -> s{_ljtrsNextToken = a})
ljtrsResponseStatus :: Lens' ListJobTemplatesResponse Int
ljtrsResponseStatus = lens _ljtrsResponseStatus (\ s a -> s{_ljtrsResponseStatus = a})
instance NFData ListJobTemplatesResponse where