{-# 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.FraudDetector.CreateBatchPredictionJob
-- 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)
--
-- Creates a batch prediction job.
module Amazonka.FraudDetector.CreateBatchPredictionJob
  ( -- * Creating a Request
    CreateBatchPredictionJob (..),
    newCreateBatchPredictionJob,

    -- * Request Lenses
    createBatchPredictionJob_detectorVersion,
    createBatchPredictionJob_tags,
    createBatchPredictionJob_jobId,
    createBatchPredictionJob_inputPath,
    createBatchPredictionJob_outputPath,
    createBatchPredictionJob_eventTypeName,
    createBatchPredictionJob_detectorName,
    createBatchPredictionJob_iamRoleArn,

    -- * Destructuring the Response
    CreateBatchPredictionJobResponse (..),
    newCreateBatchPredictionJobResponse,

    -- * Response Lenses
    createBatchPredictionJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateBatchPredictionJob' smart constructor.
data CreateBatchPredictionJob = CreateBatchPredictionJob'
  { -- | The detector version.
    CreateBatchPredictionJob -> Maybe Text
detectorVersion :: Prelude.Maybe Prelude.Text,
    -- | A collection of key and value pairs.
    CreateBatchPredictionJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The ID of the batch prediction job.
    CreateBatchPredictionJob -> Text
jobId :: Prelude.Text,
    -- | The Amazon S3 location of your training file.
    CreateBatchPredictionJob -> Text
inputPath :: Prelude.Text,
    -- | The Amazon S3 location of your output file.
    CreateBatchPredictionJob -> Text
outputPath :: Prelude.Text,
    -- | The name of the event type.
    CreateBatchPredictionJob -> Text
eventTypeName :: Prelude.Text,
    -- | The name of the detector.
    CreateBatchPredictionJob -> Text
detectorName :: Prelude.Text,
    -- | The ARN of the IAM role to use for this job request.
    CreateBatchPredictionJob -> Text
iamRoleArn :: Prelude.Text
  }
  deriving (CreateBatchPredictionJob -> CreateBatchPredictionJob -> Bool
(CreateBatchPredictionJob -> CreateBatchPredictionJob -> Bool)
-> (CreateBatchPredictionJob -> CreateBatchPredictionJob -> Bool)
-> Eq CreateBatchPredictionJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBatchPredictionJob -> CreateBatchPredictionJob -> Bool
$c/= :: CreateBatchPredictionJob -> CreateBatchPredictionJob -> Bool
== :: CreateBatchPredictionJob -> CreateBatchPredictionJob -> Bool
$c== :: CreateBatchPredictionJob -> CreateBatchPredictionJob -> Bool
Prelude.Eq, ReadPrec [CreateBatchPredictionJob]
ReadPrec CreateBatchPredictionJob
Int -> ReadS CreateBatchPredictionJob
ReadS [CreateBatchPredictionJob]
(Int -> ReadS CreateBatchPredictionJob)
-> ReadS [CreateBatchPredictionJob]
-> ReadPrec CreateBatchPredictionJob
-> ReadPrec [CreateBatchPredictionJob]
-> Read CreateBatchPredictionJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBatchPredictionJob]
$creadListPrec :: ReadPrec [CreateBatchPredictionJob]
readPrec :: ReadPrec CreateBatchPredictionJob
$creadPrec :: ReadPrec CreateBatchPredictionJob
readList :: ReadS [CreateBatchPredictionJob]
$creadList :: ReadS [CreateBatchPredictionJob]
readsPrec :: Int -> ReadS CreateBatchPredictionJob
$creadsPrec :: Int -> ReadS CreateBatchPredictionJob
Prelude.Read, Int -> CreateBatchPredictionJob -> ShowS
[CreateBatchPredictionJob] -> ShowS
CreateBatchPredictionJob -> String
(Int -> CreateBatchPredictionJob -> ShowS)
-> (CreateBatchPredictionJob -> String)
-> ([CreateBatchPredictionJob] -> ShowS)
-> Show CreateBatchPredictionJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBatchPredictionJob] -> ShowS
$cshowList :: [CreateBatchPredictionJob] -> ShowS
show :: CreateBatchPredictionJob -> String
$cshow :: CreateBatchPredictionJob -> String
showsPrec :: Int -> CreateBatchPredictionJob -> ShowS
$cshowsPrec :: Int -> CreateBatchPredictionJob -> ShowS
Prelude.Show, (forall x.
 CreateBatchPredictionJob -> Rep CreateBatchPredictionJob x)
