{-# 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.ElasticTranscoder.ReadJob
(
readJob
, ReadJob
, rjId
, readJobResponse
, ReadJobResponse
, rjrsResponseStatus
, rjrsJob
) where
import Network.AWS.ElasticTranscoder.Types
import Network.AWS.ElasticTranscoder.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ReadJob = ReadJob'
{ _rjId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
readJob
:: Text
-> ReadJob
readJob pId_ = ReadJob' {_rjId = pId_}
rjId :: Lens' ReadJob Text
rjId = lens _rjId (\ s a -> s{_rjId = a})
instance AWSRequest ReadJob where
type Rs ReadJob = ReadJobResponse
request = get elasticTranscoder
response
= receiveJSON
(\ s h x ->
ReadJobResponse' <$>
(pure (fromEnum s)) <*> (x .:> "Job"))
instance Hashable ReadJob where
instance NFData ReadJob where
instance ToHeaders ReadJob where
toHeaders = const mempty
instance ToPath ReadJob where
toPath ReadJob'{..}
= mconcat ["/2012-09-25/jobs/", toBS _rjId]
instance ToQuery ReadJob where
toQuery = const mempty
data ReadJobResponse = ReadJobResponse'
{ _rjrsResponseStatus :: !Int
, _rjrsJob :: !Job'
} deriving (Eq, Read, Show, Data, Typeable, Generic)
readJobResponse
:: Int
-> Job'
-> ReadJobResponse
readJobResponse pResponseStatus_ pJob_ =
ReadJobResponse' {_rjrsResponseStatus = pResponseStatus_, _rjrsJob = pJob_}
rjrsResponseStatus :: Lens' ReadJobResponse Int
rjrsResponseStatus = lens _rjrsResponseStatus (\ s a -> s{_rjrsResponseStatus = a})
rjrsJob :: Lens' ReadJobResponse Job'
rjrsJob = lens _rjrsJob (\ s a -> s{_rjrsJob = a})
instance NFData ReadJobResponse where