{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.VoiceId.DescribeFraudsterRegistrationJob
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the specified fraudster registration job.
module Amazonka.VoiceId.DescribeFraudsterRegistrationJob
  ( -- * Creating a Request
    DescribeFraudsterRegistrationJob (..),
    newDescribeFraudsterRegistrationJob,

    -- * Request Lenses
    describeFraudsterRegistrationJob_domainId,
    describeFraudsterRegistrationJob_jobId,

    -- * Destructuring the Response
    DescribeFraudsterRegistrationJobResponse (..),
    newDescribeFraudsterRegistrationJobResponse,

    -- * Response Lenses
    describeFraudsterRegistrationJobResponse_job,
    describeFraudsterRegistrationJobResponse_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

-- | /See:/ 'newDescribeFraudsterRegistrationJob' smart constructor.
data DescribeFraudsterRegistrationJob = DescribeFraudsterRegistrationJob'
  { -- | The identifier for the domain containing the fraudster registration job.
    DescribeFraudsterRegistrationJob -> Text
domainId :: Prelude.Text,
    -- | The identifier for the fraudster registration job you are describing.
    DescribeFraudsterRegistrationJob -> Text
jobId :: Prelude.Text
  }
  deriving (DescribeFraudsterRegistrationJob
-> DescribeFraudsterRegistrationJob -> Bool
(DescribeFraudsterRegistrationJob
 -> DescribeFraudsterRegistrationJob -> Bool)
-> (DescribeFraudsterRegistrationJob
    -> DescribeFraudsterRegistrationJob -> Bool)
-> Eq DescribeFraudsterRegistrationJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFraudsterRegistrationJob
-> DescribeFraudsterRegistrationJob -> Bool
$c/= :: DescribeFraudsterRegistrationJob
-> DescribeFraudsterRegistrationJob -> Bool
== :: DescribeFraudsterRegistrationJob
-> DescribeFraudsterRegistrationJob -> Bool
$c== :: DescribeFraudsterRegistrationJob
-> DescribeFraudsterRegistrationJob -> Bool
Prelude.Eq, ReadPrec [DescribeFraudsterRegistrationJob]
ReadPrec DescribeFraudsterRegistrationJob
Int -> ReadS DescribeFraudsterRegistrationJob
ReadS [DescribeFraudsterRegistrationJob]
(Int -> ReadS DescribeFraudsterRegistrationJob)
-> ReadS [DescribeFraudsterRegistrationJob]
-> ReadPrec DescribeFraudsterRegistrationJob
-> ReadPrec [DescribeFraudsterRegistrationJob]
-> Read DescribeFraudsterRegistrationJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFraudsterRegistrationJob]
$creadListPrec :: ReadPrec [DescribeFraudsterRegistrationJob]
readPrec :: ReadPrec DescribeFraudsterRegistrationJob
$creadPrec :: ReadPrec DescribeFraudsterRegistrationJob
readList :: ReadS [DescribeFraudsterRegistrationJob]
$creadList :: ReadS [DescribeFraudsterRegistrationJob]
readsPrec :: Int -> ReadS DescribeFraudsterRegistrationJob
$creadsPrec :: Int -> ReadS DescribeFraudsterRegistrationJob
Prelude.Read, Int -> DescribeFraudsterRegistrationJob -> ShowS
[DescribeFraudsterRegistrationJob] -> ShowS
DescribeFraudsterRegistrationJob -> String
(Int -> DescribeFraudsterRegistrationJob -> ShowS)
-> (DescribeFraudsterRegistrationJob -> String)
-> ([DescribeFraudsterRegistrationJob] -> ShowS)
-> Show DescribeFraudsterRegistrationJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFraudsterRegistrationJob] -> ShowS
$cshowList :: [DescribeFraudsterRegistrationJob] -> ShowS
show :: DescribeFraudsterRegistrationJob -> String
$cshow :: DescribeFraudsterRegistrationJob -> String
showsPrec :: Int -> DescribeFraudsterRegistrationJob -> ShowS
$cshowsPrec :: Int -> DescribeFraudsterRegistrationJob -> ShowS
Prelude.Show, (forall x.
 DescribeFraudsterRegistrationJob
 -> Rep DescribeFraudsterRegistrationJob x)
-> (forall x.
    Rep DescribeFraudsterRegistrationJob x
    -> DescribeFraudsterRegistrationJob)
-> Generic DescribeFraudsterRegistrationJob
forall x.
Rep DescribeFraudsterRegistrationJob x
-> DescribeFraudsterRegistrationJob
forall x.
DescribeFraudsterRegistrationJob
-> Rep DescribeFraudsterRegistrationJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFraudsterRegistrationJob x
-> DescribeFraudsterRegistrationJob
$cfrom :: forall x.
DescribeFraudsterRegistrationJob
-> Rep DescribeFraudsterRegistrationJob x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFraudsterRegistrationJob' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'domainId', 'describeFraudsterRegistrationJob_domainId' - The identifier for the domain containing the fraudster registration job.
--
-- 'jobId', 'describeFraudsterRegistrationJob_jobId' - The identifier for the fraudster registration job you are describing.
newDescribeFraudsterRegistrationJob ::
  -- | 'domainId'
  Prelude.Text ->
  -- | 'jobId'
  Prelude.Text ->
  DescribeFraudsterRegistrationJob
newDescribeFraudsterRegistrationJob :: Text -> Text -> DescribeFraudsterRegistrationJob
newDescribeFraudsterRegistrationJob
  Text
pDomainId_
  Text
pJobId_ =
    DescribeFraudsterRegistrationJob' :: Text -> Text -> DescribeFraudsterRegistrationJob
DescribeFraudsterRegistrationJob'
      { $sel:domainId:DescribeFraudsterRegistrationJob' :: Text
domainId =
          Text
pDomainId_,
        $sel:jobId:DescribeFraudsterRegistrationJob' :: Text
jobId = Text
pJobId_
      }

-- | The identifier for the domain containing the fraudster registration job.
describeFraudsterRegistrationJob_domainId :: Lens.Lens' DescribeFraudsterRegistrationJob Prelude.Text
describeFraudsterRegistrationJob_domainId :: (Text -> f Text)
-> DescribeFraudsterRegistrationJob
-> f DescribeFraudsterRegistrationJob
describeFraudsterRegistrationJob_domainId = (DescribeFraudsterRegistrationJob -> Text)
-> (DescribeFraudsterRegistrationJob
    -> Text -> DescribeFraudsterRegistrationJob)
-> Lens
     DescribeFraudsterRegistrationJob
     DescribeFraudsterRegistrationJob
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFraudsterRegistrationJob' {Text
domainId :: Text
$sel:domainId:DescribeFraudsterRegistrationJob' :: DescribeFraudsterRegistrationJob -> Text
domainId} -> Text
domainId) (\s :: DescribeFraudsterRegistrationJob
s@DescribeFraudsterRegistrationJob' {} Text
a -> DescribeFraudsterRegistrationJob
s {$sel:domainId:DescribeFraudsterRegistrationJob' :: Text
domainId = Text
a} :: DescribeFraudsterRegistrationJob)

