{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
      { $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 :: Lens' DescribeFraudsterRegistrationJob Text
describeFraudsterRegistrationJob_domainId = 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 :: Lens' DescribeFraudsterRegistrationJob Text
describeFraudsterRegistrationJob_jobId = 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 :: (Service -> Service)
-> DescribeFraudsterRegistrationJob
-> Request DescribeFraudsterRegistrationJob
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeFraudsterRegistrationJob
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeFraudsterRegistrationJob)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe FraudsterRegistrationJob
-> Int -> DescribeFraudsterRegistrationJobResponse
DescribeFraudsterRegistrationJobResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Job")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DescribeFraudsterRegistrationJob
  where
  hashWithSalt :: Int -> DescribeFraudsterRegistrationJob -> Int
hashWithSalt
    Int
_salt
    DescribeFraudsterRegistrationJob' {Text
jobId :: Text
domainId :: Text
$sel:jobId:DescribeFraudsterRegistrationJob' :: DescribeFraudsterRegistrationJob -> Text
$sel:domainId:DescribeFraudsterRegistrationJob' :: DescribeFraudsterRegistrationJob -> Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId

instance
  Prelude.NFData
    DescribeFraudsterRegistrationJob
  where
  rnf :: DescribeFraudsterRegistrationJob -> ()
rnf DescribeFraudsterRegistrationJob' {Text
jobId :: Text
domainId :: Text
$sel:jobId:DescribeFraudsterRegistrationJob' :: DescribeFraudsterRegistrationJob -> Text
$sel:domainId:DescribeFraudsterRegistrationJob' :: DescribeFraudsterRegistrationJob -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
domainId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId

instance
  Data.ToHeaders
    DescribeFraudsterRegistrationJob
  where
  toHeaders :: DescribeFraudsterRegistrationJob -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"VoiceID.DescribeFraudsterRegistrationJob" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"DomainId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domainId),
            forall a. a -> Maybe a
Prelude.Just (Key
"JobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId)
          ]
      )

instance Data.ToPath DescribeFraudsterRegistrationJob where
  toPath :: DescribeFraudsterRegistrationJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Data.ToQuery
    DescribeFraudsterRegistrationJob
  where
  toQuery :: DescribeFraudsterRegistrationJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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
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.
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'
      { $sel:job:DescribeFraudsterRegistrationJobResponse' :: Maybe FraudsterRegistrationJob
job =
          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 :: Lens'
  DescribeFraudsterRegistrationJobResponse
  (Maybe FraudsterRegistrationJob)
describeFraudsterRegistrationJobResponse_job = 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 :: Lens' DescribeFraudsterRegistrationJobResponse Int
describeFraudsterRegistrationJobResponse_httpStatus = 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
  where
  rnf :: DescribeFraudsterRegistrationJobResponse -> ()
rnf DescribeFraudsterRegistrationJobResponse' {Int
Maybe FraudsterRegistrationJob
httpStatus :: Int
job :: Maybe FraudsterRegistrationJob
$sel:httpStatus:DescribeFraudsterRegistrationJobResponse' :: DescribeFraudsterRegistrationJobResponse -> Int
$sel:job:DescribeFraudsterRegistrationJobResponse' :: DescribeFraudsterRegistrationJobResponse
-> Maybe FraudsterRegistrationJob
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FraudsterRegistrationJob
job
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus