{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.InferenceRecommendationsJobStep
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.InferenceRecommendationsJobStep 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 Amazonka.SageMaker.Types.RecommendationJobInferenceBenchmark
import Amazonka.SageMaker.Types.RecommendationJobStatus
import Amazonka.SageMaker.Types.RecommendationStepType

-- | A returned array object for the @Steps@ response field in the
-- <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_InferenceRecommendationsJobStep.html ListInferenceRecommendationsJobSteps>
-- API command.
--
-- /See:/ 'newInferenceRecommendationsJobStep' smart constructor.
data InferenceRecommendationsJobStep = InferenceRecommendationsJobStep'
  { -- | The details for a specific benchmark.
    InferenceRecommendationsJobStep
-> Maybe RecommendationJobInferenceBenchmark
inferenceBenchmark :: Prelude.Maybe RecommendationJobInferenceBenchmark,
    -- | The type of the subtask.
    --
    -- @BENCHMARK@: Evaluate the performance of your model on different
    -- instance types.
    InferenceRecommendationsJobStep -> RecommendationStepType
stepType :: RecommendationStepType,
    -- | The name of the Inference Recommender job.
    InferenceRecommendationsJobStep -> Text
jobName :: Prelude.Text,
    -- | The current status of the benchmark.
    InferenceRecommendationsJobStep -> RecommendationJobStatus
status :: RecommendationJobStatus
  }
  deriving (InferenceRecommendationsJobStep
-> InferenceRecommendationsJobStep -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InferenceRecommendationsJobStep
-> InferenceRecommendationsJobStep -> Bool
$c/= :: InferenceRecommendationsJobStep
-> InferenceRecommendationsJobStep -> Bool
== :: InferenceRecommendationsJobStep
-> InferenceRecommendationsJobStep -> Bool
$c== :: InferenceRecommendationsJobStep
-> InferenceRecommendationsJobStep -> Bool
Prelude.Eq, ReadPrec [InferenceRecommendationsJobStep]
ReadPrec InferenceRecommendationsJobStep
Int -> ReadS InferenceRecommendationsJobStep
ReadS [InferenceRecommendationsJobStep]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InferenceRecommendationsJobStep]
$creadListPrec :: ReadPrec [InferenceRecommendationsJobStep]
readPrec :: ReadPrec InferenceRecommendationsJobStep
$creadPrec :: ReadPrec InferenceRecommendationsJobStep
readList :: ReadS [InferenceRecommendationsJobStep]
$creadList :: ReadS [InferenceRecommendationsJobStep]
readsPrec :: Int -> ReadS InferenceRecommendationsJobStep
$creadsPrec :: Int -> ReadS InferenceRecommendationsJobStep
Prelude.Read, Int -> InferenceRecommendationsJobStep -> ShowS
[InferenceRecommendationsJobStep] -> ShowS
InferenceRecommendationsJobStep -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InferenceRecommendationsJobStep] -> ShowS
$cshowList :: [InferenceRecommendationsJobStep] -> ShowS
show :: InferenceRecommendationsJobStep -> String
$cshow :: InferenceRecommendationsJobStep -> String
showsPrec :: Int -> InferenceRecommendationsJobStep -> ShowS
$cshowsPrec :: Int -> InferenceRecommendationsJobStep -> ShowS
Prelude.Show, forall x.
Rep InferenceRecommendationsJobStep x
-> InferenceRecommendationsJobStep
forall x.
InferenceRecommendationsJobStep
-> Rep InferenceRecommendationsJobStep x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InferenceRecommendationsJobStep x
-> InferenceRecommendationsJobStep
$cfrom :: forall x.
InferenceRecommendationsJobStep
-> Rep InferenceRecommendationsJobStep x
Prelude.Generic)

