{-# 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.Personalize.CreateBatchInferenceJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a batch inference job. The operation can handle up to 50 million
-- records and the input file must be in JSON format. For more information,
-- see
-- <https://docs.aws.amazon.com/personalize/latest/dg/creating-batch-inference-job.html Creating a batch inference job>.
module Amazonka.Personalize.CreateBatchInferenceJob
  ( -- * Creating a Request
    CreateBatchInferenceJob (..),
    newCreateBatchInferenceJob,

    -- * Request Lenses
    createBatchInferenceJob_batchInferenceJobConfig,
    createBatchInferenceJob_filterArn,
    createBatchInferenceJob_numResults,
    createBatchInferenceJob_tags,
    createBatchInferenceJob_jobName,
    createBatchInferenceJob_solutionVersionArn,
    createBatchInferenceJob_jobInput,
    createBatchInferenceJob_jobOutput,
    createBatchInferenceJob_roleArn,

    -- * Destructuring the Response
    CreateBatchInferenceJobResponse (..),
    newCreateBatchInferenceJobResponse,

    -- * Response Lenses
    createBatchInferenceJobResponse_batchInferenceJobArn,
    createBatchInferenceJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Personalize.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateBatchInferenceJob' smart constructor.
data CreateBatchInferenceJob = CreateBatchInferenceJob'
  { -- | The configuration details of a batch inference job.
    CreateBatchInferenceJob -> Maybe BatchInferenceJobConfig
batchInferenceJobConfig :: Prelude.Maybe BatchInferenceJobConfig,
    -- | The ARN of the filter to apply to the batch inference job. For more
    -- information on using filters, see
    -- <https://docs.aws.amazon.com/personalize/latest/dg/filter-batch.html Filtering batch recommendations>.
    CreateBatchInferenceJob -> Maybe Text
filterArn :: Prelude.Maybe Prelude.Text,
    -- | The number of recommendations to retrieve.
    CreateBatchInferenceJob -> Maybe Int
numResults :: Prelude.Maybe Prelude.Int,
    -- | A list of
    -- <https://docs.aws.amazon.com/personalize/latest/dev/tagging-resources.html tags>
    -- to apply to the batch inference job.
    CreateBatchInferenceJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the batch inference job to create.
    CreateBatchInferenceJob -> Text
jobName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the solution version that will be used
    -- to generate the batch inference recommendations.
    CreateBatchInferenceJob -> Text
solutionVersionArn :: Prelude.Text,
    -- | The Amazon S3 path that leads to the input file to base your
    -- recommendations on. The input material must be in JSON format.
    CreateBatchInferenceJob -> BatchInferenceJobInput
jobInput :: BatchInferenceJobInput,
    -- | The path to the Amazon S3 bucket where the job\'s output will be stored.
    CreateBatchInferenceJob -> BatchInferenceJobOutput
jobOutput :: BatchInferenceJobOutput,
    -- | The ARN of the Amazon Identity and Access Management role that has
    -- permissions to read and write to your input and output Amazon S3 buckets
    -- respectively.
    CreateBatchInferenceJob -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateBatchInferenceJob -> CreateBatchInferenceJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBatchInferenceJob -> CreateBatchInferenceJob -> Bool
$c/= :: CreateBatchInferenceJob -> CreateBatchInferenceJob -> Bool
== :: CreateBatchInferenceJob -> CreateBatchInferenceJob -> Bool
$c== :: CreateBatchInferenceJob -> CreateBatchInferenceJob -> Bool
Prelude.Eq, ReadPrec [CreateBatchInferenceJob]
ReadPrec CreateBatchInferenceJob
Int -> ReadS CreateBatchInferenceJob
ReadS [CreateBatchInferenceJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBatchInferenceJob]
$creadListPrec :: ReadPrec [CreateBatchInferenceJob]
readPrec :: ReadPrec CreateBatchInferenceJob
$creadPrec :: ReadPrec CreateBatchInferenceJob
readList :: ReadS [CreateBatchInferenceJob]
$creadList :: ReadS [CreateBatchInferenceJob]
readsPrec :: Int -> ReadS CreateBatchInferenceJob
$creadsPrec :: Int -> ReadS CreateBatchInferenceJob
Prelude.Read, Int -> CreateBatchInferenceJob -> ShowS
[CreateBatchInferenceJob] -> ShowS
CreateBatchInferenceJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBatchInferenceJob] -> ShowS
$cshowList :: [CreateBatchInferenceJob] -> ShowS
show :: CreateBatchInferenceJob -> String
$cshow :: CreateBatchInferenceJob -> String
showsPrec :: Int -> CreateBatchInferenceJob -> ShowS
$cshowsPrec :: Int -> CreateBatchInferenceJob -> ShowS
Prelude.Show, forall x. Rep CreateBatchInferenceJob x -> CreateBatchInferenceJob
forall x. CreateBatchInferenceJob -> Rep CreateBatchInferenceJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBatchInferenceJob x -> CreateBatchInferenceJob
$cfrom :: forall x. CreateBatchInferenceJob -> Rep CreateBatchInferenceJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateBatchInferenceJob' 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:
--
-- 'batchInferenceJobConfig', 'createBatchInferenceJob_batchInferenceJobConfig' - The configuration details of a batch inference job.
--
-- 'filterArn', 'createBatchInferenceJob_filterArn' - The ARN of the filter to apply to the batch inference job. For more
-- information on using filters, see
-- <https://docs.aws.amazon.com/personalize/latest/dg/filter-batch.html Filtering batch recommendations>.
--
-- 'numResults', 'createBatchInferenceJob_numResults' - The number of recommendations to retrieve.
--
-- 'tags', 'createBatchInferenceJob_tags' - A list of
-- <https://docs.aws.amazon.com/personalize/latest/dev/tagging-resources.html tags>
-- to apply to the batch inference job.
--
-- 'jobName', 'createBatchInferenceJob_jobName' - The name of the batch inference job to create.
--
-- 'solutionVersionArn', 'createBatchInferenceJob_solutionVersionArn' - The Amazon Resource Name (ARN) of the solution version that will be used
-- to generate the batch inference recommendations.
--
-- 'jobInput', 'createBatchInferenceJob_jobInput' - The Amazon S3 path that leads to the input file to base your
-- recommendations on. The input material must be in JSON format.
--
-- 'jobOutput', 'createBatchInferenceJob_jobOutput' - The path to the Amazon S3 bucket where the job\'s output will be stored.
--
-- 'roleArn', 'createBatchInferenceJob_roleArn' - The ARN of the Amazon Identity and Access Management role that has
-- permissions to read and write to your input and output Amazon S3 buckets
-- respectively.
newCreateBatchInferenceJob ::
  -- | 'jobName'
  Prelude.Text ->
  -- | 'solutionVersionArn'
  Prelude.Text ->
  -- | 'jobInput'
  BatchInferenceJobInput ->
  -- | 'jobOutput'
  BatchInferenceJobOutput ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateBatchInferenceJob
newCreateBatchInferenceJob :: Text
-> Text
-> BatchInferenceJobInput
-> BatchInferenceJobOutput
-> Text
-> CreateBatchInferenceJob
newCreateBatchInferenceJob
  Text
pJobName_
  Text
pSolutionVersionArn_
  BatchInferenceJobInput
pJobInput_
  BatchInferenceJobOutput
pJobOutput_
  Text
pRoleArn_ =
    CreateBatchInferenceJob'
      { $sel:batchInferenceJobConfig:CreateBatchInferenceJob' :: Maybe BatchInferenceJobConfig
batchInferenceJobConfig =
          forall a. Maybe a
Prelude.Nothing,
        $sel:filterArn:CreateBatchInferenceJob' :: Maybe Text
filterArn = forall a. Maybe a
Prelude.Nothing,
        $sel:numResults:CreateBatchInferenceJob' :: Maybe Int
numResults = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateBatchInferenceJob' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:jobName:CreateBatchInferenceJob' :: Text
jobName = Text
pJobName_,
        $sel:solutionVersionArn:CreateBatchInferenceJob' :: Text
solutionVersionArn = Text
pSolutionVersionArn_,
        $sel:jobInput:CreateBatchInferenceJob' :: BatchInferenceJobInput
jobInput = BatchInferenceJobInput
pJobInput_,
        $sel:jobOutput:CreateBatchInferenceJob' :: BatchInferenceJobOutput
jobOutput = BatchInferenceJobOutput
pJobOutput_,
        $sel:roleArn:CreateBatchInferenceJob' :: Text
roleArn = Text
pRoleArn_
      }

-- | The configuration details of a batch inference job.
createBatchInferenceJob_batchInferenceJobConfig :: Lens.Lens' CreateBatchInferenceJob (Prelude.Maybe BatchInferenceJobConfig)
createBatchInferenceJob_batchInferenceJobConfig :: Lens' CreateBatchInferenceJob (Maybe BatchInferenceJobConfig)
createBatchInferenceJob_batchInferenceJobConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {Maybe BatchInferenceJobConfig
batchInferenceJobConfig :: Maybe BatchInferenceJobConfig
$sel:batchInferenceJobConfig:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe BatchInferenceJobConfig
batchInferenceJobConfig} -> Maybe BatchInferenceJobConfig
batchInferenceJobConfig) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} Maybe BatchInferenceJobConfig
a -> CreateBatchInferenceJob
s {$sel:batchInferenceJobConfig:CreateBatchInferenceJob' :: Maybe BatchInferenceJobConfig
batchInferenceJobConfig = Maybe BatchInferenceJobConfig
a} :: CreateBatchInferenceJob)

