{-# 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.Personalize.Types.AutoMLResult
-- 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.Personalize.Types.AutoMLResult where

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

-- | When the solution performs AutoML (@performAutoML@ is true in
-- CreateSolution), specifies the recipe that best optimized the specified
-- metric.
--
-- /See:/ 'newAutoMLResult' smart constructor.
data AutoMLResult = AutoMLResult'
  { -- | The Amazon Resource Name (ARN) of the best recipe.
    AutoMLResult -> Maybe Text
bestRecipeArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AutoMLResult -> AutoMLResult -> Bool
(AutoMLResult -> AutoMLResult -> Bool)
-> (AutoMLResult -> AutoMLResult -> Bool) -> Eq AutoMLResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoMLResult -> AutoMLResult -> Bool
$c/= :: AutoMLResult -> AutoMLResult -> Bool
== :: AutoMLResult -> AutoMLResult -> Bool
$c== :: AutoMLResult -> AutoMLResult -> Bool
Prelude.Eq, ReadPrec [AutoMLResult]
ReadPrec AutoMLResult
Int -> ReadS AutoMLResult
ReadS [AutoMLResult]
(Int -> ReadS AutoMLResult)
-> ReadS [AutoMLResult]
-> ReadPrec AutoMLResult
-> ReadPrec [AutoMLResult]
-> Read AutoMLResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoMLResult]
$creadListPrec :: ReadPrec [AutoMLResult]
readPrec :: ReadPrec AutoMLResult
$creadPrec :: ReadPrec AutoMLResult
readList :: ReadS [AutoMLResult]
$creadList :: ReadS [AutoMLResult]
readsPrec :: Int -> ReadS AutoMLResult
$creadsPrec :: Int -> ReadS AutoMLResult
Prelude.Read, Int -> AutoMLResult -> ShowS
[AutoMLResult] -> ShowS
AutoMLResult -> String
(Int -> AutoMLResult -> ShowS)
-> (AutoMLResult -> String)
-> ([AutoMLResult] -> ShowS)
-> Show AutoMLResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoMLResult] -> ShowS
$cshowList :: [AutoMLResult] -> ShowS
show :: AutoMLResult -> String
$cshow :: AutoMLResult -> String
showsPrec :: Int -> AutoMLResult -> ShowS
$cshowsPrec :: Int -> AutoMLResult -> ShowS
Prelude.Show, (forall x. AutoMLResult -> Rep AutoMLResult x)
-> (forall x. Rep AutoMLResult x -> AutoMLResult)
-> Generic AutoMLResult
forall x. Rep AutoMLResult x -> AutoMLResult
forall x. AutoMLResult -> Rep AutoMLResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoMLResult x -> AutoMLResult
$cfrom :: forall x. AutoMLResult -> Rep AutoMLResult x
Prelude.Generic)

-- |
-- Create a value of 'AutoMLResult' 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:
--
-- 'bestRecipeArn', 'autoMLResult_bestRecipeArn' - The Amazon Resource Name (ARN) of the best recipe.
newAutoMLResult ::
  AutoMLResult
newAutoMLResult :: AutoMLResult
newAutoMLResult =
  AutoMLResult' :: Maybe Text -> AutoMLResult
AutoMLResult' {$sel:bestRecipeArn:AutoMLResult' :: Maybe Text
bestRecipeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The Amazon Resource Name (ARN) of the best recipe.
autoMLResult_bestRecipeArn :: Lens.Lens' AutoMLResult (Prelude.Maybe Prelude.Text)
autoMLResult_bestRecipeArn :: (Maybe Text -> f (Maybe Text)) -> AutoMLResult -> f AutoMLResult
autoMLResult_bestRecipeArn = (AutoMLResult -> Maybe Text)
-> (AutoMLResult -> Maybe Text -> AutoMLResult)
-> Lens AutoMLResult AutoMLResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoMLResult' {Maybe Text
bestRecipeArn :: Maybe Text
$sel:bestRecipeArn:AutoMLResult' :: AutoMLResult -> Maybe Text
bestRecipeArn} -> Maybe Text
bestRecipeArn) (\s :: AutoMLResult
s@AutoMLResult' {} Maybe Text
a -> AutoMLResult
s {$sel:bestRecipeArn:AutoMLResult' :: Maybe Text
bestRecipeArn = Maybe Text
a} :: AutoMLResult)

instance Core.FromJSON AutoMLResult where
  parseJSON :: Value -> Parser AutoMLResult
parseJSON =
    String
-> (Object -> Parser AutoMLResult) -> Value -> Parser AutoMLResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AutoMLResult"
      ( \Object
x ->
          Maybe Text -> AutoMLResult
AutoMLResult'
            (Maybe Text -> AutoMLResult)
-> Parser (Maybe Text) -> Parser AutoMLResult
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
"bestRecipeArn")
      )

instance Prelude.Hashable AutoMLResult

instance Prelude.NFData AutoMLResult