{-# 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.VoiceId.DescribeSpeakerEnrollmentJob
(
DescribeSpeakerEnrollmentJob (..),
newDescribeSpeakerEnrollmentJob,
describeSpeakerEnrollmentJob_domainId,
describeSpeakerEnrollmentJob_jobId,
DescribeSpeakerEnrollmentJobResponse (..),
newDescribeSpeakerEnrollmentJobResponse,
describeSpeakerEnrollmentJobResponse_job,
describeSpeakerEnrollmentJobResponse_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.VoiceId.Types
data DescribeSpeakerEnrollmentJob = DescribeSpeakerEnrollmentJob'
{
DescribeSpeakerEnrollmentJob -> Text
domainId :: Prelude.Text,
DescribeSpeakerEnrollmentJob -> Text
jobId :: Prelude.Text
}
deriving (DescribeSpeakerEnrollmentJob
-> DescribeSpeakerEnrollmentJob -> Bool
(DescribeSpeakerEnrollmentJob
-> DescribeSpeakerEnrollmentJob -> Bool)
-> (DescribeSpeakerEnrollmentJob
-> DescribeSpeakerEnrollmentJob -> Bool)
-> Eq DescribeSpeakerEnrollmentJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSpeakerEnrollmentJob
-> DescribeSpeakerEnrollmentJob -> Bool
$c/= :: DescribeSpeakerEnrollmentJob
-> DescribeSpeakerEnrollmentJob -> Bool
== :: DescribeSpeakerEnrollmentJob
-> DescribeSpeakerEnrollmentJob -> Bool
$c== :: DescribeSpeakerEnrollmentJob
-> DescribeSpeakerEnrollmentJob -> Bool
Prelude.Eq, ReadPrec [DescribeSpeakerEnrollmentJob]
ReadPrec DescribeSpeakerEnrollmentJob
Int -> ReadS DescribeSpeakerEnrollmentJob
ReadS [DescribeSpeakerEnrollmentJob]
(Int -> ReadS DescribeSpeakerEnrollmentJob)
-> ReadS [DescribeSpeakerEnrollmentJob]
-> ReadPrec DescribeSpeakerEnrollmentJob
-> ReadPrec [DescribeSpeakerEnrollmentJob]
-> Read DescribeSpeakerEnrollmentJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSpeakerEnrollmentJob]
$creadListPrec :: ReadPrec [DescribeSpeakerEnrollmentJob]
readPrec :: ReadPrec DescribeSpeakerEnrollmentJob
$creadPrec :: ReadPrec DescribeSpeakerEnrollmentJob
readList :: ReadS [DescribeSpeakerEnrollmentJob]
$creadList :: ReadS [DescribeSpeakerEnrollmentJob]
readsPrec :: Int -> ReadS DescribeSpeakerEnrollmentJob
$creadsPrec :: Int -> ReadS DescribeSpeakerEnrollmentJob
Prelude.Read, Int -> DescribeSpeakerEnrollmentJob -> ShowS
[DescribeSpeakerEnrollmentJob] -> ShowS
DescribeSpeakerEnrollmentJob -> String
(Int -> DescribeSpeakerEnrollmentJob -> ShowS)
-> (DescribeSpeakerEnrollmentJob -> String)
-> ([DescribeSpeakerEnrollmentJob] -> ShowS)
-> Show DescribeSpeakerEnrollmentJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSpeakerEnrollmentJob] -> ShowS
$cshowList :: [DescribeSpeakerEnrollmentJob] -> ShowS
show :: DescribeSpeakerEnrollmentJob -> String
$cshow :: DescribeSpeakerEnrollmentJob -> String
showsPrec :: Int -> DescribeSpeakerEnrollmentJob -> ShowS
$cshowsPrec :: Int -> DescribeSpeakerEnrollmentJob -> ShowS
Prelude.Show, (forall x.
DescribeSpeakerEnrollmentJob -> Rep DescribeSpeakerEnrollmentJob x)
-> (forall x.
Rep DescribeSpeakerEnrollmentJob x -> DescribeSpeakerEnrollmentJob)
-> Generic DescribeSpeakerEnrollmentJob
forall x.
Rep DescribeSpeakerEnrollmentJob x -> DescribeSpeakerEnrollmentJob
forall x.
DescribeSpeakerEnrollmentJob -> Rep DescribeSpeakerEnrollmentJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSpeakerEnrollmentJob x -> DescribeSpeakerEnrollmentJob
$cfrom :: forall x.
DescribeSpeakerEnrollmentJob -> Rep DescribeSpeakerEnrollmentJob x
Prelude.Generic)
newDescribeSpeakerEnrollmentJob ::
Prelude.Text ->
Prelude.Text ->
DescribeSpeakerEnrollmentJob
newDescribeSpeakerEnrollmentJob :: Text -> Text -> DescribeSpeakerEnrollmentJob
newDescribeSpeakerEnrollmentJob Text
pDomainId_ Text
pJobId_ =
DescribeSpeakerEnrollmentJob' :: Text -> Text -> DescribeSpeakerEnrollmentJob
DescribeSpeakerEnrollmentJob'
{ $sel:domainId:DescribeSpeakerEnrollmentJob' :: Text
domainId =
Text
pDomainId_,
$sel:jobId:DescribeSpeakerEnrollmentJob' :: Text
jobId = Text
pJobId_
}
describeSpeakerEnrollmentJob_domainId :: Lens.Lens' DescribeSpeakerEnrollmentJob Prelude.Text
describeSpeakerEnrollmentJob_domainId :: (Text -> f Text)
-> DescribeSpeakerEnrollmentJob -> f DescribeSpeakerEnrollmentJob
describeSpeakerEnrollmentJob_domainId = (DescribeSpeakerEnrollmentJob -> Text)
-> (DescribeSpeakerEnrollmentJob
-> Text -> DescribeSpeakerEnrollmentJob)
-> Lens
DescribeSpeakerEnrollmentJob DescribeSpeakerEnrollmentJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSpeakerEnrollmentJob' {Text
domainId :: Text
$sel:domainId:DescribeSpeakerEnrollmentJob' :: DescribeSpeakerEnrollmentJob -> Text
domainId} -> Text
domainId) (\s :: DescribeSpeakerEnrollmentJob
s@DescribeSpeakerEnrollmentJob' {} Text
a -> DescribeSpeakerEnrollmentJob
s {$sel:domainId:DescribeSpeakerEnrollmentJob' :: Text
domainId = Text
a} :: DescribeSpeakerEnrollmentJob)
describeSpeakerEnrollmentJob_jobId :: Lens.Lens' DescribeSpeakerEnrollmentJob Prelude.Text
describeSpeakerEnrollmentJob_jobId :: (Text -> f Text)
-> DescribeSpeakerEnrollmentJob -> f DescribeSpeakerEnrollmentJob
describeSpeakerEnrollmentJob_jobId = (DescribeSpeakerEnrollmentJob -> Text)
-> (DescribeSpeakerEnrollmentJob
-> Text -> DescribeSpeakerEnrollmentJob)
-> Lens
DescribeSpeakerEnrollmentJob DescribeSpeakerEnrollmentJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSpeakerEnrollmentJob' {Text
jobId :: Text
$sel:jobId:DescribeSpeakerEnrollmentJob' :: DescribeSpeakerEnrollmentJob -> Text
jobId} -> Text
jobId) (\s :: DescribeSpeakerEnrollmentJob
s@DescribeSpeakerEnrollmentJob' {} Text
a -> DescribeSpeakerEnrollmentJob
s {$sel:jobId:DescribeSpeakerEnrollmentJob' :: Text
jobId = Text
a} :: DescribeSpeakerEnrollmentJob)
instance Core.AWSRequest DescribeSpeakerEnrollmentJob where
type
AWSResponse DescribeSpeakerEnrollmentJob =
DescribeSpeakerEnrollmentJobResponse
request :: DescribeSpeakerEnrollmentJob
-> Request DescribeSpeakerEnrollmentJob
request = Service
-> DescribeSpeakerEnrollmentJob
-> Request DescribeSpeakerEnrollmentJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeSpeakerEnrollmentJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeSpeakerEnrollmentJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeSpeakerEnrollmentJob))
-> Logger
-> Service
-> Proxy DescribeSpeakerEnrollmentJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeSpeakerEnrollmentJob)))
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 SpeakerEnrollmentJob
-> Int -> DescribeSpeakerEnrollmentJobResponse
DescribeSpeakerEnrollmentJobResponse'
(Maybe SpeakerEnrollmentJob
-> Int -> DescribeSpeakerEnrollmentJobResponse)
-> Either String (Maybe SpeakerEnrollmentJob)
-> Either String (Int -> DescribeSpeakerEnrollmentJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe SpeakerEnrollmentJob)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Job")
Either String (Int -> DescribeSpeakerEnrollmentJobResponse)
-> Either String Int
-> Either String DescribeSpeakerEnrollmentJobResponse
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
DescribeSpeakerEnrollmentJob
instance Prelude.NFData DescribeSpeakerEnrollmentJob
instance Core.ToHeaders DescribeSpeakerEnrollmentJob where
toHeaders :: DescribeSpeakerEnrollmentJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeSpeakerEnrollmentJob -> 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
"VoiceID.DescribeSpeakerEnrollmentJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeSpeakerEnrollmentJob where
toJSON :: DescribeSpeakerEnrollmentJob -> Value
toJSON DescribeSpeakerEnrollmentJob' {Text
jobId :: Text
domainId :: Text
$sel:jobId:DescribeSpeakerEnrollmentJob' :: DescribeSpeakerEnrollmentJob -> Text
$sel:domainId:DescribeSpeakerEnrollmentJob' :: DescribeSpeakerEnrollmentJob -> 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
"DomainId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domainId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"JobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobId)
]
)
instance Core.ToPath DescribeSpeakerEnrollmentJob where
toPath :: DescribeSpeakerEnrollmentJob -> ByteString
toPath = ByteString -> DescribeSpeakerEnrollmentJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeSpeakerEnrollmentJob where
toQuery :: DescribeSpeakerEnrollmentJob -> QueryString
toQuery = QueryString -> DescribeSpeakerEnrollmentJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeSpeakerEnrollmentJobResponse = DescribeSpeakerEnrollmentJobResponse'
{
DescribeSpeakerEnrollmentJobResponse -> Maybe SpeakerEnrollmentJob
job :: Prelude.Maybe SpeakerEnrollmentJob,
DescribeSpeakerEnrollmentJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeSpeakerEnrollmentJobResponse
-> DescribeSpeakerEnrollmentJobResponse -> Bool
(DescribeSpeakerEnrollmentJobResponse
-> DescribeSpeakerEnrollmentJobResponse -> Bool)
-> (DescribeSpeakerEnrollmentJobResponse
-> DescribeSpeakerEnrollmentJobResponse -> Bool)
-> Eq DescribeSpeakerEnrollmentJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSpeakerEnrollmentJobResponse
-> DescribeSpeakerEnrollmentJobResponse -> Bool
$c/= :: DescribeSpeakerEnrollmentJobResponse
-> DescribeSpeakerEnrollmentJobResponse -> Bool
== :: DescribeSpeakerEnrollmentJobResponse
-> DescribeSpeakerEnrollmentJobResponse -> Bool
$c== :: DescribeSpeakerEnrollmentJobResponse
-> DescribeSpeakerEnrollmentJobResponse -> Bool
Prelude.Eq, Int -> DescribeSpeakerEnrollmentJobResponse -> ShowS
[DescribeSpeakerEnrollmentJobResponse] -> ShowS
DescribeSpeakerEnrollmentJobResponse -> String
(Int -> DescribeSpeakerEnrollmentJobResponse -> ShowS)
-> (DescribeSpeakerEnrollmentJobResponse -> String)
-> ([DescribeSpeakerEnrollmentJobResponse] -> ShowS)
-> Show DescribeSpeakerEnrollmentJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSpeakerEnrollmentJobResponse] -> ShowS
$cshowList :: [DescribeSpeakerEnrollmentJobResponse] -> ShowS
show :: DescribeSpeakerEnrollmentJobResponse -> String
$cshow :: DescribeSpeakerEnrollmentJobResponse -> String
showsPrec :: Int -> DescribeSpeakerEnrollmentJobResponse -> ShowS
$cshowsPrec :: Int -> DescribeSpeakerEnrollmentJobResponse -> ShowS
Prelude.Show, (forall x.
DescribeSpeakerEnrollmentJobResponse
-> Rep DescribeSpeakerEnrollmentJobResponse x)
-> (forall x.
Rep DescribeSpeakerEnrollmentJobResponse x
-> DescribeSpeakerEnrollmentJobResponse)
-> Generic DescribeSpeakerEnrollmentJobResponse
forall x.
Rep DescribeSpeakerEnrollmentJobResponse x
-> DescribeSpeakerEnrollmentJobResponse
forall x.
DescribeSpeakerEnrollmentJobResponse
-> Rep DescribeSpeakerEnrollmentJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSpeakerEnrollmentJobResponse x
-> DescribeSpeakerEnrollmentJobResponse
$cfrom :: forall x.
DescribeSpeakerEnrollmentJobResponse
-> Rep DescribeSpeakerEnrollmentJobResponse x
Prelude.Generic)
newDescribeSpeakerEnrollmentJobResponse ::
Prelude.Int ->
DescribeSpeakerEnrollmentJobResponse
newDescribeSpeakerEnrollmentJobResponse :: Int -> DescribeSpeakerEnrollmentJobResponse
newDescribeSpeakerEnrollmentJobResponse Int
pHttpStatus_ =
DescribeSpeakerEnrollmentJobResponse' :: Maybe SpeakerEnrollmentJob
-> Int -> DescribeSpeakerEnrollmentJobResponse
DescribeSpeakerEnrollmentJobResponse'
{ $sel:job:DescribeSpeakerEnrollmentJobResponse' :: Maybe SpeakerEnrollmentJob
job =
Maybe SpeakerEnrollmentJob
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeSpeakerEnrollmentJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeSpeakerEnrollmentJobResponse_job :: Lens.Lens' DescribeSpeakerEnrollmentJobResponse (Prelude.Maybe SpeakerEnrollmentJob)
describeSpeakerEnrollmentJobResponse_job :: (Maybe SpeakerEnrollmentJob -> f (Maybe SpeakerEnrollmentJob))
-> DescribeSpeakerEnrollmentJobResponse
-> f DescribeSpeakerEnrollmentJobResponse
describeSpeakerEnrollmentJobResponse_job = (DescribeSpeakerEnrollmentJobResponse
-> Maybe SpeakerEnrollmentJob)
-> (DescribeSpeakerEnrollmentJobResponse
-> Maybe SpeakerEnrollmentJob
-> DescribeSpeakerEnrollmentJobResponse)
-> Lens
DescribeSpeakerEnrollmentJobResponse
DescribeSpeakerEnrollmentJobResponse
(Maybe SpeakerEnrollmentJob)
(Maybe SpeakerEnrollmentJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSpeakerEnrollmentJobResponse' {Maybe SpeakerEnrollmentJob
job :: Maybe SpeakerEnrollmentJob
$sel:job:DescribeSpeakerEnrollmentJobResponse' :: DescribeSpeakerEnrollmentJobResponse -> Maybe SpeakerEnrollmentJob
job} -> Maybe SpeakerEnrollmentJob
job) (\s :: DescribeSpeakerEnrollmentJobResponse
s@DescribeSpeakerEnrollmentJobResponse' {} Maybe SpeakerEnrollmentJob
a -> DescribeSpeakerEnrollmentJobResponse
s {$sel:job:DescribeSpeakerEnrollmentJobResponse' :: Maybe SpeakerEnrollmentJob
job = Maybe SpeakerEnrollmentJob
a} :: DescribeSpeakerEnrollmentJobResponse)
describeSpeakerEnrollmentJobResponse_httpStatus :: Lens.Lens' DescribeSpeakerEnrollmentJobResponse Prelude.Int
describeSpeakerEnrollmentJobResponse_httpStatus :: (Int -> f Int)
-> DescribeSpeakerEnrollmentJobResponse
-> f DescribeSpeakerEnrollmentJobResponse
describeSpeakerEnrollmentJobResponse_httpStatus = (DescribeSpeakerEnrollmentJobResponse -> Int)
-> (DescribeSpeakerEnrollmentJobResponse
-> Int -> DescribeSpeakerEnrollmentJobResponse)
-> Lens
DescribeSpeakerEnrollmentJobResponse
DescribeSpeakerEnrollmentJobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSpeakerEnrollmentJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeSpeakerEnrollmentJobResponse' :: DescribeSpeakerEnrollmentJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeSpeakerEnrollmentJobResponse
s@DescribeSpeakerEnrollmentJobResponse' {} Int
a -> DescribeSpeakerEnrollmentJobResponse
s {$sel:httpStatus:DescribeSpeakerEnrollmentJobResponse' :: Int
httpStatus = Int
a} :: DescribeSpeakerEnrollmentJobResponse)
instance
Prelude.NFData
DescribeSpeakerEnrollmentJobResponse