{-# 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.SolutionVersion
-- 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.Personalize.Types.SolutionVersion 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.SolutionConfig
import Amazonka.Personalize.Types.TrainingMode
import Amazonka.Personalize.Types.TunedHPOParams
import qualified Amazonka.Prelude as Prelude

-- | An object that provides information about a specific version of a
-- <https://docs.aws.amazon.com/personalize/latest/dg/API_Solution.html Solution>
-- in a Custom dataset group.
--
-- /See:/ 'newSolutionVersion' smart constructor.
data SolutionVersion = SolutionVersion'
  { -- | The date and time (in Unix time) that this version of the solution was
    -- created.
    SolutionVersion -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the dataset group providing the
    -- training data.
    SolutionVersion -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The event type (for example, \'click\' or \'like\') that is used for
    -- training the model.
    SolutionVersion -> Maybe Text
eventType :: Prelude.Maybe Prelude.Text,
    -- | If training a solution version fails, the reason for the failure.
    SolutionVersion -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the solution was last updated.
    SolutionVersion -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the solution version.
    SolutionVersion -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | When true, Amazon Personalize searches for the most optimal recipe
    -- according to the solution configuration. When false (the default),
    -- Amazon Personalize uses @recipeArn@.
    SolutionVersion -> Maybe Bool
performAutoML :: Prelude.Maybe Prelude.Bool,
    -- | Whether to perform hyperparameter optimization (HPO) on the chosen
    -- recipe. The default is @false@.
    SolutionVersion -> Maybe Bool
performHPO :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the recipe used in the solution.
    SolutionVersion -> Maybe Text
recipeArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the solution.
    SolutionVersion -> Maybe Text
solutionArn :: Prelude.Maybe Prelude.Text,
    -- | Describes the configuration properties for the solution.
    SolutionVersion -> Maybe SolutionConfig
solutionConfig :: Prelude.Maybe SolutionConfig,
    -- | The ARN of the solution version.
    SolutionVersion -> Maybe Text
solutionVersionArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the solution version.
    --
    -- A solution version can be in one of the following states:
    --
    -- -   CREATE PENDING
    --
    -- -   CREATE IN_PROGRESS
    --
    -- -   ACTIVE
    --
    -- -   CREATE FAILED
    --
    -- -   CREATE STOPPING
    --
    -- -   CREATE STOPPED
    SolutionVersion -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The time used to train the model. You are billed for the time it takes
    -- to train a model. This field is visible only after Amazon Personalize
    -- successfully trains a model.
    SolutionVersion -> Maybe Double
trainingHours :: Prelude.Maybe Prelude.Double,
    -- | The scope of training to be performed when creating the solution
    -- version. The @FULL@ option trains the solution version based on the
    -- entirety of the input solution\'s training data, while the @UPDATE@
    -- option processes only the data that has changed in comparison to the
    -- input solution. Choose @UPDATE@ when you want to incrementally update
    -- your solution version instead of creating an entirely new one.
    --
    -- The @UPDATE@ option can only be used when you already have an active
    -- solution version created from the input solution using the @FULL@ option
    -- and the input solution was trained with the
    -- <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html User-Personalization>
    -- recipe or the
    -- <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html HRNN-Coldstart>
    -- recipe.
    SolutionVersion -> Maybe TrainingMode
trainingMode :: Prelude.Maybe TrainingMode,
    -- | If hyperparameter optimization was performed, contains the
    -- hyperparameter values of the best performing model.
    SolutionVersion -> Maybe TunedHPOParams
tunedHPOParams :: Prelude.Maybe TunedHPOParams
  }
  deriving (SolutionVersion -> SolutionVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SolutionVersion -> SolutionVersion -> Bool
$c/= :: SolutionVersion -> SolutionVersion -> Bool
== :: SolutionVersion -> SolutionVersion -> Bool
$c== :: SolutionVersion -> SolutionVersion -> Bool
Prelude.Eq, ReadPrec [SolutionVersion]
ReadPrec SolutionVersion
Int -> ReadS SolutionVersion
ReadS [SolutionVersion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SolutionVersion]
$creadListPrec :: ReadPrec [SolutionVersion]
readPrec :: ReadPrec SolutionVersion
$creadPrec :: ReadPrec SolutionVersion
readList :: ReadS [SolutionVersion]
$creadList :: ReadS [SolutionVersion]
readsPrec :: Int -> ReadS SolutionVersion
$creadsPrec :: Int -> ReadS SolutionVersion
Prelude.Read, Int -> SolutionVersion -> ShowS
[SolutionVersion] -> ShowS
SolutionVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SolutionVersion] -> ShowS
$cshowList :: [SolutionVersion] -> ShowS
show :: SolutionVersion -> String
$cshow :: SolutionVersion -> String
showsPrec :: Int -> SolutionVersion -> ShowS
$cshowsPrec :: Int -> SolutionVersion -> ShowS
Prelude.Show, forall x. Rep SolutionVersion x -> SolutionVersion
forall x. SolutionVersion -> Rep SolutionVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SolutionVersion x -> SolutionVersion
$cfrom :: forall x. SolutionVersion -> Rep SolutionVersion x
Prelude.Generic)

-- |
-- Create a value of 'SolutionVersion' 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:
--
-- 'creationDateTime', 'solutionVersion_creationDateTime' - The date and time (in Unix time) that this version of the solution was
-- created.
--
-- 'datasetGroupArn', 'solutionVersion_datasetGroupArn' - The Amazon Resource Name (ARN) of the dataset group providing the
-- training data.
--
-- 'eventType', 'solutionVersion_eventType' - The event type (for example, \'click\' or \'like\') that is used for
-- training the model.
--
-- 'failureReason', 'solutionVersion_failureReason' - If training a solution version fails, the reason for the failure.
--
-- 'lastUpdatedDateTime', 'solutionVersion_lastUpdatedDateTime' - The date and time (in Unix time) that the solution was last updated.
--
-- 'name', 'solutionVersion_name' - The name of the solution version.
--
-- 'performAutoML', 'solutionVersion_performAutoML' - When true, Amazon Personalize searches for the most optimal recipe
-- according to the solution configuration. When false (the default),
-- Amazon Personalize uses @recipeArn@.
--
-- 'performHPO', 'solutionVersion_performHPO' - Whether to perform hyperparameter optimization (HPO) on the chosen
-- recipe. The default is @false@.
--
-- 'recipeArn', 'solutionVersion_recipeArn' - The ARN of the recipe used in the solution.
--
-- 'solutionArn', 'solutionVersion_solutionArn' - The ARN of the solution.
--
-- 'solutionConfig', 'solutionVersion_solutionConfig' - Describes the configuration properties for the solution.
--
-- 'solutionVersionArn', 'solutionVersion_solutionVersionArn' - The ARN of the solution version.
--
-- 'status', 'solutionVersion_status' - The status of the solution version.
--
-- A solution version can be in one of the following states:
--
-- -   CREATE PENDING
--
-- -   CREATE IN_PROGRESS
--
-- -   ACTIVE
--
-- -   CREATE FAILED
--
-- -   CREATE STOPPING
--
-- -   CREATE STOPPED
--
-- 'trainingHours', 'solutionVersion_trainingHours' - The time used to train the model. You are billed for the time it takes
-- to train a model. This field is visible only after Amazon Personalize
-- successfully trains a model.
--
-- 'trainingMode', 'solutionVersion_trainingMode' - The scope of training to be performed when creating the solution
-- version. The @FULL@ option trains the solution version based on the
-- entirety of the input solution\'s training data, while the @UPDATE@
-- option processes only the data that has changed in comparison to the
-- input solution. Choose @UPDATE@ when you want to incrementally update
-- your solution version instead of creating an entirely new one.
--
-- The @UPDATE@ option can only be used when you already have an active
-- solution version created from the input solution using the @FULL@ option
-- and the input solution was trained with the
-- <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html User-Personalization>
-- recipe or the
-- <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html HRNN-Coldstart>
-- recipe.
--
-- 'tunedHPOParams', 'solutionVersion_tunedHPOParams' - If hyperparameter optimization was performed, contains the
-- hyperparameter values of the best performing model.
newSolutionVersion ::
  SolutionVersion
newSolutionVersion :: SolutionVersion
newSolutionVersion =
  SolutionVersion'
    { $sel:creationDateTime:SolutionVersion' :: Maybe POSIX
creationDateTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupArn:SolutionVersion' :: Maybe Text
datasetGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:eventType:SolutionVersion' :: Maybe Text
eventType = forall a. Maybe a
Prelude.Nothing,
      $sel:failureReason:SolutionVersion' :: Maybe Text
failureReason = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:SolutionVersion' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:SolutionVersion' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:performAutoML:SolutionVersion' :: Maybe Bool
performAutoML = forall a. Maybe a
Prelude.Nothing,
      $sel:performHPO:SolutionVersion' :: Maybe Bool
performHPO = forall a. Maybe a
Prelude.Nothing,
      $sel:recipeArn:SolutionVersion' :: Maybe Text
recipeArn = forall a. Maybe a
Prelude.Nothing,
      $sel:solutionArn:SolutionVersion' :: Maybe Text
solutionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:solutionConfig:SolutionVersion' :: Maybe SolutionConfig
solutionConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:solutionVersionArn:SolutionVersion' :: Maybe Text
solutionVersionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:SolutionVersion' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
      $sel:trainingHours:SolutionVersion' :: Maybe Double
trainingHours = forall a. Maybe a
Prelude.Nothing,
      $sel:trainingMode:SolutionVersion' :: Maybe TrainingMode
trainingMode = forall a. Maybe a
Prelude.Nothing,
      $sel:tunedHPOParams:SolutionVersion' :: Maybe TunedHPOParams
tunedHPOParams = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time (in Unix time) that this version of the solution was
-- created.
solutionVersion_creationDateTime :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.UTCTime)
solutionVersion_creationDateTime :: Lens' SolutionVersion (Maybe UTCTime)
solutionVersion_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:SolutionVersion' :: SolutionVersion -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe POSIX
a -> SolutionVersion
s {$sel:creationDateTime:SolutionVersion' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: SolutionVersion) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Resource Name (ARN) of the dataset group providing the
-- training data.
solutionVersion_datasetGroupArn :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_datasetGroupArn :: Lens' SolutionVersion (Maybe Text)
solutionVersion_datasetGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Text
datasetGroupArn :: Maybe Text
$sel:datasetGroupArn:SolutionVersion' :: SolutionVersion -> Maybe Text
datasetGroupArn} -> Maybe Text
datasetGroupArn) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Text
a -> SolutionVersion
s {$sel:datasetGroupArn:SolutionVersion' :: Maybe Text
datasetGroupArn = Maybe Text
a} :: SolutionVersion)

