{-# 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.StartFraudsterRegistrationJob
-- 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)
--
-- Starts a new batch fraudster registration job using provided details.
module Amazonka.VoiceId.StartFraudsterRegistrationJob
  ( -- * Creating a Request
    StartFraudsterRegistrationJob (..),
    newStartFraudsterRegistrationJob,

    -- * Request Lenses
    startFraudsterRegistrationJob_clientToken,
    startFraudsterRegistrationJob_jobName,
    startFraudsterRegistrationJob_registrationConfig,
    startFraudsterRegistrationJob_dataAccessRoleArn,
    startFraudsterRegistrationJob_domainId,
    startFraudsterRegistrationJob_inputDataConfig,
    startFraudsterRegistrationJob_outputDataConfig,

    -- * Destructuring the Response
    StartFraudsterRegistrationJobResponse (..),
    newStartFraudsterRegistrationJobResponse,

    -- * Response Lenses
    startFraudsterRegistrationJobResponse_job,
    startFraudsterRegistrationJobResponse_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:/ 'newStartFraudsterRegistrationJob' smart constructor.
data StartFraudsterRegistrationJob = StartFraudsterRegistrationJob'
  { -- | The idempotency token for starting a new fraudster registration job. If
    -- not provided, Amazon Web Services SDK populates this field.
    StartFraudsterRegistrationJob -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the new fraudster registration job.
    StartFraudsterRegistrationJob -> Maybe (Sensitive Text)
jobName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The registration config containing details such as the action to take
    -- when a duplicate fraudster is detected, and the similarity threshold to
    -- use for detecting a duplicate fraudster.
    StartFraudsterRegistrationJob -> Maybe RegistrationConfig
registrationConfig :: Prelude.Maybe RegistrationConfig,
    -- | The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions
    -- to access customer\'s buckets to read the input manifest file and write
    -- the Job output file. Refer to the
    -- <https://docs.aws.amazon.com/connect/latest/adminguide/voiceid-fraudster-watchlist.html Create and edit a fraudster watchlist>
    -- documentation for the permissions needed in this role.
    StartFraudsterRegistrationJob -> Text
dataAccessRoleArn :: Prelude.Text,
    -- | The identifier of the domain containing the fraudster registration job
    -- and in which the fraudsters are registered.
    StartFraudsterRegistrationJob -> Text
domainId :: Prelude.Text,
    -- | The input data config containing an S3 URI for the input manifest file
    -- that contains the list of fraudster registration requests.
    StartFraudsterRegistrationJob -> InputDataConfig
inputDataConfig :: InputDataConfig,
    -- | The output data config containing the S3 location where Voice ID writes
    -- the job output file; you must also include a KMS Key ID to encrypt the
    -- file.
    StartFraudsterRegistrationJob -> OutputDataConfig
outputDataConfig :: OutputDataConfig
  }
  deriving (StartFraudsterRegistrationJob
-> StartFraudsterRegistrationJob -> Bool
(StartFraudsterRegistrationJob
 -> StartFraudsterRegistrationJob -> Bool)
-> (StartFraudsterRegistrationJob
    -> StartFraudsterRegistrationJob -> Bool)
-> Eq StartFraudsterRegistrationJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartFraudsterRegistrationJob
-> StartFraudsterRegistrationJob -> Bool
$c/= :: StartFraudsterRegistrationJob
-> StartFraudsterRegistrationJob -> Bool
== :: StartFraudsterRegistrationJob
-> StartFraudsterRegistrationJob -> Bool
$c== :: StartFraudsterRegistrationJob
-> StartFraudsterRegistrationJob -> Bool
Prelude.Eq, Int -> StartFraudsterRegistrationJob -> ShowS
[StartFraudsterRegistrationJob] -> ShowS
StartFraudsterRegistrationJob -> String
(Int -> StartFraudsterRegistrationJob -> ShowS)
-> (StartFraudsterRegistrationJob -> String)
-> ([StartFraudsterRegistrationJob] -> ShowS)
-> Show StartFraudsterRegistrationJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartFraudsterRegistrationJob] -> ShowS
$cshowList :: [StartFraudsterRegistrationJob] -> ShowS
show :: StartFraudsterRegistrationJob -> String
$cshow :: StartFraudsterRegistrationJob -> String
showsPrec :: Int -> StartFraudsterRegistrationJob -> ShowS
$cshowsPrec :: Int -> StartFraudsterRegistrationJob -> ShowS
Prelude.Show, (forall x.
 StartFraudsterRegistrationJob
 -> Rep StartFraudsterRegistrationJob x)
-> (forall x.
    Rep StartFraudsterRegistrationJob x
    -> StartFraudsterRegistrationJob)
-> Generic StartFraudsterRegistrationJob
forall x.
Rep StartFraudsterRegistrationJob x
-> StartFraudsterRegistrationJob
forall x.
StartFraudsterRegistrationJob
-> Rep StartFraudsterRegistrationJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartFraudsterRegistrationJob x
-> StartFraudsterRegistrationJob
$cfrom :: forall x.
StartFraudsterRegistrationJob
-> Rep StartFraudsterRegistrationJob x
Prelude.Generic)