-- | The identifier for the fraudster registration job you are describing.
describeFraudsterRegistrationJob_jobId :: Lens.Lens' DescribeFraudsterRegistrationJob Prelude.Text
describeFraudsterRegistrationJob_jobId :: (Text -> f Text)
-> DescribeFraudsterRegistrationJob
-> f DescribeFraudsterRegistrationJob
describeFraudsterRegistrationJob_jobId = (DescribeFraudsterRegistrationJob -> Text)
-> (DescribeFraudsterRegistrationJob
    -> Text -> DescribeFraudsterRegistrationJob)
-> Lens
     DescribeFraudsterRegistrationJob
     DescribeFraudsterRegistrationJob
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFraudsterRegistrationJob' {Text
jobId :: Text
$sel:jobId:DescribeFraudsterRegistrationJob' :: DescribeFraudsterRegistrationJob -> Text
jobId} -> Text
jobId) (\s :: DescribeFraudsterRegistrationJob
s@DescribeFraudsterRegistrationJob' {} Text
a -> DescribeFraudsterRegistrationJob
s {$sel:jobId:DescribeFraudsterRegistrationJob' :: Text
jobId = Text
a} :: DescribeFraudsterRegistrationJob)

instance
  Core.AWSRequest
    DescribeFraudsterRegistrationJob
  where
  type
    AWSResponse DescribeFraudsterRegistrationJob =
      DescribeFraudsterRegistrationJobResponse
  request :: DescribeFraudsterRegistrationJob
-> Request DescribeFraudsterRegistrationJob
request = Service
-> DescribeFraudsterRegistrationJob
-> Request DescribeFraudsterRegistrationJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeFraudsterRegistrationJob
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeFraudsterRegistrationJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeFraudsterRegistrationJob))
-> Logger
-> Service
-> Proxy DescribeFraudsterRegistrationJob
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeFraudsterRegistrationJob)))
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 FraudsterRegistrationJob
-> Int -> DescribeFraudsterRegistrationJobResponse
DescribeFraudsterRegistrationJobResponse'
            (Maybe FraudsterRegistrationJob
 -> Int -> DescribeFraudsterRegistrationJobResponse)
