{-# 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.FeatureTransformation
-- 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.FeatureTransformation 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 feature transformation information. Feature transformation is
-- the process of modifying raw input data into a form more suitable for
-- model training.
--
-- /See:/ 'newFeatureTransformation' smart constructor.
data FeatureTransformation = FeatureTransformation'
  { -- | The creation date and time (in Unix time) of the feature transformation.
    FeatureTransformation -> Maybe POSIX
creationDateTime :: Prelude.Maybe Data.POSIX,
    -- | Provides the default parameters for feature transformation.
    FeatureTransformation -> Maybe (HashMap Text Text)
defaultParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the FeatureTransformation object.
    FeatureTransformation -> Maybe Text
featureTransformationArn :: Prelude.Maybe Prelude.Text,
    -- | The last update date and time (in Unix time) of the feature
    -- transformation.
    FeatureTransformation -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the feature transformation.
    FeatureTransformation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The status of the feature transformation.
    --
    -- A feature transformation can be in one of the following states:
    --
    -- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
    FeatureTransformation -> Maybe Text
status :: Prelude.Maybe Prelude.Text
  }
  deriving (FeatureTransformation -> FeatureTransformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FeatureTransformation -> FeatureTransformation -> Bool
$c/= :: FeatureTransformation -> FeatureTransformation -> Bool
== :: FeatureTransformation -> FeatureTransformation -> Bool
$c== :: FeatureTransformation -> FeatureTransformation -> Bool
Prelude.Eq, ReadPrec [FeatureTransformation]
ReadPrec FeatureTransformation
Int -> ReadS FeatureTransformation
ReadS [FeatureTransformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FeatureTransformation]
$creadListPrec :: ReadPrec [FeatureTransformation]
readPrec :: ReadPrec FeatureTransformation
$creadPrec :: ReadPrec FeatureTransformation
readList :: ReadS [FeatureTransformation]
$creadList :: ReadS [FeatureTransformation]
readsPrec :: Int -> ReadS FeatureTransformation
$creadsPrec :: Int -> ReadS FeatureTransformation
Prelude.Read, Int -> FeatureTransformation -> ShowS
[FeatureTransformation] -> ShowS
FeatureTransformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FeatureTransformation] -> ShowS
$cshowList :: [FeatureTransformation] -> ShowS
show :: FeatureTransformation -> String
$cshow :: FeatureTransformation -> String
showsPrec :: Int -> FeatureTransformation -> ShowS
$cshowsPrec :: Int -> FeatureTransformation -> ShowS
Prelude.Show, forall x. Rep FeatureTransformation x -> FeatureTransformation
forall x. FeatureTransformation -> Rep FeatureTransformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FeatureTransformation x -> FeatureTransformation
$cfrom :: forall x. FeatureTransformation -> Rep FeatureTransformation x
Prelude.Generic)

-- |
-- Create a value of 'FeatureTransformation' 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', 'featureTransformation_creationDateTime' - The creation date and time (in Unix time) of the feature transformation.
--
-- 'defaultParameters', 'featureTransformation_defaultParameters' - Provides the default parameters for feature transformation.
--
-- 'featureTransformationArn', 'featureTransformation_featureTransformationArn' - The Amazon Resource Name (ARN) of the FeatureTransformation object.
--
-- 'lastUpdatedDateTime', 'featureTransformation_lastUpdatedDateTime' - The last update date and time (in Unix time) of the feature
-- transformation.
--
-- 'name', 'featureTransformation_name' - The name of the feature transformation.
--
-- 'status', 'featureTransformation_status' - The status of the feature transformation.
--
-- A feature transformation can be in one of the following states:
--
-- -   CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
newFeatureTransformation ::
  FeatureTransformation