-- |
-- Create a value of 'StartFraudsterRegistrationJob' 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:
--
-- 'clientToken', 'startFraudsterRegistrationJob_clientToken' - The idempotency token for starting a new fraudster registration job. If
-- not provided, Amazon Web Services SDK populates this field.
--
-- 'jobName', 'startFraudsterRegistrationJob_jobName' - The name of the new fraudster registration job.
--
-- 'registrationConfig', 'startFraudsterRegistrationJob_registrationConfig' - The registration config containing details such as the action to take
-- when a duplicate fraudster is detected, and the similarity threshold to
-- use for detecting a duplicate fraudster.
--
-- 'dataAccessRoleArn', 'startFraudsterRegistrationJob_dataAccessRoleArn' - The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions
-- to access customer\'s buckets to read the input manifest file and write
-- the Job output file. Refer to the
-- <https://docs.aws.amazon.com/connect/latest/adminguide/voiceid-fraudster-watchlist.html Create and edit a fraudster watchlist>
-- documentation for the permissions needed in this role.
--
-- 'domainId', 'startFraudsterRegistrationJob_domainId' - The identifier of the domain containing the fraudster registration job
-- and in which the fraudsters are registered.
--
-- 'inputDataConfig', 'startFraudsterRegistrationJob_inputDataConfig' - The input data config containing an S3 URI for the input manifest file
-- that contains the list of fraudster registration requests.
--
-- 'outputDataConfig', 'startFraudsterRegistrationJob_outputDataConfig' - The output data config containing the S3 location where Voice ID writes
-- the job output file; you must also include a KMS Key ID to encrypt the
-- file.
newStartFraudsterRegistrationJob ::
  -- | 'dataAccessRoleArn'
  Prelude.Text ->
  -- | 'domainId'
  Prelude.Text ->
  -- | 'inputDataConfig'
  InputDataConfig ->
  -- | 'outputDataConfig'
  OutputDataConfig ->
  StartFraudsterRegistrationJob
newStartFraudsterRegistrationJob :: Text
-> Text
-> InputDataConfig
-> OutputDataConfig
-> StartFraudsterRegistrationJob
newStartFraudsterRegistrationJob
  Text
pDataAccessRoleArn_
  Text
pDomainId_
  InputDataConfig
pInputDataConfig_
  OutputDataConfig
pOutputDataConfig_ =
    StartFraudsterRegistrationJob' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe RegistrationConfig
-> Text
-> Text
-> InputDataConfig
-> OutputDataConfig
-> StartFraudsterRegistrationJob
StartFraudsterRegistrationJob'
      { $sel:clientToken:StartFraudsterRegistrationJob' :: Maybe Text
clientToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:jobName:StartFraudsterRegistrationJob' :: Maybe (Sensitive Text)
jobName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:registrationConfig:StartFraudsterRegistrationJob' :: Maybe RegistrationConfig
registrationConfig = Maybe RegistrationConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:dataAccessRoleArn:StartFraudsterRegistrationJob' :: Text
dataAccessRoleArn = Text
pDataAccessRoleArn_,
        $sel:domainId:StartFraudsterRegistrationJob' :: Text
domainId = Text
pDomainId_,
        $sel:inputDataConfig:StartFraudsterRegistrationJob' :: InputDataConfig
inputDataConfig = InputDataConfig
pInputDataConfig_,
        $sel:outputDataConfig:StartFraudsterRegistrationJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
pOutputDataConfig_
      }

-- | The idempotency token for starting a new fraudster registration job. If
-- not provided, Amazon Web Services SDK populates this field.
startFraudsterRegistrationJob_clientToken :: Lens.Lens' StartFraudsterRegistrationJob (Prelude.Maybe Prelude.Text)
startFraudsterRegistrationJob_clientToken :: (Maybe Text -> f (Maybe Text))
-> StartFraudsterRegistrationJob -> f StartFraudsterRegistrationJob
startFraudsterRegistrationJob_clientToken = (StartFraudsterRegistrationJob -> Maybe Text)
-> (StartFraudsterRegistrationJob
    -> Maybe Text -> StartFraudsterRegistrationJob)
-> Lens
     StartFraudsterRegistrationJob
     StartFraudsterRegistrationJob
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFraudsterRegistrationJob' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: StartFraudsterRegistrationJob
s@StartFraudsterRegistrationJob' {} Maybe Text
a -> StartFraudsterRegistrationJob
s {$sel:clientToken:StartFraudsterRegistrationJob' :: Maybe Text
clientToken = Maybe Text
a} :: StartFraudsterRegistrationJob)

-- | The name of the new fraudster registration job.
startFraudsterRegistrationJob_jobName :: Lens.Lens' StartFraudsterRegistrationJob (Prelude.Maybe Prelude.Text)
startFraudsterRegistrationJob_jobName :: (Maybe Text -> f (Maybe Text))
-> StartFraudsterRegistrationJob -> f StartFraudsterRegistrationJob
startFraudsterRegistrationJob_jobName = (StartFraudsterRegistrationJob -> Maybe (Sensitive Text))
-> (StartFraudsterRegistrationJob
    -> Maybe (Sensitive Text) -> StartFraudsterRegistrationJob)
-> Lens
     StartFraudsterRegistrationJob
     StartFraudsterRegistrationJob
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFraudsterRegistrationJob' {Maybe (Sensitive Text)
jobName :: Maybe (Sensitive Text)
$sel:jobName:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Maybe (Sensitive Text)
jobName} -> Maybe (Sensitive Text)
jobName) (\s :: StartFraudsterRegistrationJob
s@StartFraudsterRegistrationJob' {} Maybe (Sensitive Text)
a -> StartFraudsterRegistrationJob
s {$sel:jobName:StartFraudsterRegistrationJob' :: Maybe (Sensitive Text)
jobName = Maybe (Sensitive Text)
a} :: StartFraudsterRegistrationJob) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> StartFraudsterRegistrationJob
 -> f StartFraudsterRegistrationJob)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> StartFraudsterRegistrationJob
-> f StartFraudsterRegistrationJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The registration config containing details such as the action to take
-- when a duplicate fraudster is detected, and the similarity threshold to
-- use for detecting a duplicate fraudster.
startFraudsterRegistrationJob_registrationConfig :: Lens.Lens' StartFraudsterRegistrationJob (Prelude.Maybe RegistrationConfig)
startFraudsterRegistrationJob_registrationConfig :: (Maybe RegistrationConfig -> f (Maybe RegistrationConfig))
-> StartFraudsterRegistrationJob -> f StartFraudsterRegistrationJob
startFraudsterRegistrationJob_registrationConfig = (StartFraudsterRegistrationJob -> Maybe RegistrationConfig)
-> (StartFraudsterRegistrationJob
    -> Maybe RegistrationConfig -> StartFraudsterRegistrationJob)