-- | The ARN of the filter to apply to the batch inference job. For more
-- information on using filters, see
-- <https://docs.aws.amazon.com/personalize/latest/dg/filter-batch.html Filtering batch recommendations>.
createBatchInferenceJob_filterArn :: Lens.Lens' CreateBatchInferenceJob (Prelude.Maybe Prelude.Text)
createBatchInferenceJob_filterArn :: Lens' CreateBatchInferenceJob (Maybe Text)
createBatchInferenceJob_filterArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {Maybe Text
filterArn :: Maybe Text
$sel:filterArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe Text
filterArn} -> Maybe Text
filterArn) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} Maybe Text
a -> CreateBatchInferenceJob
s {$sel:filterArn:CreateBatchInferenceJob' :: Maybe Text
filterArn = Maybe Text
a} :: CreateBatchInferenceJob)

-- | The number of recommendations to retrieve.
createBatchInferenceJob_numResults :: Lens.Lens' CreateBatchInferenceJob (Prelude.Maybe Prelude.Int)
createBatchInferenceJob_numResults :: Lens' CreateBatchInferenceJob (Maybe Int)
createBatchInferenceJob_numResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {Maybe Int
numResults :: Maybe Int
$sel:numResults:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe Int
numResults} -> Maybe Int
numResults) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} Maybe Int
a -> CreateBatchInferenceJob
s {$sel:numResults:CreateBatchInferenceJob' :: Maybe Int
numResults = Maybe Int
a} :: CreateBatchInferenceJob)