-- |
-- Create a value of 'InferenceRecommendationsJobStep' 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:
--
-- 'inferenceBenchmark', 'inferenceRecommendationsJobStep_inferenceBenchmark' - The details for a specific benchmark.
--
-- 'stepType', 'inferenceRecommendationsJobStep_stepType' - The type of the subtask.
--
-- @BENCHMARK@: Evaluate the performance of your model on different
-- instance types.
--
-- 'jobName', 'inferenceRecommendationsJobStep_jobName' - The name of the Inference Recommender job.
--
-- 'status', 'inferenceRecommendationsJobStep_status' - The current status of the benchmark.
newInferenceRecommendationsJobStep ::
  -- | 'stepType'
  RecommendationStepType ->
  -- | 'jobName'
  Prelude.Text ->
  -- | 'status'
  RecommendationJobStatus ->
  InferenceRecommendationsJobStep
newInferenceRecommendationsJobStep :: RecommendationStepType
-> Text
-> RecommendationJobStatus
-> InferenceRecommendationsJobStep
newInferenceRecommendationsJobStep
  RecommendationStepType
pStepType_
  Text
pJobName_
  RecommendationJobStatus
pStatus_ =
    InferenceRecommendationsJobStep'
      { $sel:inferenceBenchmark:InferenceRecommendationsJobStep' :: Maybe RecommendationJobInferenceBenchmark
inferenceBenchmark =
          forall a. Maybe a
Prelude.Nothing,
        $sel:stepType:InferenceRecommendationsJobStep' :: RecommendationStepType
stepType = RecommendationStepType
pStepType_,
        $sel:jobName:InferenceRecommendationsJobStep' :: Text
jobName = Text
pJobName_,
        $sel:status:InferenceRecommendationsJobStep' :: RecommendationJobStatus
status = RecommendationJobStatus
pStatus_
      }

-- | The details for a specific benchmark.
inferenceRecommendationsJobStep_inferenceBenchmark :: Lens.Lens' InferenceRecommendationsJobStep (Prelude.Maybe RecommendationJobInferenceBenchmark)
inferenceRecommendationsJobStep_inferenceBenchmark :: Lens'
  InferenceRecommendationsJobStep
  (Maybe RecommendationJobInferenceBenchmark)
inferenceRecommendationsJobStep_inferenceBenchmark = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceRecommendationsJobStep' {Maybe RecommendationJobInferenceBenchmark
inferenceBenchmark :: Maybe RecommendationJobInferenceBenchmark
$sel:inferenceBenchmark:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep
-> Maybe RecommendationJobInferenceBenchmark
inferenceBenchmark} -> Maybe RecommendationJobInferenceBenchmark
inferenceBenchmark) (\s :: InferenceRecommendationsJobStep
s@InferenceRecommendationsJobStep' {} Maybe RecommendationJobInferenceBenchmark
a -> InferenceRecommendationsJobStep
s {$sel:inferenceBenchmark:InferenceRecommendationsJobStep' :: Maybe RecommendationJobInferenceBenchmark
inferenceBenchmark = Maybe RecommendationJobInferenceBenchmark
a} :: InferenceRecommendationsJobStep)

-- | The type of the subtask.
--
-- @BENCHMARK@: Evaluate the performance of your model on different
-- instance types.
inferenceRecommendationsJobStep_stepType :: Lens.Lens' InferenceRecommendationsJobStep RecommendationStepType
inferenceRecommendationsJobStep_stepType :: Lens' InferenceRecommendationsJobStep RecommendationStepType
inferenceRecommendationsJobStep_stepType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceRecommendationsJobStep' {RecommendationStepType
stepType :: RecommendationStepType
$sel:stepType:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> RecommendationStepType
stepType} -> RecommendationStepType
stepType) (\s :: InferenceRecommendationsJobStep
s@InferenceRecommendationsJobStep' {} RecommendationStepType
a -> InferenceRecommendationsJobStep
s {$sel:stepType:InferenceRecommendationsJobStep' :: RecommendationStepType
stepType = RecommendationStepType
a} :: InferenceRecommendationsJobStep)