-> Lens
     StartFraudsterRegistrationJob
     StartFraudsterRegistrationJob
     (Maybe RegistrationConfig)
     (Maybe RegistrationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFraudsterRegistrationJob' {Maybe RegistrationConfig
registrationConfig :: Maybe RegistrationConfig
$sel:registrationConfig:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Maybe RegistrationConfig
registrationConfig} -> Maybe RegistrationConfig
registrationConfig) (\s :: StartFraudsterRegistrationJob
s@StartFraudsterRegistrationJob' {} Maybe RegistrationConfig
a -> StartFraudsterRegistrationJob
s {$sel:registrationConfig:StartFraudsterRegistrationJob' :: Maybe RegistrationConfig
registrationConfig = Maybe RegistrationConfig
a} :: StartFraudsterRegistrationJob)

-- | The IAM role Amazon Resource Name (ARN) that grants Voice ID permissions
-- to access customer\'s buckets to read the input manifest file and write
-- the Job output file. Refer to the
-- <https://docs.aws.amazon.com/connect/latest/adminguide/voiceid-fraudster-watchlist.html Create and edit a fraudster watchlist>
-- documentation for the permissions needed in this role.
startFraudsterRegistrationJob_dataAccessRoleArn :: Lens.Lens' StartFraudsterRegistrationJob Prelude.Text
startFraudsterRegistrationJob_dataAccessRoleArn :: (Text -> f Text)
-> StartFraudsterRegistrationJob -> f StartFraudsterRegistrationJob
startFraudsterRegistrationJob_dataAccessRoleArn = (StartFraudsterRegistrationJob -> Text)
-> (StartFraudsterRegistrationJob
    -> Text -> StartFraudsterRegistrationJob)
-> Lens
     StartFraudsterRegistrationJob
     StartFraudsterRegistrationJob
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFraudsterRegistrationJob' {Text
dataAccessRoleArn :: Text
$sel:dataAccessRoleArn:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Text
dataAccessRoleArn} -> Text
dataAccessRoleArn) (\s :: StartFraudsterRegistrationJob
s@StartFraudsterRegistrationJob' {} Text
a -> StartFraudsterRegistrationJob
s {$sel:dataAccessRoleArn:StartFraudsterRegistrationJob' :: Text
dataAccessRoleArn = Text
a} :: StartFraudsterRegistrationJob)

-- | The identifier of the domain containing the fraudster registration job
-- and in which the fraudsters are registered.
startFraudsterRegistrationJob_domainId :: Lens.Lens' StartFraudsterRegistrationJob Prelude.Text
startFraudsterRegistrationJob_domainId :: (Text -> f Text)
-> StartFraudsterRegistrationJob -> f StartFraudsterRegistrationJob
startFraudsterRegistrationJob_domainId = (StartFraudsterRegistrationJob -> Text)
-> (StartFraudsterRegistrationJob
    -> Text -> StartFraudsterRegistrationJob)
-> Lens
     StartFraudsterRegistrationJob
     StartFraudsterRegistrationJob
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFraudsterRegistrationJob' {Text
domainId :: Text
$sel:domainId:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Text
domainId} -> Text
domainId) (\s :: StartFraudsterRegistrationJob
s@StartFraudsterRegistrationJob' {} Text
a -> StartFraudsterRegistrationJob
s {$sel:domainId:StartFraudsterRegistrationJob' :: Text
domainId = Text
a} :: StartFraudsterRegistrationJob)

-- | The input data config containing an S3 URI for the input manifest file
-- that contains the list of fraudster registration requests.
startFraudsterRegistrationJob_inputDataConfig :: Lens.Lens' StartFraudsterRegistrationJob InputDataConfig
startFraudsterRegistrationJob_inputDataConfig :: (InputDataConfig -> f InputDataConfig)
-> StartFraudsterRegistrationJob -> f StartFraudsterRegistrationJob
startFraudsterRegistrationJob_inputDataConfig = (StartFraudsterRegistrationJob -> InputDataConfig)
-> (StartFraudsterRegistrationJob
    -> InputDataConfig -> StartFraudsterRegistrationJob)