-> (forall x.
    Rep CreateBatchPredictionJob x -> CreateBatchPredictionJob)
-> Generic CreateBatchPredictionJob
forall x.
Rep CreateBatchPredictionJob x -> CreateBatchPredictionJob
forall x.
CreateBatchPredictionJob -> Rep CreateBatchPredictionJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateBatchPredictionJob x -> CreateBatchPredictionJob
$cfrom :: forall x.
CreateBatchPredictionJob -> Rep CreateBatchPredictionJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateBatchPredictionJob' 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:
--
-- 'detectorVersion', 'createBatchPredictionJob_detectorVersion' - The detector version.
--
-- 'tags', 'createBatchPredictionJob_tags' - A collection of key and value pairs.
--
-- 'jobId', 'createBatchPredictionJob_jobId' - The ID of the batch prediction job.
--
-- 'inputPath', 'createBatchPredictionJob_inputPath' - The Amazon S3 location of your training file.
--
-- 'outputPath', 'createBatchPredictionJob_outputPath' - The Amazon S3 location of your output file.
--
-- 'eventTypeName', 'createBatchPredictionJob_eventTypeName' - The name of the event type.
--
-- 'detectorName', 'createBatchPredictionJob_detectorName' - The name of the detector.
--
-- 'iamRoleArn', 'createBatchPredictionJob_iamRoleArn' - The ARN of the IAM role to use for this job request.
newCreateBatchPredictionJob ::
  -- | 'jobId'
  Prelude.Text ->
  -- | 'inputPath'
  Prelude.Text ->
  -- | 'outputPath'
  Prelude.Text ->
  -- | 'eventTypeName'
  Prelude.Text ->
  -- | 'detectorName'
  Prelude.Text ->
  -- | 'iamRoleArn'
  Prelude.Text ->
  CreateBatchPredictionJob
newCreateBatchPredictionJob :: Text
-> Text -> Text -> Text -> Text -> Text -> CreateBatchPredictionJob
newCreateBatchPredictionJob
  Text
pJobId_
  Text
pInputPath_
  Text
pOutputPath_
  Text
pEventTypeName_
  Text
pDetectorName_
  Text
pIamRoleArn_ =
    CreateBatchPredictionJob' :: Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> CreateBatchPredictionJob
CreateBatchPredictionJob'
      { $sel:detectorVersion:CreateBatchPredictionJob' :: Maybe Text
detectorVersion =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateBatchPredictionJob' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:jobId:CreateBatchPredictionJob' :: Text
jobId = Text
pJobId_,
        $sel:inputPath:CreateBatchPredictionJob' :: Text
inputPath = Text
pInputPath_,
        $sel:outputPath:CreateBatchPredictionJob' :: Text
outputPath = Text
pOutputPath_,
        $sel:eventTypeName:CreateBatchPredictionJob' :: Text
eventTypeName = Text
pEventTypeName_,
        $sel:detectorName:CreateBatchPredictionJob' :: Text
detectorName = Text
pDetectorName_,
        $sel:iamRoleArn:CreateBatchPredictionJob' :: Text
iamRoleArn = Text
pIamRoleArn_
      }

-- | The detector version.
createBatchPredictionJob_detectorVersion :: Lens.Lens' CreateBatchPredictionJob (Prelude.Maybe Prelude.Text)
createBatchPredictionJob_detectorVersion :: (Maybe Text -> f (Maybe Text))
-> CreateBatchPredictionJob -> f CreateBatchPredictionJob
createBatchPredictionJob_detectorVersion = (CreateBatchPredictionJob -> Maybe Text)
-> (CreateBatchPredictionJob
    -> Maybe Text -> CreateBatchPredictionJob)
-> Lens
     CreateBatchPredictionJob
     CreateBatchPredictionJob
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchPredictionJob' {Maybe Text
detectorVersion :: Maybe Text
$sel:detectorVersion:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Maybe Text
detectorVersion} -> Maybe Text
detectorVersion) (\s :: CreateBatchPredictionJob
s@CreateBatchPredictionJob' {} Maybe Text
a -> CreateBatchPredictionJob
s {$sel:detectorVersion:CreateBatchPredictionJob' :: Maybe Text
detectorVersion = Maybe Text
a} :: CreateBatchPredictionJob)

