{-# 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.SolutionSummary
-- 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.SolutionSummary 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

-- | Provides a summary of the properties of a solution. For a complete
-- listing, call the
-- <https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html DescribeSolution>
-- API.
--
-- /See:/ 'newSolutionSummary' smart constructor.
data SolutionSummary = SolutionSummary'
  { -- | The date and time (in Unix time) that the solution was created.
    SolutionSummary -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | The date and time (in Unix time) that the solution was last updated.
    SolutionSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the solution.
    SolutionSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the recipe used by the solution.
    SolutionSummary -> Maybe Text
recipeArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the solution.
    SolutionSummary -> Maybe Text
solutionArn :: Prelude.Maybe Prelude.Text,
    -- | The status of the solution.
    --
    -- A solution can be in one of the following states:
    --
    -- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
    --
    -- -   DELETE PENDING > DELETE IN_PROGRESS
    SolutionSummary -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (SolutionSummary -> SolutionSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SolutionSummary -> SolutionSummary -> Bool
$c/= :: SolutionSummary -> SolutionSummary -> Bool
== :: SolutionSummary -> SolutionSummary -> Bool
$c== :: SolutionSummary -> SolutionSummary -> Bool
Prelude.Eq, ReadPrec [SolutionSummary]
ReadPrec SolutionSummary
Int -> ReadS SolutionSummary
ReadS [SolutionSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SolutionSummary]
$creadListPrec :: ReadPrec [SolutionSummary]
readPrec :: ReadPrec SolutionSummary
$creadPrec :: ReadPrec SolutionSummary
readList :: ReadS [SolutionSummary]
$creadList :: ReadS [SolutionSummary]
readsPrec :: Int -> ReadS SolutionSummary
$creadsPrec :: Int -> ReadS SolutionSummary
Prelude.Read, Int -> SolutionSummary -> ShowS
[SolutionSummary] -> ShowS
SolutionSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SolutionSummary] -> ShowS
$cshowList :: [SolutionSummary] -> ShowS
show :: SolutionSummary -> String
$cshow :: SolutionSummary -> String
showsPrec :: Int -> SolutionSummary -> ShowS
$cshowsPrec :: Int -> SolutionSummary -> ShowS
Prelude.Show, forall x. Rep SolutionSummary x -> SolutionSummary
forall x. SolutionSummary -> Rep SolutionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SolutionSummary x -> SolutionSummary
$cfrom :: forall x. SolutionSummary -> Rep SolutionSummary x
Prelude.Generic)

-- |
-- Create a value of 'SolutionSummary' 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', 'solutionSummary_creationDateTime' - The date and time (in Unix time) that the solution was created.
--
-- 'lastUpdatedDateTime', 'solutionSummary_lastUpdatedDateTime' - The date and time (in Unix time) that the solution was last updated.
--
-- 'name', 'solutionSummary_name' - The name of the solution.
--
-- 'recipeArn', 'solutionSummary_recipeArn' - The Amazon Resource Name (ARN) of the recipe used by the solution.
--
-- 'solutionArn', 'solutionSummary_solutionArn' - The Amazon Resource Name (ARN) of the solution.
--
-- 'status', 'solutionSummary_status' - The status of the solution.
--
-- A solution can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
--
-- -   DELETE PENDING > DELETE IN_PROGRESS
newSolutionSummary ::
  SolutionSummary
newSolutionSummary :: SolutionSummary
newSolutionSummary =
  SolutionSummary'
    { $sel:creationDateTime:SolutionSummary' :: Maybe POSIX
creationDateTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:SolutionSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:SolutionSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:recipeArn:SolutionSummary' :: Maybe Text
recipeArn = forall a. Maybe a
Prelude.Nothing,
      $sel:solutionArn:SolutionSummary' :: Maybe Text
solutionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:status:SolutionSummary' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time (in Unix time) that the solution was created.
solutionSummary_creationDateTime :: Lens.Lens' SolutionSummary (Prelude.Maybe Prelude.UTCTime)
solutionSummary_creationDateTime :: Lens' SolutionSummary (Maybe UTCTime)
solutionSummary_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionSummary' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:SolutionSummary' :: SolutionSummary -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: SolutionSummary
s@SolutionSummary' {} Maybe POSIX
a -> SolutionSummary
s {$sel:creationDateTime:SolutionSummary' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: SolutionSummary) 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 date and time (in Unix time) that the solution was last updated.
solutionSummary_lastUpdatedDateTime :: Lens.Lens' SolutionSummary (Prelude.Maybe Prelude.UTCTime)
solutionSummary_lastUpdatedDateTime :: Lens' SolutionSummary (Maybe UTCTime)
solutionSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:SolutionSummary' :: SolutionSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: SolutionSummary
s@SolutionSummary' {} Maybe POSIX
a -> SolutionSummary
s {$sel:lastUpdatedDateTime:SolutionSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: SolutionSummary) 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.
solutionSummary_name :: Lens.Lens' SolutionSummary (Prelude.Maybe Prelude.Text)
solutionSummary_name :: Lens' SolutionSummary (Maybe Text)
solutionSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionSummary' {Maybe Text
name :: Maybe Text
$sel:name:SolutionSummary' :: SolutionSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: SolutionSummary
s@SolutionSummary' {} Maybe Text
a -> SolutionSummary
s {$sel:name:SolutionSummary' :: Maybe Text
name = Maybe Text
a} :: SolutionSummary)

-- | The Amazon Resource Name (ARN) of the recipe used by the solution.
solutionSummary_recipeArn :: Lens.Lens' SolutionSummary (Prelude.Maybe Prelude.Text)
solutionSummary_recipeArn :: Lens' SolutionSummary (Maybe Text)
solutionSummary_recipeArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SolutionSummary' {Maybe Text
recipeArn :: Maybe Text
$sel:recipeArn:SolutionSummary' :: SolutionSummary -> Maybe Text
recipeArn} -> Maybe Text
recipeArn) (\s :: SolutionSummary
s@SolutionSummary' {} Maybe Text
a -> SolutionSummary
s {$sel:recipeArn:SolutionSummary' :: Maybe Text
recipeArn = Maybe Text
a} :: SolutionSummary)

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

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

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