-> Lens
     StartFraudsterRegistrationJob
     StartFraudsterRegistrationJob
     InputDataConfig
     InputDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFraudsterRegistrationJob' {InputDataConfig
inputDataConfig :: InputDataConfig
$sel:inputDataConfig:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> InputDataConfig
inputDataConfig} -> InputDataConfig
inputDataConfig) (\s :: StartFraudsterRegistrationJob
s@StartFraudsterRegistrationJob' {} InputDataConfig
a -> StartFraudsterRegistrationJob
s {$sel:inputDataConfig:StartFraudsterRegistrationJob' :: InputDataConfig
inputDataConfig = InputDataConfig
a} :: StartFraudsterRegistrationJob)

-- | The output data config containing the S3 location where Voice ID writes
-- the job output file; you must also include a KMS Key ID to encrypt the
-- file.
startFraudsterRegistrationJob_outputDataConfig :: Lens.Lens' StartFraudsterRegistrationJob OutputDataConfig
startFraudsterRegistrationJob_outputDataConfig :: (OutputDataConfig -> f OutputDataConfig)
-> StartFraudsterRegistrationJob -> f StartFraudsterRegistrationJob
startFraudsterRegistrationJob_outputDataConfig = (StartFraudsterRegistrationJob -> OutputDataConfig)
-> (StartFraudsterRegistrationJob
    -> OutputDataConfig -> StartFraudsterRegistrationJob)
-> Lens
     StartFraudsterRegistrationJob
     StartFraudsterRegistrationJob
     OutputDataConfig
     OutputDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFraudsterRegistrationJob' {OutputDataConfig
outputDataConfig :: OutputDataConfig
$sel:outputDataConfig:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> OutputDataConfig
outputDataConfig} -> OutputDataConfig
outputDataConfig) (\s :: StartFraudsterRegistrationJob
s@StartFraudsterRegistrationJob' {} OutputDataConfig
a -> StartFraudsterRegistrationJob
s {$sel:outputDataConfig:StartFraudsterRegistrationJob' :: OutputDataConfig
outputDataConfig = OutputDataConfig
a} :: StartFraudsterRegistrationJob)

instance
  Core.AWSRequest
    StartFraudsterRegistrationJob
  where
  type
    AWSResponse StartFraudsterRegistrationJob =
      StartFraudsterRegistrationJobResponse
  request :: StartFraudsterRegistrationJob
-> Request StartFraudsterRegistrationJob
request = Service
-> StartFraudsterRegistrationJob
-> Request StartFraudsterRegistrationJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy StartFraudsterRegistrationJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartFraudsterRegistrationJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse StartFraudsterRegistrationJob))
-> Logger
-> Service
-> Proxy StartFraudsterRegistrationJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse StartFraudsterRegistrationJob)))
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 -> StartFraudsterRegistrationJobResponse
StartFraudsterRegistrationJobResponse'
            (Maybe FraudsterRegistrationJob
 -> Int -> StartFraudsterRegistrationJobResponse)
-> Either String (Maybe FraudsterRegistrationJob)
-> Either String (Int -> StartFraudsterRegistrationJobResponse)
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 -> StartFraudsterRegistrationJobResponse)
-> Either String Int
-> Either String StartFraudsterRegistrationJobResponse
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
    StartFraudsterRegistrationJob

instance Prelude.NFData StartFraudsterRegistrationJob

instance Core.ToHeaders StartFraudsterRegistrationJob where
  toHeaders :: StartFraudsterRegistrationJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> StartFraudsterRegistrationJob -> 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.StartFraudsterRegistrationJob" ::
                          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 StartFraudsterRegistrationJob where
  toJSON :: StartFraudsterRegistrationJob -> Value