-- | A collection of key and value pairs.
createBatchPredictionJob_tags :: Lens.Lens' CreateBatchPredictionJob (Prelude.Maybe [Tag])
createBatchPredictionJob_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateBatchPredictionJob -> f CreateBatchPredictionJob
createBatchPredictionJob_tags = (CreateBatchPredictionJob -> Maybe [Tag])
-> (CreateBatchPredictionJob
    -> Maybe [Tag] -> CreateBatchPredictionJob)
-> Lens
     CreateBatchPredictionJob
     CreateBatchPredictionJob
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchPredictionJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateBatchPredictionJob
s@CreateBatchPredictionJob' {} Maybe [Tag]
a -> CreateBatchPredictionJob
s {$sel:tags:CreateBatchPredictionJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateBatchPredictionJob) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateBatchPredictionJob -> f CreateBatchPredictionJob)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateBatchPredictionJob
-> f CreateBatchPredictionJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the batch prediction job.
createBatchPredictionJob_jobId :: Lens.Lens' CreateBatchPredictionJob Prelude.Text
createBatchPredictionJob_jobId :: (Text -> f Text)
-> CreateBatchPredictionJob -> f CreateBatchPredictionJob
createBatchPredictionJob_jobId = (CreateBatchPredictionJob -> Text)
-> (CreateBatchPredictionJob -> Text -> CreateBatchPredictionJob)
-> Lens CreateBatchPredictionJob CreateBatchPredictionJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchPredictionJob' {Text
jobId :: Text
$sel:jobId:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
jobId} -> Text
jobId) (\s :: CreateBatchPredictionJob
s@CreateBatchPredictionJob' {} Text
a -> CreateBatchPredictionJob
s {$sel:jobId:CreateBatchPredictionJob' :: Text
jobId = Text
a} :: CreateBatchPredictionJob)

-- | The Amazon S3 location of your training file.
createBatchPredictionJob_inputPath :: Lens.Lens' CreateBatchPredictionJob Prelude.Text
createBatchPredictionJob_inputPath :: (Text -> f Text)
-> CreateBatchPredictionJob -> f CreateBatchPredictionJob
createBatchPredictionJob_inputPath = (CreateBatchPredictionJob -> Text)
-> (CreateBatchPredictionJob -> Text -> CreateBatchPredictionJob)
-> Lens CreateBatchPredictionJob CreateBatchPredictionJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchPredictionJob' {Text
inputPath :: Text
$sel:inputPath:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
inputPath} -> Text
inputPath) (\s :: CreateBatchPredictionJob
s@CreateBatchPredictionJob' {} Text
a -> CreateBatchPredictionJob
s {$sel:inputPath:CreateBatchPredictionJob' :: Text
inputPath = Text
a} :: CreateBatchPredictionJob)

-- | The Amazon S3 location of your output file.
createBatchPredictionJob_outputPath :: Lens.Lens' CreateBatchPredictionJob Prelude.Text
createBatchPredictionJob_outputPath :: (Text -> f Text)
-> CreateBatchPredictionJob -> f CreateBatchPredictionJob
createBatchPredictionJob_outputPath = (CreateBatchPredictionJob -> Text)
-> (CreateBatchPredictionJob -> Text -> CreateBatchPredictionJob)
-> Lens CreateBatchPredictionJob CreateBatchPredictionJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchPredictionJob' {Text
outputPath :: Text
$sel:outputPath:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
outputPath} -> Text
outputPath) (\s :: CreateBatchPredictionJob
s@CreateBatchPredictionJob' {} Text
a -> CreateBatchPredictionJob
s {$sel:outputPath:CreateBatchPredictionJob' :: Text
outputPath = Text
a} :: CreateBatchPredictionJob)

-- | The name of the event type.
createBatchPredictionJob_eventTypeName :: Lens.Lens' CreateBatchPredictionJob Prelude.Text
createBatchPredictionJob_eventTypeName :: (Text -> f Text)
-> CreateBatchPredictionJob -> f CreateBatchPredictionJob
createBatchPredictionJob_eventTypeName = (CreateBatchPredictionJob -> Text)
-> (CreateBatchPredictionJob -> Text -> CreateBatchPredictionJob)
-> Lens CreateBatchPredictionJob CreateBatchPredictionJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchPredictionJob' {Text
eventTypeName :: Text
$sel:eventTypeName:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
eventTypeName} -> Text
eventTypeName) (\s :: CreateBatchPredictionJob
s@CreateBatchPredictionJob' {} Text
a -> CreateBatchPredictionJob
s {$sel:eventTypeName:CreateBatchPredictionJob' :: Text
eventTypeName = Text
a} :: CreateBatchPredictionJob)