-- | A list of
-- <https://docs.aws.amazon.com/personalize/latest/dev/tagging-resources.html tags>
-- to apply to the batch inference job.
createBatchInferenceJob_tags :: Lens.Lens' CreateBatchInferenceJob (Prelude.Maybe [Tag])
createBatchInferenceJob_tags :: Lens' CreateBatchInferenceJob (Maybe [Tag])
createBatchInferenceJob_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} Maybe [Tag]
a -> CreateBatchInferenceJob
s {$sel:tags:CreateBatchInferenceJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateBatchInferenceJob) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the batch inference job to create.
createBatchInferenceJob_jobName :: Lens.Lens' CreateBatchInferenceJob Prelude.Text
createBatchInferenceJob_jobName :: Lens' CreateBatchInferenceJob Text
createBatchInferenceJob_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {Text
jobName :: Text
$sel:jobName:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
jobName} -> Text
jobName) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} Text
a -> CreateBatchInferenceJob
s {$sel:jobName:CreateBatchInferenceJob' :: Text
jobName = Text
a} :: CreateBatchInferenceJob)

-- | The Amazon Resource Name (ARN) of the solution version that will be used
-- to generate the batch inference recommendations.
createBatchInferenceJob_solutionVersionArn :: Lens.Lens' CreateBatchInferenceJob Prelude.Text
createBatchInferenceJob_solutionVersionArn :: Lens' CreateBatchInferenceJob Text
createBatchInferenceJob_solutionVersionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {Text
solutionVersionArn :: Text
$sel:solutionVersionArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
solutionVersionArn} -> Text
solutionVersionArn) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} Text
a -> CreateBatchInferenceJob
s {$sel:solutionVersionArn:CreateBatchInferenceJob' :: Text
solutionVersionArn = Text
a} :: CreateBatchInferenceJob)

-- | The Amazon S3 path that leads to the input file to base your
-- recommendations on. The input material must be in JSON format.
createBatchInferenceJob_jobInput :: Lens.Lens' CreateBatchInferenceJob BatchInferenceJobInput
createBatchInferenceJob_jobInput :: Lens' CreateBatchInferenceJob BatchInferenceJobInput
createBatchInferenceJob_jobInput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {BatchInferenceJobInput
jobInput :: BatchInferenceJobInput
$sel:jobInput:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> BatchInferenceJobInput
jobInput} -> BatchInferenceJobInput
jobInput) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} BatchInferenceJobInput
a -> CreateBatchInferenceJob
s {$sel:jobInput:CreateBatchInferenceJob' :: BatchInferenceJobInput
jobInput = BatchInferenceJobInput
a} :: CreateBatchInferenceJob)