toJSON StartFraudsterRegistrationJob' {Maybe Text
Maybe (Sensitive Text)
Maybe RegistrationConfig
Text
InputDataConfig
OutputDataConfig
outputDataConfig :: OutputDataConfig
inputDataConfig :: InputDataConfig
domainId :: Text
dataAccessRoleArn :: Text
registrationConfig :: Maybe RegistrationConfig
jobName :: Maybe (Sensitive Text)
clientToken :: Maybe Text
$sel:outputDataConfig:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> OutputDataConfig
$sel:inputDataConfig:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> InputDataConfig
$sel:domainId:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Text
$sel:dataAccessRoleArn:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Text
$sel:registrationConfig:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Maybe RegistrationConfig
$sel:jobName:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Maybe (Sensitive Text)
$sel:clientToken:StartFraudsterRegistrationJob' :: StartFraudsterRegistrationJob -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Text
"JobName" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
jobName,
            (Text
"RegistrationConfig" Text -> RegistrationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RegistrationConfig -> Pair)
-> Maybe RegistrationConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RegistrationConfig
registrationConfig,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DataAccessRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dataAccessRoleArn),
            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
"InputDataConfig" Text -> InputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputDataConfig
inputDataConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"OutputDataConfig" Text -> OutputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OutputDataConfig
outputDataConfig)
          ]
      )

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

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

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

-- |
-- Create a value of 'StartFraudsterRegistrationJobResponse' 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', 'startFraudsterRegistrationJobResponse_job' - Details about the started fraudster registration job.
--
-- 'httpStatus', 'startFraudsterRegistrationJobResponse_httpStatus' - The response's http status code.
newStartFraudsterRegistrationJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartFraudsterRegistrationJobResponse
newStartFraudsterRegistrationJobResponse :: Int -> StartFraudsterRegistrationJobResponse
newStartFraudsterRegistrationJobResponse Int
pHttpStatus_ =
  StartFraudsterRegistrationJobResponse' :: Maybe FraudsterRegistrationJob
-> Int -> StartFraudsterRegistrationJobResponse
StartFraudsterRegistrationJobResponse'
    { $sel:job:StartFraudsterRegistrationJobResponse' :: Maybe FraudsterRegistrationJob
job =
        Maybe FraudsterRegistrationJob
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:StartFraudsterRegistrationJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Details about the started fraudster registration job.
startFraudsterRegistrationJobResponse_job :: Lens.Lens' StartFraudsterRegistrationJobResponse (Prelude.Maybe FraudsterRegistrationJob)
startFraudsterRegistrationJobResponse_job :: (Maybe FraudsterRegistrationJob
 -> f (Maybe FraudsterRegistrationJob))
-> StartFraudsterRegistrationJobResponse
-> f StartFraudsterRegistrationJobResponse
startFraudsterRegistrationJobResponse_job = (StartFraudsterRegistrationJobResponse
 -> Maybe FraudsterRegistrationJob)
-> (StartFraudsterRegistrationJobResponse
    -> Maybe FraudsterRegistrationJob
    -> StartFraudsterRegistrationJobResponse)
-> Lens
     StartFraudsterRegistrationJobResponse
     StartFraudsterRegistrationJobResponse
     (Maybe FraudsterRegistrationJob)
     (Maybe FraudsterRegistrationJob)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartFraudsterRegistrationJobResponse' {Maybe FraudsterRegistrationJob
job :: Maybe FraudsterRegistrationJob
$sel:job:StartFraudsterRegistrationJobResponse' :: StartFraudsterRegistrationJobResponse
-> Maybe FraudsterRegistrationJob
job} -> Maybe FraudsterRegistrationJob
job) (\s :: StartFraudsterRegistrationJobResponse
s@StartFraudsterRegistrationJobResponse' {} Maybe FraudsterRegistrationJob
a -> StartFraudsterRegistrationJobResponse
s {$sel:job:StartFraudsterRegistrationJobResponse' :: Maybe FraudsterRegistrationJob
job = Maybe FraudsterRegistrationJob
a} :: StartFraudsterRegistrationJobResponse)

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

instance
  Prelude.NFData
    StartFraudsterRegistrationJobResponse