{-# 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.Transcribe.GetTranscriptionJob
(
getTranscriptionJob
, GetTranscriptionJob
, gtjTranscriptionJobName
, getTranscriptionJobResponse
, GetTranscriptionJobResponse
, gtjrsTranscriptionJob
, gtjrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Transcribe.Types
import Network.AWS.Transcribe.Types.Product
newtype GetTranscriptionJob = GetTranscriptionJob'
{ _gtjTranscriptionJobName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getTranscriptionJob
:: Text
-> GetTranscriptionJob
getTranscriptionJob pTranscriptionJobName_ =
GetTranscriptionJob' {_gtjTranscriptionJobName = pTranscriptionJobName_}
gtjTranscriptionJobName :: Lens' GetTranscriptionJob Text
gtjTranscriptionJobName = lens _gtjTranscriptionJobName (\ s a -> s{_gtjTranscriptionJobName = a})
instance AWSRequest GetTranscriptionJob where
type Rs GetTranscriptionJob =
GetTranscriptionJobResponse
request = postJSON transcribe
response
= receiveJSON
(\ s h x ->
GetTranscriptionJobResponse' <$>
(x .?> "TranscriptionJob") <*> (pure (fromEnum s)))
instance Hashable GetTranscriptionJob where
instance NFData GetTranscriptionJob where
instance ToHeaders GetTranscriptionJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Transcribe.GetTranscriptionJob" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetTranscriptionJob where
toJSON GetTranscriptionJob'{..}
= object
(catMaybes
[Just
("TranscriptionJobName" .=
_gtjTranscriptionJobName)])
instance ToPath GetTranscriptionJob where
toPath = const "/"
instance ToQuery GetTranscriptionJob where
toQuery = const mempty
data GetTranscriptionJobResponse = GetTranscriptionJobResponse'
{ _gtjrsTranscriptionJob :: !(Maybe TranscriptionJob)
, _gtjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getTranscriptionJobResponse
:: Int
-> GetTranscriptionJobResponse
getTranscriptionJobResponse pResponseStatus_ =
GetTranscriptionJobResponse'
{_gtjrsTranscriptionJob = Nothing, _gtjrsResponseStatus = pResponseStatus_}
gtjrsTranscriptionJob :: Lens' GetTranscriptionJobResponse (Maybe TranscriptionJob)
gtjrsTranscriptionJob = lens _gtjrsTranscriptionJob (\ s a -> s{_gtjrsTranscriptionJob = a})
gtjrsResponseStatus :: Lens' GetTranscriptionJobResponse Int
gtjrsResponseStatus = lens _gtjrsResponseStatus (\ s a -> s{_gtjrsResponseStatus = a})
instance NFData GetTranscriptionJobResponse where