{-# 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.SageMaker.CreateInferenceRecommendationsJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Starts a recommendation job. You can create either an instance
-- recommendation or load test job.
module Amazonka.SageMaker.CreateInferenceRecommendationsJob
  ( -- * Creating a Request
    CreateInferenceRecommendationsJob (..),
    newCreateInferenceRecommendationsJob,

    -- * Request Lenses
    createInferenceRecommendationsJob_jobDescription,
    createInferenceRecommendationsJob_outputConfig,
    createInferenceRecommendationsJob_stoppingConditions,
    createInferenceRecommendationsJob_tags,
    createInferenceRecommendationsJob_jobName,
    createInferenceRecommendationsJob_jobType,
    createInferenceRecommendationsJob_roleArn,
    createInferenceRecommendationsJob_inputConfig,

    -- * Destructuring the Response
    CreateInferenceRecommendationsJobResponse (..),
    newCreateInferenceRecommendationsJobResponse,

    -- * Response Lenses
    createInferenceRecommendationsJobResponse_httpStatus,
    createInferenceRecommendationsJobResponse_jobArn,
  )
where

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

-- | /See:/ 'newCreateInferenceRecommendationsJob' smart constructor.
data CreateInferenceRecommendationsJob = CreateInferenceRecommendationsJob'
  { -- | Description of the recommendation job.
    CreateInferenceRecommendationsJob -> Maybe Text
jobDescription :: Prelude.Maybe Prelude.Text,
    -- | Provides information about the output artifacts and the KMS key to use
    -- for Amazon S3 server-side encryption.
    CreateInferenceRecommendationsJob
-> Maybe RecommendationJobOutputConfig
outputConfig :: Prelude.Maybe RecommendationJobOutputConfig,
    -- | A set of conditions for stopping a recommendation job. If any of the
    -- conditions are met, the job is automatically stopped.
    CreateInferenceRecommendationsJob
-> Maybe RecommendationJobStoppingConditions
stoppingConditions :: Prelude.Maybe RecommendationJobStoppingConditions,
    -- | The metadata that you apply to Amazon Web Services resources to help you
    -- categorize and organize them. Each tag consists of a key and a value,
    -- both of which you define. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
    -- in the Amazon Web Services General Reference.
    CreateInferenceRecommendationsJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A name for the recommendation job. The name must be unique within the
    -- Amazon Web Services Region and within your Amazon Web Services account.
    CreateInferenceRecommendationsJob -> Text
jobName :: Prelude.Text,
    -- | Defines the type of recommendation job. Specify @Default@ to initiate an
    -- instance recommendation and @Advanced@ to initiate a load test. If left
    -- unspecified, Amazon SageMaker Inference Recommender will run an instance
    -- recommendation (@DEFAULT@) job.
    CreateInferenceRecommendationsJob -> RecommendationJobType
jobType :: RecommendationJobType,
    -- | The Amazon Resource Name (ARN) of an IAM role that enables Amazon
    -- SageMaker to perform tasks on your behalf.
    CreateInferenceRecommendationsJob -> Text
roleArn :: Prelude.Text,
    -- | Provides information about the versioned model package Amazon Resource
    -- Name (ARN), the traffic pattern, and endpoint configurations.
    CreateInferenceRecommendationsJob -> RecommendationJobInputConfig
inputConfig :: RecommendationJobInputConfig
  }
  deriving (CreateInferenceRecommendationsJob
-> CreateInferenceRecommendationsJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInferenceRecommendationsJob
-> CreateInferenceRecommendationsJob -> Bool
$c/= :: CreateInferenceRecommendationsJob
-> CreateInferenceRecommendationsJob -> Bool
== :: CreateInferenceRecommendationsJob
-> CreateInferenceRecommendationsJob -> Bool
$c== :: CreateInferenceRecommendationsJob
-> CreateInferenceRecommendationsJob -> Bool
Prelude.Eq, ReadPrec [CreateInferenceRecommendationsJob]
ReadPrec CreateInferenceRecommendationsJob
Int -> ReadS CreateInferenceRecommendationsJob
ReadS [CreateInferenceRecommendationsJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInferenceRecommendationsJob]
$creadListPrec :: ReadPrec [CreateInferenceRecommendationsJob]
readPrec :: ReadPrec CreateInferenceRecommendationsJob
$creadPrec :: ReadPrec CreateInferenceRecommendationsJob
readList :: ReadS [CreateInferenceRecommendationsJob]
$creadList :: ReadS [CreateInferenceRecommendationsJob]
readsPrec :: Int -> ReadS CreateInferenceRecommendationsJob
$creadsPrec :: Int -> ReadS CreateInferenceRecommendationsJob
Prelude.Read, Int -> CreateInferenceRecommendationsJob -> ShowS
[CreateInferenceRecommendationsJob] -> ShowS
CreateInferenceRecommendationsJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInferenceRecommendationsJob] -> ShowS
$cshowList :: [CreateInferenceRecommendationsJob] -> ShowS
show :: CreateInferenceRecommendationsJob -> String
$cshow :: CreateInferenceRecommendationsJob -> String
showsPrec :: Int -> CreateInferenceRecommendationsJob -> ShowS
$cshowsPrec :: Int -> CreateInferenceRecommendationsJob -> ShowS
Prelude.Show, forall x.
Rep CreateInferenceRecommendationsJob x
-> CreateInferenceRecommendationsJob
forall x.
CreateInferenceRecommendationsJob
-> Rep CreateInferenceRecommendationsJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateInferenceRecommendationsJob x
-> CreateInferenceRecommendationsJob
$cfrom :: forall x.
CreateInferenceRecommendationsJob
-> Rep CreateInferenceRecommendationsJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateInferenceRecommendationsJob' 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:
--
-- 'jobDescription', 'createInferenceRecommendationsJob_jobDescription' - Description of the recommendation job.
--
-- 'outputConfig', 'createInferenceRecommendationsJob_outputConfig' - Provides information about the output artifacts and the KMS key to use
-- for Amazon S3 server-side encryption.
--
-- 'stoppingConditions', 'createInferenceRecommendationsJob_stoppingConditions' - A set of conditions for stopping a recommendation job. If any of the
-- conditions are met, the job is automatically stopped.
--
-- 'tags', 'createInferenceRecommendationsJob_tags' - The metadata that you apply to Amazon Web Services resources to help you
-- categorize and organize them. Each tag consists of a key and a value,
-- both of which you define. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- in the Amazon Web Services General Reference.
--
-- 'jobName', 'createInferenceRecommendationsJob_jobName' - A name for the recommendation job. The name must be unique within the
-- Amazon Web Services Region and within your Amazon Web Services account.
--
-- 'jobType', 'createInferenceRecommendationsJob_jobType' - Defines the type of recommendation job. Specify @Default@ to initiate an
-- instance recommendation and @Advanced@ to initiate a load test. If left
-- unspecified, Amazon SageMaker Inference Recommender will run an instance
-- recommendation (@DEFAULT@) job.
--
-- 'roleArn', 'createInferenceRecommendationsJob_roleArn' - The Amazon Resource Name (ARN) of an IAM role that enables Amazon
-- SageMaker to perform tasks on your behalf.
--
-- 'inputConfig', 'createInferenceRecommendationsJob_inputConfig' - Provides information about the versioned model package Amazon Resource
-- Name (ARN), the traffic pattern, and endpoint configurations.
newCreateInferenceRecommendationsJob ::
  -- | 'jobName'
  Prelude.Text ->
  -- | 'jobType'
  RecommendationJobType ->
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'inputConfig'
  RecommendationJobInputConfig ->
  CreateInferenceRecommendationsJob
newCreateInferenceRecommendationsJob :: Text
-> RecommendationJobType
-> Text
-> RecommendationJobInputConfig
-> CreateInferenceRecommendationsJob
newCreateInferenceRecommendationsJob
  Text
pJobName_
  RecommendationJobType
pJobType_
  Text
pRoleArn_
  RecommendationJobInputConfig
pInputConfig_ =
    CreateInferenceRecommendationsJob'
      { $sel:jobDescription:CreateInferenceRecommendationsJob' :: Maybe Text
jobDescription =
          forall a. Maybe a
Prelude.Nothing,
        $sel:outputConfig:CreateInferenceRecommendationsJob' :: Maybe RecommendationJobOutputConfig
outputConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:stoppingConditions:CreateInferenceRecommendationsJob' :: Maybe RecommendationJobStoppingConditions
stoppingConditions = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateInferenceRecommendationsJob' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:jobName:CreateInferenceRecommendationsJob' :: Text
jobName = Text
pJobName_,
        $sel:jobType:CreateInferenceRecommendationsJob' :: RecommendationJobType
jobType = RecommendationJobType
pJobType_,
        $sel:roleArn:CreateInferenceRecommendationsJob' :: Text
roleArn = Text
pRoleArn_,
        $sel:inputConfig:CreateInferenceRecommendationsJob' :: RecommendationJobInputConfig
inputConfig = RecommendationJobInputConfig
pInputConfig_
      }

-- | Description of the recommendation job.
createInferenceRecommendationsJob_jobDescription :: Lens.Lens' CreateInferenceRecommendationsJob (Prelude.Maybe Prelude.Text)
createInferenceRecommendationsJob_jobDescription :: Lens' CreateInferenceRecommendationsJob (Maybe Text)
createInferenceRecommendationsJob_jobDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJob' {Maybe Text
jobDescription :: Maybe Text
$sel:jobDescription:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Maybe Text
jobDescription} -> Maybe Text
jobDescription) (\s :: CreateInferenceRecommendationsJob
s@CreateInferenceRecommendationsJob' {} Maybe Text
a -> CreateInferenceRecommendationsJob
s {$sel:jobDescription:CreateInferenceRecommendationsJob' :: Maybe Text
jobDescription = Maybe Text
a} :: CreateInferenceRecommendationsJob)

