{-# 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.GetJob
(
getJob
, GetJob
, gjId
, getJobResponse
, GetJobResponse
, gjrsJob
, gjrsResponseStatus
) 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
newtype GetJob = GetJob'
{ _gjId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJob
:: Text
-> GetJob
getJob pId_ = GetJob' {_gjId = pId_}
gjId :: Lens' GetJob Text
gjId = lens _gjId (\ s a -> s{_gjId = a})
instance AWSRequest GetJob where
type Rs GetJob = GetJobResponse
request = get mediaConvert
response
= receiveJSON
(\ s h x ->
GetJobResponse' <$>
(x .?> "job") <*> (pure (fromEnum s)))
instance Hashable GetJob where
instance NFData GetJob where
instance ToHeaders GetJob where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetJob where
toPath GetJob'{..}
= mconcat ["/2017-08-29/jobs/", toBS _gjId]
instance ToQuery GetJob where
toQuery = const mempty
data GetJobResponse = GetJobResponse'
{ _gjrsJob :: !(Maybe Job)
, _gjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobResponse
:: Int
-> GetJobResponse
getJobResponse pResponseStatus_ =
GetJobResponse' {_gjrsJob = Nothing, _gjrsResponseStatus = pResponseStatus_}
gjrsJob :: Lens' GetJobResponse (Maybe Job)
gjrsJob = lens _gjrsJob (\ s a -> s{_gjrsJob = a})
gjrsResponseStatus :: Lens' GetJobResponse Int
gjrsResponseStatus = lens _gjrsResponseStatus (\ s a -> s{_gjrsResponseStatus = a})
instance NFData GetJobResponse where