-- | The event type (for example, \'click\' or \'like\') that is used for
-- training the model.
solutionVersion_eventType :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_eventType :: Lens' SolutionVersion (Maybe Text)
solutionVersion_eventType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Text
eventType :: Maybe Text
$sel:eventType:SolutionVersion' :: SolutionVersion -> Maybe Text
eventType} -> Maybe Text
eventType) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Text
a -> SolutionVersion
s {$sel:eventType:SolutionVersion' :: Maybe Text
eventType = Maybe Text
a} :: SolutionVersion)

-- | If training a solution version fails, the reason for the failure.
solutionVersion_failureReason :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_failureReason :: Lens' SolutionVersion (Maybe Text)
solutionVersion_failureReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:SolutionVersion' :: SolutionVersion -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Text
a -> SolutionVersion
s {$sel:failureReason:SolutionVersion' :: Maybe Text
failureReason = Maybe Text
a} :: SolutionVersion)

-- | The date and time (in Unix time) that the solution was last updated.
solutionVersion_lastUpdatedDateTime :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.UTCTime)
solutionVersion_lastUpdatedDateTime :: Lens' SolutionVersion (Maybe UTCTime)
solutionVersion_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:SolutionVersion' :: SolutionVersion -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe POSIX
a -> SolutionVersion
s {$sel:lastUpdatedDateTime:SolutionVersion' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: SolutionVersion) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the solution version.
solutionVersion_name :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_name :: Lens' SolutionVersion (Maybe Text)
solutionVersion_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Text
name :: Maybe Text
$sel:name:SolutionVersion' :: SolutionVersion -> Maybe Text
name} -> Maybe Text
name) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Text
a -> SolutionVersion
s {$sel:name:SolutionVersion' :: Maybe Text
name = Maybe Text
a} :: SolutionVersion)