-- | Provides information about the output artifacts and the KMS key to use
-- for Amazon S3 server-side encryption.
createInferenceRecommendationsJob_outputConfig :: Lens.Lens' CreateInferenceRecommendationsJob (Prelude.Maybe RecommendationJobOutputConfig)
createInferenceRecommendationsJob_outputConfig :: Lens'
  CreateInferenceRecommendationsJob
  (Maybe RecommendationJobOutputConfig)
createInferenceRecommendationsJob_outputConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJob' {Maybe RecommendationJobOutputConfig
outputConfig :: Maybe RecommendationJobOutputConfig
$sel:outputConfig:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob
-> Maybe RecommendationJobOutputConfig
outputConfig} -> Maybe RecommendationJobOutputConfig
outputConfig) (\s :: CreateInferenceRecommendationsJob
s@CreateInferenceRecommendationsJob' {} Maybe RecommendationJobOutputConfig
a -> CreateInferenceRecommendationsJob
s {$sel:outputConfig:CreateInferenceRecommendationsJob' :: Maybe RecommendationJobOutputConfig
outputConfig = Maybe RecommendationJobOutputConfig
a} :: CreateInferenceRecommendationsJob)

-- | A set of conditions for stopping a recommendation job. If any of the
-- conditions are met, the job is automatically stopped.
createInferenceRecommendationsJob_stoppingConditions :: Lens.Lens' CreateInferenceRecommendationsJob (Prelude.Maybe RecommendationJobStoppingConditions)
createInferenceRecommendationsJob_stoppingConditions :: Lens'
  CreateInferenceRecommendationsJob
  (Maybe RecommendationJobStoppingConditions)