-- | The name of the detector.
createBatchPredictionJob_detectorName :: Lens.Lens' CreateBatchPredictionJob Prelude.Text
createBatchPredictionJob_detectorName :: (Text -> f Text)
-> CreateBatchPredictionJob -> f CreateBatchPredictionJob
createBatchPredictionJob_detectorName = (CreateBatchPredictionJob -> Text)
-> (CreateBatchPredictionJob -> Text -> CreateBatchPredictionJob)
-> Lens CreateBatchPredictionJob CreateBatchPredictionJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchPredictionJob' {Text
detectorName :: Text
$sel:detectorName:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
detectorName} -> Text
detectorName) (\s :: CreateBatchPredictionJob
s@CreateBatchPredictionJob' {} Text
a -> CreateBatchPredictionJob
s {$sel:detectorName:CreateBatchPredictionJob' :: Text
detectorName = Text
a} :: CreateBatchPredictionJob)

-- | The ARN of the IAM role to use for this job request.
createBatchPredictionJob_iamRoleArn :: Lens.Lens' CreateBatchPredictionJob Prelude.Text
createBatchPredictionJob_iamRoleArn :: (Text -> f Text)
-> CreateBatchPredictionJob -> f CreateBatchPredictionJob
createBatchPredictionJob_iamRoleArn = (CreateBatchPredictionJob -> Text)
-> (CreateBatchPredictionJob -> Text -> CreateBatchPredictionJob)
-> Lens CreateBatchPredictionJob CreateBatchPredictionJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchPredictionJob' {Text
iamRoleArn :: Text
$sel:iamRoleArn:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
iamRoleArn} -> Text
iamRoleArn) (\s :: CreateBatchPredictionJob
s@CreateBatchPredictionJob' {} Text
a -> CreateBatchPredictionJob
s {$sel:iamRoleArn:CreateBatchPredictionJob' :: Text
iamRoleArn = Text
a} :: CreateBatchPredictionJob)

instance Core.AWSRequest CreateBatchPredictionJob where
  type
    AWSResponse CreateBatchPredictionJob =
      CreateBatchPredictionJobResponse
  request :: CreateBatchPredictionJob -> Request CreateBatchPredictionJob
request = Service
-> CreateBatchPredictionJob -> Request CreateBatchPredictionJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateBatchPredictionJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateBatchPredictionJob)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse CreateBatchPredictionJob))
-> Logger
-> Service
-> Proxy CreateBatchPredictionJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateBatchPredictionJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> CreateBatchPredictionJobResponse
CreateBatchPredictionJobResponse'
            (Int -> CreateBatchPredictionJobResponse)
-> Either String Int
-> Either String CreateBatchPredictionJobResponse
forall (f :: * -> *) a b. Functor 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 CreateBatchPredictionJob

instance Prelude.NFData CreateBatchPredictionJob

instance Core.ToHeaders CreateBatchPredictionJob where
  toHeaders :: CreateBatchPredictionJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateBatchPredictionJob -> 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
"AWSHawksNestServiceFacade.CreateBatchPredictionJob" ::
                          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 CreateBatchPredictionJob where
  toJSON :: CreateBatchPredictionJob -> Value
toJSON CreateBatchPredictionJob' {Maybe [Tag]
Maybe Text
Text
iamRoleArn :: Text
detectorName :: Text
eventTypeName :: Text
outputPath :: Text
inputPath :: Text
jobId :: Text
tags :: Maybe [Tag]
detectorVersion :: Maybe Text
$sel:iamRoleArn:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
$sel:detectorName:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
$sel:eventTypeName:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
$sel:outputPath:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
$sel:inputPath:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
$sel:jobId:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Text
$sel:tags:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Maybe [Tag]
$sel:detectorVersion:CreateBatchPredictionJob' :: CreateBatchPredictionJob -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"detectorVersion" 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
detectorVersion,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"inputPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
inputPath),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"outputPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
outputPath),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"eventTypeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventTypeName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"detectorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
detectorName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"iamRoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
iamRoleArn)
          ]
      )

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

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