-- | When true, Amazon Personalize searches for the most optimal recipe
-- according to the solution configuration. When false (the default),
-- Amazon Personalize uses @recipeArn@.
solutionVersion_performAutoML :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Bool)
solutionVersion_performAutoML :: Lens' SolutionVersion (Maybe Bool)
solutionVersion_performAutoML = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Bool
performAutoML :: Maybe Bool
$sel:performAutoML:SolutionVersion' :: SolutionVersion -> Maybe Bool
performAutoML} -> Maybe Bool
performAutoML) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Bool
a -> SolutionVersion
s {$sel:performAutoML:SolutionVersion' :: Maybe Bool
performAutoML = Maybe Bool
a} :: SolutionVersion)

-- | Whether to perform hyperparameter optimization (HPO) on the chosen
-- recipe. The default is @false@.
solutionVersion_performHPO :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Bool)
solutionVersion_performHPO :: Lens' SolutionVersion (Maybe Bool)
solutionVersion_performHPO = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Bool
performHPO :: Maybe Bool
$sel:performHPO:SolutionVersion' :: SolutionVersion -> Maybe Bool
performHPO} -> Maybe Bool
performHPO) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Bool
a -> SolutionVersion
s {$sel:performHPO:SolutionVersion' :: Maybe Bool
performHPO = Maybe Bool
a} :: SolutionVersion)