createInferenceRecommendationsJob_stoppingConditions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJob' {Maybe RecommendationJobStoppingConditions
stoppingConditions :: Maybe RecommendationJobStoppingConditions
$sel:stoppingConditions:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob
-> Maybe RecommendationJobStoppingConditions
stoppingConditions} -> Maybe RecommendationJobStoppingConditions
stoppingConditions) (\s :: CreateInferenceRecommendationsJob
s@CreateInferenceRecommendationsJob' {} Maybe RecommendationJobStoppingConditions
a -> CreateInferenceRecommendationsJob
s {$sel:stoppingConditions:CreateInferenceRecommendationsJob' :: Maybe RecommendationJobStoppingConditions
stoppingConditions = Maybe RecommendationJobStoppingConditions
a} :: CreateInferenceRecommendationsJob)

-- | The metadata that you apply to Amazon Web Services resources to help you
-- categorize and organize them. Each tag consists of a key and a value,
-- both of which you define. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- in the Amazon Web Services General Reference.
createInferenceRecommendationsJob_tags :: Lens.Lens' CreateInferenceRecommendationsJob (Prelude.Maybe [Tag])
createInferenceRecommendationsJob_tags :: Lens' CreateInferenceRecommendationsJob (Maybe [Tag])
createInferenceRecommendationsJob_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateInferenceRecommendationsJob
s@CreateInferenceRecommendationsJob' {} Maybe [Tag]
a -> CreateInferenceRecommendationsJob
s {$sel:tags:CreateInferenceRecommendationsJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateInferenceRecommendationsJob) 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