-> Either String (Maybe FraudsterRegistrationJob)
-> Either String (Int -> DescribeFraudsterRegistrationJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe FraudsterRegistrationJob)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Job")
            Either String (Int -> DescribeFraudsterRegistrationJobResponse)
-> Either String Int
-> Either String DescribeFraudsterRegistrationJobResponse
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
    DescribeFraudsterRegistrationJob

instance
  Prelude.NFData
    DescribeFraudsterRegistrationJob

instance
  Core.ToHeaders
    DescribeFraudsterRegistrationJob
  where
  toHeaders :: DescribeFraudsterRegistrationJob -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DescribeFraudsterRegistrationJob -> 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.DescribeFraudsterRegistrationJob" ::
                          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 DescribeFraudsterRegistrationJob where
  toJSON :: DescribeFraudsterRegistrationJob -> Value
toJSON DescribeFraudsterRegistrationJob' {Text
jobId :: Text
domainId :: Text
$sel:jobId:DescribeFraudsterRegistrationJob' :: DescribeFraudsterRegistrationJob -> Text
$sel:domainId:DescribeFraudsterRegistrationJob' :: DescribeFraudsterRegistrationJob -> 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 DescribeFraudsterRegistrationJob where
  toPath :: DescribeFraudsterRegistrationJob -> ByteString
toPath = ByteString -> DescribeFraudsterRegistrationJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Core.ToQuery
    DescribeFraudsterRegistrationJob
  where
  toQuery :: DescribeFraudsterRegistrationJob -> QueryString
toQuery = QueryString -> DescribeFraudsterRegistrationJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeFraudsterRegistrationJobResponse' smart constructor.
data DescribeFraudsterRegistrationJobResponse = DescribeFraudsterRegistrationJobResponse'
  { -- | Contains details about the specified fraudster registration job.
    DescribeFraudsterRegistrationJobResponse
-> Maybe FraudsterRegistrationJob
job :: Prelude.Maybe FraudsterRegistrationJob,
    -- | The response's http status code.
    DescribeFraudsterRegistrationJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeFraudsterRegistrationJobResponse
-> DescribeFraudsterRegistrationJobResponse -> Bool
(DescribeFraudsterRegistrationJobResponse
 -> DescribeFraudsterRegistrationJobResponse -> Bool)
-> (DescribeFraudsterRegistrationJobResponse
    -> DescribeFraudsterRegistrationJobResponse -> Bool)
-> Eq DescribeFraudsterRegistrationJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFraudsterRegistrationJobResponse
-> DescribeFraudsterRegistrationJobResponse -> Bool
$c/= :: DescribeFraudsterRegistrationJobResponse
-> DescribeFraudsterRegistrationJobResponse -> Bool
== :: DescribeFraudsterRegistrationJobResponse
-> DescribeFraudsterRegistrationJobResponse -> Bool
$c== :: DescribeFraudsterRegistrationJobResponse
-> DescribeFraudsterRegistrationJobResponse -> Bool
Prelude.Eq, Int -> DescribeFraudsterRegistrationJobResponse -> ShowS
[DescribeFraudsterRegistrationJobResponse] -> ShowS
DescribeFraudsterRegistrationJobResponse -> String
(Int -> DescribeFraudsterRegistrationJobResponse -> ShowS)
-> (DescribeFraudsterRegistrationJobResponse -> String)
-> ([DescribeFraudsterRegistrationJobResponse] -> ShowS)
-> Show DescribeFraudsterRegistrationJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFraudsterRegistrationJobResponse] -> ShowS
$cshowList :: [DescribeFraudsterRegistrationJobResponse] -> ShowS
show :: DescribeFraudsterRegistrationJobResponse -> String
$cshow :: DescribeFraudsterRegistrationJobResponse -> String
showsPrec :: Int -> DescribeFraudsterRegistrationJobResponse -> ShowS
$cshowsPrec :: Int -> DescribeFraudsterRegistrationJobResponse -> ShowS
Prelude.Show, (forall x.
 DescribeFraudsterRegistrationJobResponse
 -> Rep DescribeFraudsterRegistrationJobResponse x)
-> (forall x.
    Rep DescribeFraudsterRegistrationJobResponse x
    -> DescribeFraudsterRegistrationJobResponse)