instance Prelude.Hashable SolutionSummary where
  hashWithSalt :: Int -> SolutionSummary -> Int
hashWithSalt Int
_salt SolutionSummary' {Maybe Text
Maybe POSIX
status :: Maybe Text
solutionArn :: Maybe Text
recipeArn :: Maybe Text
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:status:SolutionSummary' :: SolutionSummary -> Maybe Text
$sel:solutionArn:SolutionSummary' :: SolutionSummary -> Maybe Text
$sel:recipeArn:SolutionSummary' :: SolutionSummary -> Maybe Text
$sel:name:SolutionSummary' :: SolutionSummary -> Maybe Text
$sel:lastUpdatedDateTime:SolutionSummary' :: SolutionSummary -> Maybe POSIX
$sel:creationDateTime:SolutionSummary' :: SolutionSummary -> 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 POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      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 Text
status

instance Prelude.NFData SolutionSummary where
  rnf :: SolutionSummary -> ()
rnf SolutionSummary' {Maybe Text
Maybe POSIX
status :: Maybe Text
solutionArn :: Maybe Text
recipeArn :: Maybe Text
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:status:SolutionSummary' :: SolutionSummary -> Maybe Text
$sel:solutionArn:SolutionSummary' :: SolutionSummary -> Maybe Text
$sel:recipeArn:SolutionSummary' :: SolutionSummary -> Maybe Text
$sel:name:SolutionSummary' :: SolutionSummary -> Maybe Text
$sel:lastUpdatedDateTime:SolutionSummary' :: SolutionSummary -> Maybe POSIX
$sel:creationDateTime:SolutionSummary' :: SolutionSummary -> 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 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 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 Text
status