-- | A name for the recommendation job. The name must be unique within the
-- Amazon Web Services Region and within your Amazon Web Services account.
createInferenceRecommendationsJob_jobName :: Lens.Lens' CreateInferenceRecommendationsJob Prelude.Text
createInferenceRecommendationsJob_jobName :: Lens' CreateInferenceRecommendationsJob Text
createInferenceRecommendationsJob_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJob' {Text
jobName :: Text
$sel:jobName:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Text
jobName} -> Text
jobName) (\s :: CreateInferenceRecommendationsJob
s@CreateInferenceRecommendationsJob' {} Text
a -> CreateInferenceRecommendationsJob
s {$sel:jobName:CreateInferenceRecommendationsJob' :: Text
jobName = Text
a} :: CreateInferenceRecommendationsJob)

-- | Defines the type of recommendation job. Specify @Default@ to initiate an
-- instance recommendation and @Advanced@ to initiate a load test. If left
-- unspecified, Amazon SageMaker Inference Recommender will run an instance
-- recommendation (@DEFAULT@) job.
createInferenceRecommendationsJob_jobType :: Lens.Lens' CreateInferenceRecommendationsJob RecommendationJobType
createInferenceRecommendationsJob_jobType :: Lens' CreateInferenceRecommendationsJob RecommendationJobType
createInferenceRecommendationsJob_jobType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJob' {RecommendationJobType
jobType :: RecommendationJobType
$sel:jobType:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> RecommendationJobType
jobType} -> RecommendationJobType
jobType) (\s :: CreateInferenceRecommendationsJob
s@CreateInferenceRecommendationsJob' {} RecommendationJobType
a -> CreateInferenceRecommendationsJob
s {$sel:jobType:CreateInferenceRecommendationsJob' :: RecommendationJobType
jobType = RecommendationJobType
a} :: CreateInferenceRecommendationsJob)

-- | The Amazon Resource Name (ARN) of an IAM role that enables Amazon
-- SageMaker to perform tasks on your behalf.
createInferenceRecommendationsJob_roleArn :: Lens.Lens' CreateInferenceRecommendationsJob Prelude.Text
createInferenceRecommendationsJob_roleArn :: Lens' CreateInferenceRecommendationsJob Text
createInferenceRecommendationsJob_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJob' {Text
roleArn :: Text
$sel:roleArn:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Text
roleArn} -> Text
roleArn) (\s :: CreateInferenceRecommendationsJob
s@CreateInferenceRecommendationsJob' {} Text
a -> CreateInferenceRecommendationsJob
s {$sel:roleArn:CreateInferenceRecommendationsJob' :: Text
roleArn = Text
a} :: CreateInferenceRecommendationsJob)

-- | Provides information about the versioned model package Amazon Resource
-- Name (ARN), the traffic pattern, and endpoint configurations.
createInferenceRecommendationsJob_inputConfig :: Lens.Lens' CreateInferenceRecommendationsJob RecommendationJobInputConfig
createInferenceRecommendationsJob_inputConfig :: Lens'
  CreateInferenceRecommendationsJob RecommendationJobInputConfig