-- | The ARN of the recipe used in the solution.
solutionVersion_recipeArn :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_recipeArn :: Lens' SolutionVersion (Maybe Text)
solutionVersion_recipeArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Text
recipeArn :: Maybe Text
$sel:recipeArn:SolutionVersion' :: SolutionVersion -> Maybe Text
recipeArn} -> Maybe Text
recipeArn) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Text
a -> SolutionVersion
s {$sel:recipeArn:SolutionVersion' :: Maybe Text
recipeArn = Maybe Text
a} :: SolutionVersion)

-- | The ARN of the solution.
solutionVersion_solutionArn :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_solutionArn :: Lens' SolutionVersion (Maybe Text)
solutionVersion_solutionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Text
solutionArn :: Maybe Text
$sel:solutionArn:SolutionVersion' :: SolutionVersion -> Maybe Text
solutionArn} -> Maybe Text
solutionArn) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Text
a -> SolutionVersion
s {$sel:solutionArn:SolutionVersion' :: Maybe Text
solutionArn = Maybe Text
a} :: SolutionVersion)

-- | Describes the configuration properties for the solution.
solutionVersion_solutionConfig :: Lens.Lens' SolutionVersion (Prelude.Maybe SolutionConfig)
solutionVersion_solutionConfig :: Lens' SolutionVersion (Maybe SolutionConfig)
solutionVersion_solutionConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe SolutionConfig
solutionConfig :: Maybe SolutionConfig
$sel:solutionConfig:SolutionVersion' :: SolutionVersion -> Maybe SolutionConfig
solutionConfig} -> Maybe SolutionConfig
solutionConfig) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe SolutionConfig
a -> SolutionVersion
s {$sel:solutionConfig:SolutionVersion' :: Maybe SolutionConfig
solutionConfig = Maybe SolutionConfig
a} :: SolutionVersion)

-- | The ARN of the solution version.
solutionVersion_solutionVersionArn :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_solutionVersionArn :: Lens' SolutionVersion (Maybe Text)
solutionVersion_solutionVersionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Text
solutionVersionArn :: Maybe Text
$sel:solutionVersionArn:SolutionVersion' :: SolutionVersion -> Maybe Text
solutionVersionArn} -> Maybe Text
solutionVersionArn) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Text
a -> SolutionVersion
s {$sel:solutionVersionArn:SolutionVersion' :: Maybe Text
solutionVersionArn = Maybe Text
a} :: SolutionVersion)

-- | The status of the solution version.
--
-- A solution version can be in one of the following states:
--
-- -   CREATE PENDING
--
-- -   CREATE IN_PROGRESS
--
-- -   ACTIVE
--
-- -   CREATE FAILED
--
-- -   CREATE STOPPING
--
-- -   CREATE STOPPED
solutionVersion_status :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_status :: Lens' SolutionVersion (Maybe Text)
solutionVersion_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Text
status :: Maybe Text
$sel:status:SolutionVersion' :: SolutionVersion -> Maybe Text
status} -> Maybe Text
status) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Text
a -> SolutionVersion
s {$sel:status:SolutionVersion' :: Maybe Text
status = Maybe Text
a} :: SolutionVersion)

-- | The time used to train the model. You are billed for the time it takes
-- to train a model. This field is visible only after Amazon Personalize
-- successfully trains a model.
solutionVersion_trainingHours :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Double)
solutionVersion_trainingHours :: Lens' SolutionVersion (Maybe Double)
solutionVersion_trainingHours = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe Double
trainingHours :: Maybe Double
$sel:trainingHours:SolutionVersion' :: SolutionVersion -> Maybe Double
trainingHours} -> Maybe Double
trainingHours) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe Double
a -> SolutionVersion
s {$sel:trainingHours:SolutionVersion' :: Maybe Double
trainingHours = Maybe Double
a} :: SolutionVersion)

-- | The scope of training to be performed when creating the solution
-- version. The @FULL@ option trains the solution version based on the
-- entirety of the input solution\'s training data, while the @UPDATE@
-- option processes only the data that has changed in comparison to the
-- input solution. Choose @UPDATE@ when you want to incrementally update
-- your solution version instead of creating an entirely new one.
--
-- The @UPDATE@ option can only be used when you already have an active
-- solution version created from the input solution using the @FULL@ option
-- and the input solution was trained with the
-- <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html User-Personalization>
-- recipe or the
-- <https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html HRNN-Coldstart>
-- recipe.
solutionVersion_trainingMode :: Lens.Lens' SolutionVersion (Prelude.Maybe TrainingMode)
solutionVersion_trainingMode :: Lens' SolutionVersion (Maybe TrainingMode)
solutionVersion_trainingMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe TrainingMode
trainingMode :: Maybe TrainingMode
$sel:trainingMode:SolutionVersion' :: SolutionVersion -> Maybe TrainingMode
trainingMode} -> Maybe TrainingMode
trainingMode) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe TrainingMode
a -> SolutionVersion
s {$sel:trainingMode:SolutionVersion' :: Maybe TrainingMode
trainingMode = Maybe TrainingMode
a} :: SolutionVersion)

-- | If hyperparameter optimization was performed, contains the
-- hyperparameter values of the best performing model.
solutionVersion_tunedHPOParams :: Lens.Lens' SolutionVersion (Prelude.Maybe TunedHPOParams)
solutionVersion_tunedHPOParams :: Lens' SolutionVersion (Maybe TunedHPOParams)
solutionVersion_tunedHPOParams = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionVersion' {Maybe TunedHPOParams
tunedHPOParams :: Maybe TunedHPOParams
$sel:tunedHPOParams:SolutionVersion' :: SolutionVersion -> Maybe TunedHPOParams
tunedHPOParams} -> Maybe TunedHPOParams
tunedHPOParams) (\s :: SolutionVersion
s@SolutionVersion' {} Maybe TunedHPOParams
a -> SolutionVersion
s {$sel:tunedHPOParams:SolutionVersion' :: Maybe TunedHPOParams
tunedHPOParams = Maybe TunedHPOParams
a} :: SolutionVersion)

instance Data.FromJSON SolutionVersion where
  parseJSON :: Value -> Parser SolutionVersion
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SolutionVersion"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe SolutionConfig
-> Maybe Text
-> Maybe Text
-> Maybe Double
-> Maybe TrainingMode
-> Maybe TunedHPOParams
-> SolutionVersion
SolutionVersion'
            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
"creationDateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"datasetGroupArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"eventType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"failureReason")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastUpdatedDateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"performAutoML")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"performHPO")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"recipeArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"solutionArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"solutionConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"solutionVersionArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"trainingHours")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"trainingMode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tunedHPOParams")
      )

instance Prelude.Hashable SolutionVersion where
  hashWithSalt :: Int -> SolutionVersion -> Int
hashWithSalt Int
_salt SolutionVersion' {Maybe Bool
Maybe Double
Maybe Text
Maybe POSIX
Maybe SolutionConfig
Maybe TrainingMode
Maybe TunedHPOParams
tunedHPOParams :: Maybe TunedHPOParams
trainingMode :: Maybe TrainingMode
trainingHours :: Maybe Double
status :: Maybe Text
solutionVersionArn :: Maybe Text
solutionConfig :: Maybe SolutionConfig
solutionArn :: Maybe Text
recipeArn :: Maybe Text
performHPO :: Maybe Bool
performAutoML :: Maybe Bool
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
failureReason :: Maybe Text
eventType :: Maybe Text
datasetGroupArn :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:tunedHPOParams:SolutionVersion' :: SolutionVersion -> Maybe TunedHPOParams
$sel:trainingMode:SolutionVersion' :: SolutionVersion -> Maybe TrainingMode
$sel:trainingHours:SolutionVersion' :: SolutionVersion -> Maybe Double
$sel:status:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:solutionVersionArn:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:solutionConfig:SolutionVersion' :: SolutionVersion -> Maybe SolutionConfig
$sel:solutionArn:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:recipeArn:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:performHPO:SolutionVersion' :: SolutionVersion -> Maybe Bool
$sel:performAutoML:SolutionVersion' :: SolutionVersion -> Maybe Bool
$sel:name:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:lastUpdatedDateTime:SolutionVersion' :: SolutionVersion -> Maybe POSIX
$sel:failureReason:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:eventType:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:datasetGroupArn:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:creationDateTime:SolutionVersion' :: SolutionVersion -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
datasetGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
eventType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
failureReason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
performAutoML
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
performHPO
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recipeArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
solutionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SolutionConfig
solutionConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
solutionVersionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
trainingHours
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TrainingMode
trainingMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TunedHPOParams
tunedHPOParams

instance Prelude.NFData SolutionVersion where
  rnf :: SolutionVersion -> ()
rnf SolutionVersion' {Maybe Bool
Maybe Double
Maybe Text
Maybe POSIX
Maybe SolutionConfig
Maybe TrainingMode
Maybe TunedHPOParams
tunedHPOParams :: Maybe TunedHPOParams
trainingMode :: Maybe TrainingMode
trainingHours :: Maybe Double
status :: Maybe Text
solutionVersionArn :: Maybe Text
solutionConfig :: Maybe SolutionConfig
solutionArn :: Maybe Text
recipeArn :: Maybe Text
performHPO :: Maybe Bool
performAutoML :: Maybe Bool
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
failureReason :: Maybe Text
eventType :: Maybe Text
datasetGroupArn :: Maybe Text
creationDateTime :: Maybe POSIX
$sel:tunedHPOParams:SolutionVersion' :: SolutionVersion -> Maybe TunedHPOParams
$sel:trainingMode:SolutionVersion' :: SolutionVersion -> Maybe TrainingMode
$sel:trainingHours:SolutionVersion' :: SolutionVersion -> Maybe Double
$sel:status:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:solutionVersionArn:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:solutionConfig:SolutionVersion' :: SolutionVersion -> Maybe SolutionConfig
$sel:solutionArn:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:recipeArn:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:performHPO:SolutionVersion' :: SolutionVersion -> Maybe Bool
$sel:performAutoML:SolutionVersion' :: SolutionVersion -> Maybe Bool
$sel:name:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:lastUpdatedDateTime:SolutionVersion' :: SolutionVersion -> Maybe POSIX
$sel:failureReason:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:eventType:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:datasetGroupArn:SolutionVersion' :: SolutionVersion -> Maybe Text
$sel:creationDateTime:SolutionVersion' :: SolutionVersion -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
datasetGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eventType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
failureReason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
performAutoML
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
performHPO
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recipeArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
solutionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SolutionConfig
solutionConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
solutionVersionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
trainingHours
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TrainingMode
trainingMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TunedHPOParams
tunedHPOParams