-- | The name of the Inference Recommender job.
inferenceRecommendationsJobStep_jobName :: Lens.Lens' InferenceRecommendationsJobStep Prelude.Text
inferenceRecommendationsJobStep_jobName :: Lens' InferenceRecommendationsJobStep Text
inferenceRecommendationsJobStep_jobName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceRecommendationsJobStep' {Text
jobName :: Text
$sel:jobName:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> Text
jobName} -> Text
jobName) (\s :: InferenceRecommendationsJobStep
s@InferenceRecommendationsJobStep' {} Text
a -> InferenceRecommendationsJobStep
s {$sel:jobName:InferenceRecommendationsJobStep' :: Text
jobName = Text
a} :: InferenceRecommendationsJobStep)

-- | The current status of the benchmark.
inferenceRecommendationsJobStep_status :: Lens.Lens' InferenceRecommendationsJobStep RecommendationJobStatus
inferenceRecommendationsJobStep_status :: Lens' InferenceRecommendationsJobStep RecommendationJobStatus
inferenceRecommendationsJobStep_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InferenceRecommendationsJobStep' {RecommendationJobStatus
status :: RecommendationJobStatus
$sel:status:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> RecommendationJobStatus
status} -> RecommendationJobStatus
status) (\s :: InferenceRecommendationsJobStep
s@InferenceRecommendationsJobStep' {} RecommendationJobStatus
a -> InferenceRecommendationsJobStep
s {$sel:status:InferenceRecommendationsJobStep' :: RecommendationJobStatus
status = RecommendationJobStatus
a} :: InferenceRecommendationsJobStep)

instance
  Data.FromJSON
    InferenceRecommendationsJobStep
  where
  parseJSON :: Value -> Parser InferenceRecommendationsJobStep
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InferenceRecommendationsJobStep"
      ( \Object
x ->
          Maybe RecommendationJobInferenceBenchmark
-> RecommendationStepType
-> Text
-> RecommendationJobStatus
-> InferenceRecommendationsJobStep
InferenceRecommendationsJobStep'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"InferenceBenchmark")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"StepType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"JobName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Status")
      )

instance
  Prelude.Hashable
    InferenceRecommendationsJobStep
  where
  hashWithSalt :: Int -> InferenceRecommendationsJobStep -> Int
hashWithSalt
    Int
_salt
    InferenceRecommendationsJobStep' {Maybe RecommendationJobInferenceBenchmark
Text
RecommendationJobStatus
RecommendationStepType
status :: RecommendationJobStatus
jobName :: Text
stepType :: RecommendationStepType
inferenceBenchmark :: Maybe RecommendationJobInferenceBenchmark
$sel:status:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> RecommendationJobStatus
$sel:jobName:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> Text
$sel:stepType:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> RecommendationStepType
$sel:inferenceBenchmark:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep
-> Maybe RecommendationJobInferenceBenchmark
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RecommendationJobInferenceBenchmark
inferenceBenchmark
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RecommendationStepType
stepType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RecommendationJobStatus
status

instance
  Prelude.NFData
    InferenceRecommendationsJobStep
  where
  rnf :: InferenceRecommendationsJobStep -> ()
rnf InferenceRecommendationsJobStep' {Maybe RecommendationJobInferenceBenchmark
Text
RecommendationJobStatus
RecommendationStepType
status :: RecommendationJobStatus
jobName :: Text
stepType :: RecommendationStepType
inferenceBenchmark :: Maybe RecommendationJobInferenceBenchmark
$sel:status:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> RecommendationJobStatus
$sel:jobName:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> Text
$sel:stepType:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep -> RecommendationStepType
$sel:inferenceBenchmark:InferenceRecommendationsJobStep' :: InferenceRecommendationsJobStep
-> Maybe RecommendationJobInferenceBenchmark
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RecommendationJobInferenceBenchmark
inferenceBenchmark
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RecommendationStepType
stepType
      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 RecommendationJobStatus
status