-- | /See:/ 'newCreateBatchPredictionJobResponse' smart constructor.
data CreateBatchPredictionJobResponse = CreateBatchPredictionJobResponse'
  { -- | The response's http status code.
    CreateBatchPredictionJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateBatchPredictionJobResponse
-> CreateBatchPredictionJobResponse -> Bool
(CreateBatchPredictionJobResponse
 -> CreateBatchPredictionJobResponse -> Bool)
-> (CreateBatchPredictionJobResponse
    -> CreateBatchPredictionJobResponse -> Bool)
-> Eq CreateBatchPredictionJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBatchPredictionJobResponse
-> CreateBatchPredictionJobResponse -> Bool
$c/= :: CreateBatchPredictionJobResponse
-> CreateBatchPredictionJobResponse -> Bool
== :: CreateBatchPredictionJobResponse
-> CreateBatchPredictionJobResponse -> Bool
$c== :: CreateBatchPredictionJobResponse
-> CreateBatchPredictionJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateBatchPredictionJobResponse]
ReadPrec CreateBatchPredictionJobResponse
Int -> ReadS CreateBatchPredictionJobResponse
ReadS [CreateBatchPredictionJobResponse]
(Int -> ReadS CreateBatchPredictionJobResponse)
-> ReadS [CreateBatchPredictionJobResponse]
-> ReadPrec CreateBatchPredictionJobResponse
-> ReadPrec [CreateBatchPredictionJobResponse]
-> Read CreateBatchPredictionJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBatchPredictionJobResponse]
$creadListPrec :: ReadPrec [CreateBatchPredictionJobResponse]
readPrec :: ReadPrec CreateBatchPredictionJobResponse
$creadPrec :: ReadPrec CreateBatchPredictionJobResponse
readList :: ReadS [CreateBatchPredictionJobResponse]
$creadList :: ReadS [CreateBatchPredictionJobResponse]
readsPrec :: Int -> ReadS CreateBatchPredictionJobResponse
$creadsPrec :: Int -> ReadS CreateBatchPredictionJobResponse
Prelude.Read, Int -> CreateBatchPredictionJobResponse -> ShowS
[CreateBatchPredictionJobResponse] -> ShowS
CreateBatchPredictionJobResponse -> String
(Int -> CreateBatchPredictionJobResponse -> ShowS)
-> (CreateBatchPredictionJobResponse -> String)
-> ([CreateBatchPredictionJobResponse] -> ShowS)
-> Show CreateBatchPredictionJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBatchPredictionJobResponse] -> ShowS
$cshowList :: [CreateBatchPredictionJobResponse] -> ShowS
show :: CreateBatchPredictionJobResponse -> String
$cshow :: CreateBatchPredictionJobResponse -> String
showsPrec :: Int -> CreateBatchPredictionJobResponse -> ShowS
$cshowsPrec :: Int -> CreateBatchPredictionJobResponse -> ShowS
Prelude.Show, (forall x.
 CreateBatchPredictionJobResponse
 -> Rep CreateBatchPredictionJobResponse x)
-> (forall x.
    Rep CreateBatchPredictionJobResponse x
    -> CreateBatchPredictionJobResponse)
-> Generic CreateBatchPredictionJobResponse
forall x.
Rep CreateBatchPredictionJobResponse x
-> CreateBatchPredictionJobResponse
forall x.
CreateBatchPredictionJobResponse
-> Rep CreateBatchPredictionJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateBatchPredictionJobResponse x
-> CreateBatchPredictionJobResponse
$cfrom :: forall x.
CreateBatchPredictionJobResponse
-> Rep CreateBatchPredictionJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateBatchPredictionJobResponse' 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:
--
-- 'httpStatus', 'createBatchPredictionJobResponse_httpStatus' - The response's http status code.
newCreateBatchPredictionJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateBatchPredictionJobResponse
newCreateBatchPredictionJobResponse :: Int -> CreateBatchPredictionJobResponse
newCreateBatchPredictionJobResponse Int
pHttpStatus_ =
  CreateBatchPredictionJobResponse' :: Int -> CreateBatchPredictionJobResponse
CreateBatchPredictionJobResponse'
    { $sel:httpStatus:CreateBatchPredictionJobResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    CreateBatchPredictionJobResponse