{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Transcribe.GetTranscriptionJob
(
GetTranscriptionJob (..),
newGetTranscriptionJob,
getTranscriptionJob_transcriptionJobName,
GetTranscriptionJobResponse (..),
newGetTranscriptionJobResponse,
getTranscriptionJobResponse_transcriptionJob,
getTranscriptionJobResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transcribe.Types
data GetTranscriptionJob = GetTranscriptionJob'
{
GetTranscriptionJob -> Text
transcriptionJobName :: Prelude.Text
}
deriving (GetTranscriptionJob -> GetTranscriptionJob -> Bool
(GetTranscriptionJob -> GetTranscriptionJob -> Bool)
-> (GetTranscriptionJob -> GetTranscriptionJob -> Bool)
-> Eq GetTranscriptionJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTranscriptionJob -> GetTranscriptionJob -> Bool
$c/= :: GetTranscriptionJob -> GetTranscriptionJob -> Bool
== :: GetTranscriptionJob -> GetTranscriptionJob -> Bool
$c== :: GetTranscriptionJob -> GetTranscriptionJob -> Bool
Prelude.Eq, ReadPrec [GetTranscriptionJob]
ReadPrec GetTranscriptionJob
Int -> ReadS GetTranscriptionJob
ReadS [GetTranscriptionJob]
(Int -> ReadS GetTranscriptionJob)
-> ReadS [GetTranscriptionJob]
-> ReadPrec GetTranscriptionJob
-> ReadPrec [GetTranscriptionJob]
-> Read GetTranscriptionJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTranscriptionJob]
$creadListPrec :: ReadPrec [GetTranscriptionJob]
readPrec :: ReadPrec GetTranscriptionJob
$creadPrec :: ReadPrec GetTranscriptionJob
readList :: ReadS [GetTranscriptionJob]
$creadList :: ReadS [GetTranscriptionJob]
readsPrec :: Int -> ReadS GetTranscriptionJob
$creadsPrec :: Int -> ReadS GetTranscriptionJob
Prelude.Read, Int -> GetTranscriptionJob -> ShowS
[GetTranscriptionJob] -> ShowS
GetTranscriptionJob -> String
(Int -> GetTranscriptionJob -> ShowS)
-> (GetTranscriptionJob -> String)
-> ([GetTranscriptionJob] -> ShowS)
-> Show GetTranscriptionJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTranscriptionJob] -> ShowS
$cshowList :: [GetTranscriptionJob] -> ShowS
show :: GetTranscriptionJob -> String
$cshow :: GetTranscriptionJob -> String
showsPrec :: Int -> GetTranscriptionJob -> ShowS
$cshowsPrec :: Int -> GetTranscriptionJob -> ShowS
Prelude.Show, (forall x. GetTranscriptionJob -> Rep GetTranscriptionJob x)
-> (forall x. Rep GetTranscriptionJob x -> GetTranscriptionJob)
-> Generic GetTranscriptionJob
forall x. Rep GetTranscriptionJob x -> GetTranscriptionJob
forall x. GetTranscriptionJob -> Rep GetTranscriptionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTranscriptionJob x -> GetTranscriptionJob
$cfrom :: forall x. GetTranscriptionJob -> Rep GetTranscriptionJob x
Prelude.Generic)
newGetTranscriptionJob ::
Prelude.Text ->
GetTranscriptionJob
newGetTranscriptionJob :: Text -> GetTranscriptionJob
newGetTranscriptionJob Text
pTranscriptionJobName_ =
GetTranscriptionJob' :: Text -> GetTranscriptionJob
GetTranscriptionJob'
{ $sel:transcriptionJobName:GetTranscriptionJob' :: Text
transcriptionJobName =
Text
pTranscriptionJobName_
}
getTranscriptionJob_transcriptionJobName :: Lens.Lens' GetTranscriptionJob Prelude.Text
getTranscriptionJob_transcriptionJobName :: (Text -> f Text) -> GetTranscriptionJob -> f GetTranscriptionJob
getTranscriptionJob_transcriptionJobName = (GetTranscriptionJob -> Text)
-> (GetTranscriptionJob -> Text -> GetTranscriptionJob)
-> Lens GetTranscriptionJob GetTranscriptionJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTranscriptionJob' {Text
transcriptionJobName :: Text
$sel:transcriptionJobName:GetTranscriptionJob' :: GetTranscriptionJob -> Text
transcriptionJobName} -> Text
transcriptionJobName) (\s :: GetTranscriptionJob
s@GetTranscriptionJob' {} Text
a -> GetTranscriptionJob
s {$sel:transcriptionJobName:GetTranscriptionJob' :: Text
transcriptionJobName = Text
a} :: GetTranscriptionJob)
instance Core.AWSRequest GetTranscriptionJob where
type
AWSResponse GetTranscriptionJob =
GetTranscriptionJobResponse
request :: GetTranscriptionJob -> Request GetTranscriptionJob
request = Service -> GetTranscriptionJob -> Request GetTranscriptionJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetTranscriptionJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetTranscriptionJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetTranscriptionJob))
-> Logger
-> Service
-> Proxy GetTranscriptionJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetTranscriptionJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe TranscriptionJob -> Int -> GetTranscriptionJobResponse
GetTranscriptionJobResponse'
(Maybe TranscriptionJob -> Int -> GetTranscriptionJobResponse)
-> Either String (Maybe TranscriptionJob)
-> Either String (Int -> GetTranscriptionJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe TranscriptionJob)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TranscriptionJob")
Either String (Int -> GetTranscriptionJobResponse)
-> Either String Int -> Either String GetTranscriptionJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetTranscriptionJob
instance Prelude.NFData GetTranscriptionJob
instance Core.ToHeaders GetTranscriptionJob where
toHeaders :: GetTranscriptionJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetTranscriptionJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Transcribe.GetTranscriptionJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON GetTranscriptionJob where
toJSON :: GetTranscriptionJob -> Value
toJSON GetTranscriptionJob' {Text
transcriptionJobName :: Text
$sel:transcriptionJobName:GetTranscriptionJob' :: GetTranscriptionJob -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"TranscriptionJobName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
transcriptionJobName
)
]
)
instance Core.ToPath GetTranscriptionJob where
toPath :: GetTranscriptionJob -> ByteString
toPath = ByteString -> GetTranscriptionJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetTranscriptionJob where
toQuery :: GetTranscriptionJob -> QueryString
toQuery = QueryString -> GetTranscriptionJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetTranscriptionJobResponse = GetTranscriptionJobResponse'
{
GetTranscriptionJobResponse -> Maybe TranscriptionJob
transcriptionJob :: Prelude.Maybe TranscriptionJob,
GetTranscriptionJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetTranscriptionJobResponse -> GetTranscriptionJobResponse -> Bool
(GetTranscriptionJobResponse
-> GetTranscriptionJobResponse -> Bool)
-> (GetTranscriptionJobResponse
-> GetTranscriptionJobResponse -> Bool)
-> Eq GetTranscriptionJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTranscriptionJobResponse -> GetTranscriptionJobResponse -> Bool
$c/= :: GetTranscriptionJobResponse -> GetTranscriptionJobResponse -> Bool
== :: GetTranscriptionJobResponse -> GetTranscriptionJobResponse -> Bool
$c== :: GetTranscriptionJobResponse -> GetTranscriptionJobResponse -> Bool
Prelude.Eq, ReadPrec [GetTranscriptionJobResponse]
ReadPrec GetTranscriptionJobResponse
Int -> ReadS GetTranscriptionJobResponse
ReadS [GetTranscriptionJobResponse]
(Int -> ReadS GetTranscriptionJobResponse)
-> ReadS [GetTranscriptionJobResponse]
-> ReadPrec GetTranscriptionJobResponse
-> ReadPrec [GetTranscriptionJobResponse]
-> Read GetTranscriptionJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTranscriptionJobResponse]
$creadListPrec :: ReadPrec [GetTranscriptionJobResponse]
readPrec :: ReadPrec GetTranscriptionJobResponse
$creadPrec :: ReadPrec GetTranscriptionJobResponse
readList :: ReadS [GetTranscriptionJobResponse]
$creadList :: ReadS [GetTranscriptionJobResponse]
readsPrec :: Int -> ReadS GetTranscriptionJobResponse
$creadsPrec :: Int -> ReadS GetTranscriptionJobResponse
Prelude.Read, Int -> GetTranscriptionJobResponse -> ShowS
[GetTranscriptionJobResponse] -> ShowS
GetTranscriptionJobResponse -> String
(Int -> GetTranscriptionJobResponse -> ShowS)
-> (GetTranscriptionJobResponse -> String)
-> ([GetTranscriptionJobResponse] -> ShowS)
-> Show GetTranscriptionJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTranscriptionJobResponse] -> ShowS
$cshowList :: [GetTranscriptionJobResponse] -> ShowS
show :: GetTranscriptionJobResponse -> String
$cshow :: GetTranscriptionJobResponse -> String
showsPrec :: Int -> GetTranscriptionJobResponse -> ShowS
$cshowsPrec :: Int -> GetTranscriptionJobResponse -> ShowS
Prelude.Show, (forall x.
GetTranscriptionJobResponse -> Rep GetTranscriptionJobResponse x)
-> (forall x.
Rep GetTranscriptionJobResponse x -> GetTranscriptionJobResponse)
-> Generic GetTranscriptionJobResponse
forall x.
Rep GetTranscriptionJobResponse x -> GetTranscriptionJobResponse
forall x.
GetTranscriptionJobResponse -> Rep GetTranscriptionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTranscriptionJobResponse x -> GetTranscriptionJobResponse
$cfrom :: forall x.
GetTranscriptionJobResponse -> Rep GetTranscriptionJobResponse x
Prelude.Generic)
newGetTranscriptionJobResponse ::
Prelude.Int ->
GetTranscriptionJobResponse
newGetTranscriptionJobResponse :: Int -> GetTranscriptionJobResponse
newGetTranscriptionJobResponse Int
pHttpStatus_ =
GetTranscriptionJobResponse' :: Maybe TranscriptionJob -> Int -> GetTranscriptionJobResponse
GetTranscriptionJobResponse'
{ $sel:transcriptionJob:GetTranscriptionJobResponse' :: Maybe TranscriptionJob
transcriptionJob =
Maybe TranscriptionJob
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetTranscriptionJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getTranscriptionJobResponse_transcriptionJob :: Lens.Lens' GetTranscriptionJobResponse (Prelude.Maybe TranscriptionJob)
getTranscriptionJobResponse_transcriptionJob :: (Maybe TranscriptionJob -> f (Maybe TranscriptionJob))
-> GetTranscriptionJobResponse -> f GetTranscriptionJobResponse
getTranscriptionJobResponse_transcriptionJob = (GetTranscriptionJobResponse -> Maybe TranscriptionJob)
-> (GetTranscriptionJobResponse
-> Maybe TranscriptionJob -> GetTranscriptionJobResponse)
-> Lens
GetTranscriptionJobResponse
GetTranscriptionJobResponse
(Maybe TranscriptionJob)
(Maybe TranscriptionJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTranscriptionJobResponse' {Maybe TranscriptionJob
transcriptionJob :: Maybe TranscriptionJob
$sel:transcriptionJob:GetTranscriptionJobResponse' :: GetTranscriptionJobResponse -> Maybe TranscriptionJob
transcriptionJob} -> Maybe TranscriptionJob
transcriptionJob) (\s :: GetTranscriptionJobResponse
s@GetTranscriptionJobResponse' {} Maybe TranscriptionJob
a -> GetTranscriptionJobResponse
s {$sel:transcriptionJob:GetTranscriptionJobResponse' :: Maybe TranscriptionJob
transcriptionJob = Maybe TranscriptionJob
a} :: GetTranscriptionJobResponse)
getTranscriptionJobResponse_httpStatus :: Lens.Lens' GetTranscriptionJobResponse Prelude.Int
getTranscriptionJobResponse_httpStatus :: (Int -> f Int)
-> GetTranscriptionJobResponse -> f GetTranscriptionJobResponse
getTranscriptionJobResponse_httpStatus = (GetTranscriptionJobResponse -> Int)
-> (GetTranscriptionJobResponse
-> Int -> GetTranscriptionJobResponse)
-> Lens
GetTranscriptionJobResponse GetTranscriptionJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTranscriptionJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetTranscriptionJobResponse' :: GetTranscriptionJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetTranscriptionJobResponse
s@GetTranscriptionJobResponse' {} Int
a -> GetTranscriptionJobResponse
s {$sel:httpStatus:GetTranscriptionJobResponse' :: Int
httpStatus = Int
a} :: GetTranscriptionJobResponse)
instance Prelude.NFData GetTranscriptionJobResponse