-> Generic DescribeFraudsterRegistrationJobResponse
forall x.
Rep DescribeFraudsterRegistrationJobResponse x
-> DescribeFraudsterRegistrationJobResponse
forall x.
DescribeFraudsterRegistrationJobResponse
-> Rep DescribeFraudsterRegistrationJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFraudsterRegistrationJobResponse x
-> DescribeFraudsterRegistrationJobResponse
$cfrom :: forall x.
DescribeFraudsterRegistrationJobResponse
-> Rep DescribeFraudsterRegistrationJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFraudsterRegistrationJobResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'job', 'describeFraudsterRegistrationJobResponse_job' - Contains details about the specified fraudster registration job.
--
-- 'httpStatus', 'describeFraudsterRegistrationJobResponse_httpStatus' - The response's http status code.
newDescribeFraudsterRegistrationJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeFraudsterRegistrationJobResponse
newDescribeFraudsterRegistrationJobResponse :: Int -> DescribeFraudsterRegistrationJobResponse
newDescribeFraudsterRegistrationJobResponse
  Int
pHttpStatus_ =
    DescribeFraudsterRegistrationJobResponse' :: Maybe FraudsterRegistrationJob
-> Int -> DescribeFraudsterRegistrationJobResponse
DescribeFraudsterRegistrationJobResponse'
      { $sel:job:DescribeFraudsterRegistrationJobResponse' :: Maybe FraudsterRegistrationJob
job =
          Maybe FraudsterRegistrationJob
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeFraudsterRegistrationJobResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Contains details about the specified fraudster registration job.
describeFraudsterRegistrationJobResponse_job :: Lens.Lens' DescribeFraudsterRegistrationJobResponse (Prelude.Maybe FraudsterRegistrationJob)
describeFraudsterRegistrationJobResponse_job :: (Maybe FraudsterRegistrationJob
 -> f (Maybe FraudsterRegistrationJob))
-> DescribeFraudsterRegistrationJobResponse
-> f DescribeFraudsterRegistrationJobResponse
describeFraudsterRegistrationJobResponse_job = (DescribeFraudsterRegistrationJobResponse
 -> Maybe FraudsterRegistrationJob)
-> (DescribeFraudsterRegistrationJobResponse
    -> Maybe FraudsterRegistrationJob
    -> DescribeFraudsterRegistrationJobResponse)
-> Lens
     DescribeFraudsterRegistrationJobResponse
     DescribeFraudsterRegistrationJobResponse
     (Maybe FraudsterRegistrationJob)
     (Maybe FraudsterRegistrationJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFraudsterRegistrationJobResponse' {Maybe FraudsterRegistrationJob
job :: Maybe FraudsterRegistrationJob
$sel:job:DescribeFraudsterRegistrationJobResponse' :: DescribeFraudsterRegistrationJobResponse
-> Maybe FraudsterRegistrationJob
job} -> Maybe FraudsterRegistrationJob
job) (\s :: DescribeFraudsterRegistrationJobResponse
s@DescribeFraudsterRegistrationJobResponse' {} Maybe FraudsterRegistrationJob
a -> DescribeFraudsterRegistrationJobResponse
s {$sel:job:DescribeFraudsterRegistrationJobResponse' :: Maybe FraudsterRegistrationJob
job = Maybe FraudsterRegistrationJob
a} :: DescribeFraudsterRegistrationJobResponse)

-- | The response's http status code.
describeFraudsterRegistrationJobResponse_httpStatus :: Lens.Lens' DescribeFraudsterRegistrationJobResponse Prelude.Int
describeFraudsterRegistrationJobResponse_httpStatus :: (Int -> f Int)
-> DescribeFraudsterRegistrationJobResponse
-> f DescribeFraudsterRegistrationJobResponse
describeFraudsterRegistrationJobResponse_httpStatus = (DescribeFraudsterRegistrationJobResponse -> Int)
-> (DescribeFraudsterRegistrationJobResponse
    -> Int -> DescribeFraudsterRegistrationJobResponse)
-> Lens
     DescribeFraudsterRegistrationJobResponse
     DescribeFraudsterRegistrationJobResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFraudsterRegistrationJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFraudsterRegistrationJobResponse' :: DescribeFraudsterRegistrationJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFraudsterRegistrationJobResponse
s@DescribeFraudsterRegistrationJobResponse' {} Int
a -> DescribeFraudsterRegistrationJobResponse
s {$sel:httpStatus:DescribeFraudsterRegistrationJobResponse' :: Int
httpStatus = Int
a} :: DescribeFraudsterRegistrationJobResponse)

instance
  Prelude.NFData
    DescribeFraudsterRegistrationJobResponse