-- | The path to the Amazon S3 bucket where the job\'s output will be stored.
createBatchInferenceJob_jobOutput :: Lens.Lens' CreateBatchInferenceJob BatchInferenceJobOutput
createBatchInferenceJob_jobOutput :: Lens' CreateBatchInferenceJob BatchInferenceJobOutput
createBatchInferenceJob_jobOutput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {BatchInferenceJobOutput
jobOutput :: BatchInferenceJobOutput
$sel:jobOutput:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> BatchInferenceJobOutput
jobOutput} -> BatchInferenceJobOutput
jobOutput) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} BatchInferenceJobOutput
a -> CreateBatchInferenceJob
s {$sel:jobOutput:CreateBatchInferenceJob' :: BatchInferenceJobOutput
jobOutput = BatchInferenceJobOutput
a} :: CreateBatchInferenceJob)

-- | The ARN of the Amazon Identity and Access Management role that has
-- permissions to read and write to your input and output Amazon S3 buckets
-- respectively.
createBatchInferenceJob_roleArn :: Lens.Lens' CreateBatchInferenceJob Prelude.Text
createBatchInferenceJob_roleArn :: Lens' CreateBatchInferenceJob Text
createBatchInferenceJob_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJob' {Text
roleArn :: Text
$sel:roleArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
roleArn} -> Text
roleArn) (\s :: CreateBatchInferenceJob
s@CreateBatchInferenceJob' {} Text
a -> CreateBatchInferenceJob
s {$sel:roleArn:CreateBatchInferenceJob' :: Text
roleArn = Text
a} :: CreateBatchInferenceJob)

instance Core.AWSRequest CreateBatchInferenceJob where
  type
    AWSResponse CreateBatchInferenceJob =
      CreateBatchInferenceJobResponse
  request :: (Service -> Service)
-> CreateBatchInferenceJob -> Request CreateBatchInferenceJob
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 CreateBatchInferenceJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateBatchInferenceJob)))
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 Text -> Int -> CreateBatchInferenceJobResponse
CreateBatchInferenceJobResponse'
            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
"batchInferenceJobArn")
            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 CreateBatchInferenceJob where
  hashWithSalt :: Int -> CreateBatchInferenceJob -> Int
hashWithSalt Int
_salt CreateBatchInferenceJob' {Maybe Int
Maybe [Tag]
Maybe Text
Maybe BatchInferenceJobConfig
Text
BatchInferenceJobOutput
BatchInferenceJobInput
roleArn :: Text
jobOutput :: BatchInferenceJobOutput
jobInput :: BatchInferenceJobInput
solutionVersionArn :: Text
jobName :: Text
tags :: Maybe [Tag]
numResults :: Maybe Int
filterArn :: Maybe Text
batchInferenceJobConfig :: Maybe BatchInferenceJobConfig
$sel:roleArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:jobOutput:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> BatchInferenceJobOutput
$sel:jobInput:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> BatchInferenceJobInput
$sel:solutionVersionArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:jobName:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:tags:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe [Tag]
$sel:numResults:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe Int
$sel:filterArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe Text
$sel:batchInferenceJobConfig:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe BatchInferenceJobConfig
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BatchInferenceJobConfig
batchInferenceJobConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
filterArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
solutionVersionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BatchInferenceJobInput
jobInput
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BatchInferenceJobOutput
jobOutput
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn

instance Prelude.NFData CreateBatchInferenceJob where
  rnf :: CreateBatchInferenceJob -> ()
rnf CreateBatchInferenceJob' {Maybe Int
Maybe [Tag]
Maybe Text
Maybe BatchInferenceJobConfig
Text
BatchInferenceJobOutput
BatchInferenceJobInput
roleArn :: Text
jobOutput :: BatchInferenceJobOutput
jobInput :: BatchInferenceJobInput
solutionVersionArn :: Text
jobName :: Text
tags :: Maybe [Tag]
numResults :: Maybe Int
filterArn :: Maybe Text
batchInferenceJobConfig :: Maybe BatchInferenceJobConfig
$sel:roleArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:jobOutput:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> BatchInferenceJobOutput
$sel:jobInput:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> BatchInferenceJobInput
$sel:solutionVersionArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:jobName:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:tags:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe [Tag]
$sel:numResults:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe Int
$sel:filterArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe Text
$sel:batchInferenceJobConfig:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe BatchInferenceJobConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe BatchInferenceJobConfig
batchInferenceJobConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
filterArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
solutionVersionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf BatchInferenceJobInput
jobInput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf BatchInferenceJobOutput
jobOutput
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn

instance Data.ToHeaders CreateBatchInferenceJob where
  toHeaders :: CreateBatchInferenceJob -> 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
"AmazonPersonalize.CreateBatchInferenceJob" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateBatchInferenceJob where
  toJSON :: CreateBatchInferenceJob -> Value
toJSON CreateBatchInferenceJob' {Maybe Int
Maybe [Tag]
Maybe Text
Maybe BatchInferenceJobConfig
Text
BatchInferenceJobOutput
BatchInferenceJobInput
roleArn :: Text
jobOutput :: BatchInferenceJobOutput
jobInput :: BatchInferenceJobInput
solutionVersionArn :: Text
jobName :: Text
tags :: Maybe [Tag]
numResults :: Maybe Int
filterArn :: Maybe Text
batchInferenceJobConfig :: Maybe BatchInferenceJobConfig
$sel:roleArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:jobOutput:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> BatchInferenceJobOutput
$sel:jobInput:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> BatchInferenceJobInput
$sel:solutionVersionArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:jobName:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Text
$sel:tags:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe [Tag]
$sel:numResults:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe Int
$sel:filterArn:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe Text
$sel:batchInferenceJobConfig:CreateBatchInferenceJob' :: CreateBatchInferenceJob -> Maybe BatchInferenceJobConfig
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"batchInferenceJobConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchInferenceJobConfig
batchInferenceJobConfig,
            (Key
"filterArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
filterArn,
            (Key
"numResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
numResults,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"jobName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"solutionVersionArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
solutionVersionArn),
            forall a. a -> Maybe a
Prelude.Just (Key
"jobInput" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= BatchInferenceJobInput
jobInput),
            forall a. a -> Maybe a
Prelude.Just (Key
"jobOutput" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= BatchInferenceJobOutput
jobOutput),
            forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateBatchInferenceJobResponse' 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:
--
-- 'batchInferenceJobArn', 'createBatchInferenceJobResponse_batchInferenceJobArn' - The ARN of the batch inference job.
--
-- 'httpStatus', 'createBatchInferenceJobResponse_httpStatus' - The response's http status code.
newCreateBatchInferenceJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateBatchInferenceJobResponse
newCreateBatchInferenceJobResponse :: Int -> CreateBatchInferenceJobResponse
newCreateBatchInferenceJobResponse Int
pHttpStatus_ =
  CreateBatchInferenceJobResponse'
    { $sel:batchInferenceJobArn:CreateBatchInferenceJobResponse' :: Maybe Text
batchInferenceJobArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateBatchInferenceJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the batch inference job.
createBatchInferenceJobResponse_batchInferenceJobArn :: Lens.Lens' CreateBatchInferenceJobResponse (Prelude.Maybe Prelude.Text)
createBatchInferenceJobResponse_batchInferenceJobArn :: Lens' CreateBatchInferenceJobResponse (Maybe Text)
createBatchInferenceJobResponse_batchInferenceJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBatchInferenceJobResponse' {Maybe Text
batchInferenceJobArn :: Maybe Text
$sel:batchInferenceJobArn:CreateBatchInferenceJobResponse' :: CreateBatchInferenceJobResponse -> Maybe Text
batchInferenceJobArn} -> Maybe Text
batchInferenceJobArn) (\s :: CreateBatchInferenceJobResponse
s@CreateBatchInferenceJobResponse' {} Maybe Text
a -> CreateBatchInferenceJobResponse
s {$sel:batchInferenceJobArn:CreateBatchInferenceJobResponse' :: Maybe Text
batchInferenceJobArn = Maybe Text
a} :: CreateBatchInferenceJobResponse)

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

instance
  Prelude.NFData
    CreateBatchInferenceJobResponse
  where
  rnf :: CreateBatchInferenceJobResponse -> ()
rnf CreateBatchInferenceJobResponse' {Int
Maybe Text
httpStatus :: Int
batchInferenceJobArn :: Maybe Text
$sel:httpStatus:CreateBatchInferenceJobResponse' :: CreateBatchInferenceJobResponse -> Int
$sel:batchInferenceJobArn:CreateBatchInferenceJobResponse' :: CreateBatchInferenceJobResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
batchInferenceJobArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus