{-# 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-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.SolutionVersion where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
-- Solution.
--
-- /See:/ 'newSolutionVersion' smart constructor.
data SolutionVersion = SolutionVersion'
  { -- | If training a solution version fails, the reason for the failure.
    SolutionVersion -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the solution.
    SolutionVersion -> Maybe Text
solutionArn :: 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,
    -- | 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,
    -- | If hyperparameter optimization was performed, contains the
    -- hyperparameter values of the best performing model.
    SolutionVersion -> Maybe TunedHPOParams
tunedHPOParams :: Prelude.Maybe TunedHPOParams,
    -- | The ARN of the recipe used in the solution.
    SolutionVersion -> Maybe Text
recipeArn :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that the solution was last updated.
    SolutionVersion -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Core.POSIX,
    -- | The event type (for example, \'click\' or \'like\') that is used for
    -- training the model.
    SolutionVersion -> Maybe Text
eventType :: Prelude.Maybe Prelude.Text,
    -- | The date and time (in Unix time) that this version of the solution was
    -- created.
    SolutionVersion -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the dataset group providing the
    -- training data.
    SolutionVersion -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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,
    -- | Describes the configuration properties for the solution.
    SolutionVersion -> Maybe SolutionConfig
solutionConfig :: Prelude.Maybe SolutionConfig,
    -- | 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 solution version.
    SolutionVersion -> Maybe Text
solutionVersionArn :: Prelude.Maybe Prelude.Text
  }
  deriving (SolutionVersion -> SolutionVersion -> Bool
(SolutionVersion -> SolutionVersion -> Bool)
-> (SolutionVersion -> SolutionVersion -> Bool)
-> Eq SolutionVersion
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]
(Int -> ReadS SolutionVersion)
-> ReadS [SolutionVersion]
-> ReadPrec SolutionVersion
-> ReadPrec [SolutionVersion]
-> Read 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
(Int -> SolutionVersion -> ShowS)
-> (SolutionVersion -> String)
-> ([SolutionVersion] -> ShowS)
-> Show SolutionVersion
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. SolutionVersion -> Rep SolutionVersion x)
-> (forall x. Rep SolutionVersion x -> SolutionVersion)
-> Generic SolutionVersion
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:
--
-- 'failureReason', 'solutionVersion_failureReason' - If training a solution version fails, the reason for the failure.
--
-- 'solutionArn', 'solutionVersion_solutionArn' - The ARN of the solution.
--
-- '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
--
-- '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@.
--
-- 'tunedHPOParams', 'solutionVersion_tunedHPOParams' - If hyperparameter optimization was performed, contains the
-- hyperparameter values of the best performing model.
--
-- 'recipeArn', 'solutionVersion_recipeArn' - The ARN of the recipe used in the solution.
--
-- 'lastUpdatedDateTime', 'solutionVersion_lastUpdatedDateTime' - The date and time (in Unix time) that the solution was last updated.
--
-- 'eventType', 'solutionVersion_eventType' - The event type (for example, \'click\' or \'like\') that is used for
-- training the model.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- 'solutionConfig', 'solutionVersion_solutionConfig' - Describes the configuration properties for the solution.
--
-- 'performHPO', 'solutionVersion_performHPO' - Whether to perform hyperparameter optimization (HPO) on the chosen
-- recipe. The default is @false@.
--
-- 'solutionVersionArn', 'solutionVersion_solutionVersionArn' - The ARN of the solution version.
newSolutionVersion ::
  SolutionVersion
newSolutionVersion :: SolutionVersion
newSolutionVersion =
  SolutionVersion' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe TunedHPOParams
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe TrainingMode
-> Maybe Double
-> Maybe SolutionConfig
-> Maybe Bool
-> Maybe Text
-> SolutionVersion
SolutionVersion'
    { $sel:failureReason:SolutionVersion' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:solutionArn:SolutionVersion' :: Maybe Text
solutionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:SolutionVersion' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:performAutoML:SolutionVersion' :: Maybe Bool
performAutoML = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:tunedHPOParams:SolutionVersion' :: Maybe TunedHPOParams
tunedHPOParams = Maybe TunedHPOParams
forall a. Maybe a
Prelude.Nothing,
      $sel:recipeArn:SolutionVersion' :: Maybe Text
recipeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:SolutionVersion' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:eventType:SolutionVersion' :: Maybe Text
eventType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDateTime:SolutionVersion' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupArn:SolutionVersion' :: Maybe Text
datasetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trainingMode:SolutionVersion' :: Maybe TrainingMode
trainingMode = Maybe TrainingMode
forall a. Maybe a
Prelude.Nothing,
      $sel:trainingHours:SolutionVersion' :: Maybe Double
trainingHours = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:solutionConfig:SolutionVersion' :: Maybe SolutionConfig
solutionConfig = Maybe SolutionConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:performHPO:SolutionVersion' :: Maybe Bool
performHPO = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:solutionVersionArn:SolutionVersion' :: Maybe Text
solutionVersionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | If training a solution version fails, the reason for the failure.
solutionVersion_failureReason :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_failureReason :: (Maybe Text -> f (Maybe Text))
-> SolutionVersion -> f SolutionVersion
solutionVersion_failureReason = (SolutionVersion -> Maybe Text)
-> (SolutionVersion -> Maybe Text -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Text) (Maybe Text)
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 ARN of the solution.
solutionVersion_solutionArn :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_solutionArn :: (Maybe Text -> f (Maybe Text))
-> SolutionVersion -> f SolutionVersion
solutionVersion_solutionArn = (SolutionVersion -> Maybe Text)
-> (SolutionVersion -> Maybe Text -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SolutionVersion -> f SolutionVersion
solutionVersion_status = (SolutionVersion -> Maybe Text)
-> (SolutionVersion -> Maybe Text -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> SolutionVersion -> f SolutionVersion
solutionVersion_performAutoML = (SolutionVersion -> Maybe Bool)
-> (SolutionVersion -> Maybe Bool -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Bool) (Maybe Bool)
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)

-- | If hyperparameter optimization was performed, contains the
-- hyperparameter values of the best performing model.
solutionVersion_tunedHPOParams :: Lens.Lens' SolutionVersion (Prelude.Maybe TunedHPOParams)
solutionVersion_tunedHPOParams :: (Maybe TunedHPOParams -> f (Maybe TunedHPOParams))
-> SolutionVersion -> f SolutionVersion
solutionVersion_tunedHPOParams = (SolutionVersion -> Maybe TunedHPOParams)
-> (SolutionVersion -> Maybe TunedHPOParams -> SolutionVersion)
-> Lens
     SolutionVersion
     SolutionVersion
     (Maybe TunedHPOParams)
     (Maybe 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)

-- | The ARN of the recipe used in the solution.
solutionVersion_recipeArn :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_recipeArn :: (Maybe Text -> f (Maybe Text))
-> SolutionVersion -> f SolutionVersion
solutionVersion_recipeArn = (SolutionVersion -> Maybe Text)
-> (SolutionVersion -> Maybe Text -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Text) (Maybe Text)
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 date and time (in Unix time) that the solution was last updated.
solutionVersion_lastUpdatedDateTime :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.UTCTime)
solutionVersion_lastUpdatedDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SolutionVersion -> f SolutionVersion
solutionVersion_lastUpdatedDateTime = (SolutionVersion -> Maybe POSIX)
-> (SolutionVersion -> Maybe POSIX -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> SolutionVersion -> f SolutionVersion)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SolutionVersion
-> f SolutionVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SolutionVersion -> f SolutionVersion
solutionVersion_eventType = (SolutionVersion -> Maybe Text)
-> (SolutionVersion -> Maybe Text -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SolutionVersion -> f SolutionVersion
solutionVersion_creationDateTime = (SolutionVersion -> Maybe POSIX)
-> (SolutionVersion -> Maybe POSIX -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> SolutionVersion -> f SolutionVersion)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SolutionVersion
-> f SolutionVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._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 :: (Maybe Text -> f (Maybe Text))
-> SolutionVersion -> f SolutionVersion
solutionVersion_datasetGroupArn = (SolutionVersion -> Maybe Text)
-> (SolutionVersion -> Maybe Text -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Text) (Maybe Text)
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 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 :: (Maybe TrainingMode -> f (Maybe TrainingMode))
-> SolutionVersion -> f SolutionVersion
solutionVersion_trainingMode = (SolutionVersion -> Maybe TrainingMode)
-> (SolutionVersion -> Maybe TrainingMode -> SolutionVersion)
-> Lens
     SolutionVersion
     SolutionVersion
     (Maybe TrainingMode)
     (Maybe 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)

-- | 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 :: (Maybe Double -> f (Maybe Double))
-> SolutionVersion -> f SolutionVersion
solutionVersion_trainingHours = (SolutionVersion -> Maybe Double)
-> (SolutionVersion -> Maybe Double -> SolutionVersion)
-> Lens
     SolutionVersion SolutionVersion (Maybe Double) (Maybe Double)
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)

-- | Describes the configuration properties for the solution.
solutionVersion_solutionConfig :: Lens.Lens' SolutionVersion (Prelude.Maybe SolutionConfig)
solutionVersion_solutionConfig :: (Maybe SolutionConfig -> f (Maybe SolutionConfig))
-> SolutionVersion -> f SolutionVersion
solutionVersion_solutionConfig = (SolutionVersion -> Maybe SolutionConfig)
-> (SolutionVersion -> Maybe SolutionConfig -> SolutionVersion)
-> Lens
     SolutionVersion
     SolutionVersion
     (Maybe SolutionConfig)
     (Maybe 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)

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> SolutionVersion -> f SolutionVersion
solutionVersion_performHPO = (SolutionVersion -> Maybe Bool)
-> (SolutionVersion -> Maybe Bool -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Bool) (Maybe Bool)
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 solution version.
solutionVersion_solutionVersionArn :: Lens.Lens' SolutionVersion (Prelude.Maybe Prelude.Text)
solutionVersion_solutionVersionArn :: (Maybe Text -> f (Maybe Text))
-> SolutionVersion -> f SolutionVersion
solutionVersion_solutionVersionArn = (SolutionVersion -> Maybe Text)
-> (SolutionVersion -> Maybe Text -> SolutionVersion)
-> Lens SolutionVersion SolutionVersion (Maybe Text) (Maybe Text)
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)

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

instance Prelude.Hashable SolutionVersion

instance Prelude.NFData SolutionVersion