createInferenceRecommendationsJob_inputConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJob' {RecommendationJobInputConfig
inputConfig :: RecommendationJobInputConfig
$sel:inputConfig:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> RecommendationJobInputConfig
inputConfig} -> RecommendationJobInputConfig
inputConfig) (\s :: CreateInferenceRecommendationsJob
s@CreateInferenceRecommendationsJob' {} RecommendationJobInputConfig
a -> CreateInferenceRecommendationsJob
s {$sel:inputConfig:CreateInferenceRecommendationsJob' :: RecommendationJobInputConfig
inputConfig = RecommendationJobInputConfig
a} :: CreateInferenceRecommendationsJob)

instance
  Core.AWSRequest
    CreateInferenceRecommendationsJob
  where
  type
    AWSResponse CreateInferenceRecommendationsJob =
      CreateInferenceRecommendationsJobResponse
  request :: (Service -> Service)
-> CreateInferenceRecommendationsJob
-> Request CreateInferenceRecommendationsJob
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 CreateInferenceRecommendationsJob
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateInferenceRecommendationsJob)))
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 ->
          Int -> Text -> CreateInferenceRecommendationsJobResponse
CreateInferenceRecommendationsJobResponse'
            forall (f :: * -> *) a b. Functor 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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"JobArn")
      )

instance
  Prelude.Hashable
    CreateInferenceRecommendationsJob
  where
  hashWithSalt :: Int -> CreateInferenceRecommendationsJob -> Int
hashWithSalt
    Int
_salt
    CreateInferenceRecommendationsJob' {Maybe [Tag]