newFeatureTransformation :: FeatureTransformation
newFeatureTransformation =
  FeatureTransformation'
    { $sel:creationDateTime:FeatureTransformation' :: Maybe POSIX
creationDateTime =
        forall a. Maybe a
Prelude.Nothing,
      $sel:defaultParameters:FeatureTransformation' :: Maybe (HashMap Text Text)
defaultParameters = forall a. Maybe a
Prelude.Nothing,
      $sel:featureTransformationArn:FeatureTransformation' :: Maybe Text
featureTransformationArn = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:FeatureTransformation' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:FeatureTransformation' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:FeatureTransformation' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The creation date and time (in Unix time) of the feature transformation.
featureTransformation_creationDateTime :: Lens.Lens' FeatureTransformation (Prelude.Maybe Prelude.UTCTime)
featureTransformation_creationDateTime :: Lens' FeatureTransformation (Maybe UTCTime)
featureTransformation_creationDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureTransformation' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:FeatureTransformation' :: FeatureTransformation -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: FeatureTransformation
s@FeatureTransformation' {} Maybe POSIX
a -> FeatureTransformation
s {$sel:creationDateTime:FeatureTransformation' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: FeatureTransformation) 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

-- | Provides the default parameters for feature transformation.
featureTransformation_defaultParameters :: Lens.Lens' FeatureTransformation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
featureTransformation_defaultParameters :: Lens' FeatureTransformation (Maybe (HashMap Text Text))
featureTransformation_defaultParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureTransformation' {Maybe (HashMap Text Text)
defaultParameters :: Maybe (HashMap Text Text)
$sel:defaultParameters:FeatureTransformation' :: FeatureTransformation -> Maybe (HashMap Text Text)
defaultParameters} -> Maybe (HashMap Text Text)
defaultParameters) (\s :: FeatureTransformation
s@FeatureTransformation' {} Maybe (HashMap Text Text)
a -> FeatureTransformation
s {$sel:defaultParameters:FeatureTransformation' :: Maybe (HashMap Text Text)
defaultParameters = Maybe (HashMap Text Text)
a} :: FeatureTransformation) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The last update date and time (in Unix time) of the feature
-- transformation.
featureTransformation_lastUpdatedDateTime :: Lens.Lens' FeatureTransformation (Prelude.Maybe Prelude.UTCTime)
featureTransformation_lastUpdatedDateTime :: Lens' FeatureTransformation (Maybe UTCTime)
featureTransformation_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureTransformation' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:FeatureTransformation' :: FeatureTransformation -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: FeatureTransformation
s@FeatureTransformation' {} Maybe POSIX
a -> FeatureTransformation
s {$sel:lastUpdatedDateTime:FeatureTransformation' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: FeatureTransformation) 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 feature transformation.
featureTransformation_name :: Lens.Lens' FeatureTransformation (Prelude.Maybe Prelude.Text)
featureTransformation_name :: Lens' FeatureTransformation (Maybe Text)
featureTransformation_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureTransformation' {Maybe Text
name :: Maybe Text
$sel:name:FeatureTransformation' :: FeatureTransformation -> Maybe Text
name} -> Maybe Text
name) (\s :: FeatureTransformation
s@FeatureTransformation' {} Maybe Text
a -> FeatureTransformation
s {$sel:name:FeatureTransformation' :: Maybe Text
name = Maybe Text
a} :: FeatureTransformation)

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

instance Data.FromJSON FeatureTransformation where
  parseJSON :: Value -> Parser FeatureTransformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FeatureTransformation"
      ( \Object
x ->
          Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> FeatureTransformation
FeatureTransformation'
            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
"defaultParameters"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"featureTransformationArn")
            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
"status")
      )

instance Prelude.Hashable FeatureTransformation where
  hashWithSalt :: Int -> FeatureTransformation -> Int
hashWithSalt Int
_salt FeatureTransformation' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
status :: Maybe Text
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
featureTransformationArn :: Maybe Text
defaultParameters :: Maybe (HashMap Text Text)
creationDateTime :: Maybe POSIX
$sel:status:FeatureTransformation' :: FeatureTransformation -> Maybe Text
$sel:name:FeatureTransformation' :: FeatureTransformation -> Maybe Text
$sel:lastUpdatedDateTime:FeatureTransformation' :: FeatureTransformation -> Maybe POSIX
$sel:featureTransformationArn:FeatureTransformation' :: FeatureTransformation -> Maybe Text
$sel:defaultParameters:FeatureTransformation' :: FeatureTransformation -> Maybe (HashMap Text Text)
$sel:creationDateTime:FeatureTransformation' :: FeatureTransformation -> 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 (HashMap Text Text)
defaultParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
featureTransformationArn
      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
status

instance Prelude.NFData FeatureTransformation where
  rnf :: FeatureTransformation -> ()
rnf FeatureTransformation' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
status :: Maybe Text
name :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
featureTransformationArn :: Maybe Text
defaultParameters :: Maybe (HashMap Text Text)
creationDateTime :: Maybe POSIX
$sel:status:FeatureTransformation' :: FeatureTransformation -> Maybe Text
$sel:name:FeatureTransformation' :: FeatureTransformation -> Maybe Text
$sel:lastUpdatedDateTime:FeatureTransformation' :: FeatureTransformation -> Maybe POSIX
$sel:featureTransformationArn:FeatureTransformation' :: FeatureTransformation -> Maybe Text
$sel:defaultParameters:FeatureTransformation' :: FeatureTransformation -> Maybe (HashMap Text Text)
$sel:creationDateTime:FeatureTransformation' :: FeatureTransformation -> 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 (HashMap Text Text)
defaultParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
featureTransformationArn
      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
status