{-# 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.TrainingJobStepMetadata
-- 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)
module Amazonka.SageMaker.Types.TrainingJobStepMetadata where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Metadata for a training job step.
--
-- /See:/ 'newTrainingJobStepMetadata' smart constructor.
data TrainingJobStepMetadata = TrainingJobStepMetadata'
  { -- | The Amazon Resource Name (ARN) of the training job that was run by this
    -- step execution.
    TrainingJobStepMetadata -> Maybe Text
arn :: Prelude.Maybe Prelude.Text
  }
  deriving (TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
(TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool)
-> (TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool)
-> Eq TrainingJobStepMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
$c/= :: TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
== :: TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
$c== :: TrainingJobStepMetadata -> TrainingJobStepMetadata -> Bool
Prelude.Eq, ReadPrec [TrainingJobStepMetadata]
ReadPrec TrainingJobStepMetadata
Int -> ReadS TrainingJobStepMetadata
ReadS [TrainingJobStepMetadata]
(Int -> ReadS TrainingJobStepMetadata)
-> ReadS [TrainingJobStepMetadata]
-> ReadPrec TrainingJobStepMetadata
-> ReadPrec [TrainingJobStepMetadata]
-> Read TrainingJobStepMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrainingJobStepMetadata]
$creadListPrec :: ReadPrec [TrainingJobStepMetadata]
readPrec :: ReadPrec TrainingJobStepMetadata
$creadPrec :: ReadPrec TrainingJobStepMetadata
readList :: ReadS [TrainingJobStepMetadata]
$creadList :: ReadS [TrainingJobStepMetadata]
readsPrec :: Int -> ReadS TrainingJobStepMetadata
$creadsPrec :: Int -> ReadS TrainingJobStepMetadata
Prelude.Read, Int -> TrainingJobStepMetadata -> ShowS
[TrainingJobStepMetadata] -> ShowS
TrainingJobStepMetadata -> String
(Int -> TrainingJobStepMetadata -> ShowS)
-> (TrainingJobStepMetadata -> String)
-> ([TrainingJobStepMetadata] -> ShowS)
-> Show TrainingJobStepMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrainingJobStepMetadata] -> ShowS
$cshowList :: [TrainingJobStepMetadata] -> ShowS
show :: TrainingJobStepMetadata -> String
$cshow :: TrainingJobStepMetadata -> String
showsPrec :: Int -> TrainingJobStepMetadata -> ShowS
$cshowsPrec :: Int -> TrainingJobStepMetadata -> ShowS
Prelude.Show, (forall x.
 TrainingJobStepMetadata -> Rep TrainingJobStepMetadata x)
-> (forall x.
    Rep TrainingJobStepMetadata x -> TrainingJobStepMetadata)
-> Generic TrainingJobStepMetadata
forall x. Rep TrainingJobStepMetadata x -> TrainingJobStepMetadata
forall x. TrainingJobStepMetadata -> Rep TrainingJobStepMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrainingJobStepMetadata x -> TrainingJobStepMetadata
$cfrom :: forall x. TrainingJobStepMetadata -> Rep TrainingJobStepMetadata x
Prelude.Generic)

-- |
-- Create a value of 'TrainingJobStepMetadata' 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:
--
-- 'arn', 'trainingJobStepMetadata_arn' - The Amazon Resource Name (ARN) of the training job that was run by this
-- step execution.
newTrainingJobStepMetadata ::
  TrainingJobStepMetadata
newTrainingJobStepMetadata :: TrainingJobStepMetadata
newTrainingJobStepMetadata =
  TrainingJobStepMetadata' :: Maybe Text -> TrainingJobStepMetadata
TrainingJobStepMetadata' {$sel:arn:TrainingJobStepMetadata' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The Amazon Resource Name (ARN) of the training job that was run by this
-- step execution.
trainingJobStepMetadata_arn :: Lens.Lens' TrainingJobStepMetadata (Prelude.Maybe Prelude.Text)
trainingJobStepMetadata_arn :: (Maybe Text -> f (Maybe Text))
-> TrainingJobStepMetadata -> f TrainingJobStepMetadata
trainingJobStepMetadata_arn = (TrainingJobStepMetadata -> Maybe Text)
-> (TrainingJobStepMetadata
    -> Maybe Text -> TrainingJobStepMetadata)
-> Lens
     TrainingJobStepMetadata
     TrainingJobStepMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrainingJobStepMetadata' {Maybe Text
arn :: Maybe Text
$sel:arn:TrainingJobStepMetadata' :: TrainingJobStepMetadata -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TrainingJobStepMetadata
s@TrainingJobStepMetadata' {} Maybe Text
a -> TrainingJobStepMetadata
s {$sel:arn:TrainingJobStepMetadata' :: Maybe Text
arn = Maybe Text
a} :: TrainingJobStepMetadata)

instance Core.FromJSON TrainingJobStepMetadata where
  parseJSON :: Value -> Parser TrainingJobStepMetadata
parseJSON =
    String
-> (Object -> Parser TrainingJobStepMetadata)
-> Value
-> Parser TrainingJobStepMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TrainingJobStepMetadata"
      ( \Object
x ->
          Maybe Text -> TrainingJobStepMetadata
TrainingJobStepMetadata'
            (Maybe Text -> TrainingJobStepMetadata)
-> Parser (Maybe Text) -> Parser TrainingJobStepMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
      )

instance Prelude.Hashable TrainingJobStepMetadata

instance Prelude.NFData TrainingJobStepMetadata