Maybe Text
Maybe RecommendationJobOutputConfig
Maybe RecommendationJobStoppingConditions
Text
RecommendationJobType
RecommendationJobInputConfig
inputConfig :: RecommendationJobInputConfig
roleArn :: Text
jobType :: RecommendationJobType
jobName :: Text
tags :: Maybe [Tag]
stoppingConditions :: Maybe RecommendationJobStoppingConditions
outputConfig :: Maybe RecommendationJobOutputConfig
jobDescription :: Maybe Text
$sel:inputConfig:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> RecommendationJobInputConfig
$sel:roleArn:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Text
$sel:jobType:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> RecommendationJobType
$sel:jobName:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Text
$sel:tags:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Maybe [Tag]
$sel:stoppingConditions:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob
-> Maybe RecommendationJobStoppingConditions
$sel:outputConfig:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob
-> Maybe RecommendationJobOutputConfig
$sel:jobDescription:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobDescription
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RecommendationJobOutputConfig
outputConfig
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RecommendationJobStoppingConditions
stoppingConditions
        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` RecommendationJobType
jobType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RecommendationJobInputConfig
inputConfig

instance
  Prelude.NFData
    CreateInferenceRecommendationsJob
  where
  rnf :: CreateInferenceRecommendationsJob -> ()
rnf CreateInferenceRecommendationsJob' {Maybe [Tag]
Maybe Text
Maybe RecommendationJobOutputConfig
Maybe RecommendationJobStoppingConditions
Text
RecommendationJobType
RecommendationJobInputConfig
inputConfig :: RecommendationJobInputConfig
roleArn :: Text
jobType :: RecommendationJobType
jobName :: Text
tags :: Maybe [Tag]
stoppingConditions :: Maybe RecommendationJobStoppingConditions
outputConfig :: Maybe RecommendationJobOutputConfig
jobDescription :: Maybe Text
$sel:inputConfig:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> RecommendationJobInputConfig
$sel:roleArn:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Text
$sel:jobType:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> RecommendationJobType
$sel:jobName:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Text
$sel:tags:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Maybe [Tag]
$sel:stoppingConditions:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob
-> Maybe RecommendationJobStoppingConditions
$sel:outputConfig:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob
-> Maybe RecommendationJobOutputConfig
$sel:jobDescription:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RecommendationJobOutputConfig
outputConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RecommendationJobStoppingConditions
stoppingConditions
      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 RecommendationJobType
jobType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RecommendationJobInputConfig
inputConfig

instance
  Data.ToHeaders
    CreateInferenceRecommendationsJob
  where
  toHeaders :: CreateInferenceRecommendationsJob -> 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
"SageMaker.CreateInferenceRecommendationsJob" ::
                          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
    CreateInferenceRecommendationsJob
  where
  toJSON :: CreateInferenceRecommendationsJob -> Value
toJSON CreateInferenceRecommendationsJob' {Maybe [Tag]
Maybe Text
Maybe RecommendationJobOutputConfig
Maybe RecommendationJobStoppingConditions
Text
RecommendationJobType
RecommendationJobInputConfig
inputConfig :: RecommendationJobInputConfig
roleArn :: Text
jobType :: RecommendationJobType
jobName :: Text
tags :: Maybe [Tag]
stoppingConditions :: Maybe RecommendationJobStoppingConditions
outputConfig :: Maybe RecommendationJobOutputConfig
jobDescription :: Maybe Text
$sel:inputConfig:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> RecommendationJobInputConfig
$sel:roleArn:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Text
$sel:jobType:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> RecommendationJobType
$sel:jobName:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Text
$sel:tags:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Maybe [Tag]
$sel:stoppingConditions:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob
-> Maybe RecommendationJobStoppingConditions
$sel:outputConfig:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob
-> Maybe RecommendationJobOutputConfig
$sel:jobDescription:CreateInferenceRecommendationsJob' :: CreateInferenceRecommendationsJob -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"JobDescription" 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
jobDescription,
            (Key
"OutputConfig" 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 RecommendationJobOutputConfig
outputConfig,
            (Key
"StoppingConditions" 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 RecommendationJobStoppingConditions
stoppingConditions,
            (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
"JobType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RecommendationJobType
jobType),
            forall a. a -> Maybe a
Prelude.Just (Key
"RoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn),
            forall a. a -> Maybe a
Prelude.Just (Key
"InputConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RecommendationJobInputConfig
inputConfig)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateInferenceRecommendationsJobResponse' 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', 'createInferenceRecommendationsJobResponse_httpStatus' - The response's http status code.
--
-- 'jobArn', 'createInferenceRecommendationsJobResponse_jobArn' - The Amazon Resource Name (ARN) of the recommendation job.
newCreateInferenceRecommendationsJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'jobArn'
  Prelude.Text ->
  CreateInferenceRecommendationsJobResponse
newCreateInferenceRecommendationsJobResponse :: Int -> Text -> CreateInferenceRecommendationsJobResponse
newCreateInferenceRecommendationsJobResponse
  Int
pHttpStatus_
  Text
pJobArn_ =
    CreateInferenceRecommendationsJobResponse'
      { $sel:httpStatus:CreateInferenceRecommendationsJobResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:jobArn:CreateInferenceRecommendationsJobResponse' :: Text
jobArn = Text
pJobArn_
      }

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

-- | The Amazon Resource Name (ARN) of the recommendation job.
createInferenceRecommendationsJobResponse_jobArn :: Lens.Lens' CreateInferenceRecommendationsJobResponse Prelude.Text
createInferenceRecommendationsJobResponse_jobArn :: Lens' CreateInferenceRecommendationsJobResponse Text
createInferenceRecommendationsJobResponse_jobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInferenceRecommendationsJobResponse' {Text
jobArn :: Text
$sel:jobArn:CreateInferenceRecommendationsJobResponse' :: CreateInferenceRecommendationsJobResponse -> Text
jobArn} -> Text
jobArn) (\s :: CreateInferenceRecommendationsJobResponse
s@CreateInferenceRecommendationsJobResponse' {} Text
a -> CreateInferenceRecommendationsJobResponse
s {$sel:jobArn:CreateInferenceRecommendationsJobResponse' :: Text
jobArn = Text
a} :: CreateInferenceRecommendationsJobResponse)

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