{-# 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.SageMaker.Types.FeatureGroupSummary
-- 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.SageMaker.Types.FeatureGroupSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.FeatureGroupStatus
import Amazonka.SageMaker.Types.OfflineStoreStatus

-- | The name, Arn, @CreationTime@, @FeatureGroup@ values, @LastUpdatedTime@
-- and @EnableOnlineStorage@ status of a @FeatureGroup@.
--
-- /See:/ 'newFeatureGroupSummary' smart constructor.
data FeatureGroupSummary = FeatureGroupSummary'
  { -- | The status of a FeatureGroup. The status can be any of the following:
    -- @Creating@, @Created@, @CreateFail@, @Deleting@ or @DetailFail@.
    FeatureGroupSummary -> Maybe FeatureGroupStatus
featureGroupStatus :: Prelude.Maybe FeatureGroupStatus,
    -- | Notifies you if replicating data into the @OfflineStore@ has failed.
    -- Returns either: @Active@ or @Blocked@.
    FeatureGroupSummary -> Maybe OfflineStoreStatus
offlineStoreStatus :: Prelude.Maybe OfflineStoreStatus,
    -- | The name of @FeatureGroup@.
    FeatureGroupSummary -> Text
featureGroupName :: Prelude.Text,
    -- | Unique identifier for the @FeatureGroup@.
    FeatureGroupSummary -> Text
featureGroupArn :: Prelude.Text,
    -- | A timestamp indicating the time of creation time of the @FeatureGroup@.
    FeatureGroupSummary -> POSIX
creationTime :: Core.POSIX
  }
  deriving (FeatureGroupSummary -> FeatureGroupSummary -> Bool
(FeatureGroupSummary -> FeatureGroupSummary -> Bool)
-> (FeatureGroupSummary -> FeatureGroupSummary -> Bool)
-> Eq FeatureGroupSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FeatureGroupSummary -> FeatureGroupSummary -> Bool
$c/= :: FeatureGroupSummary -> FeatureGroupSummary -> Bool
== :: FeatureGroupSummary -> FeatureGroupSummary -> Bool
$c== :: FeatureGroupSummary -> FeatureGroupSummary -> Bool
Prelude.Eq, ReadPrec [FeatureGroupSummary]
ReadPrec FeatureGroupSummary
Int -> ReadS FeatureGroupSummary
ReadS [FeatureGroupSummary]
(Int -> ReadS FeatureGroupSummary)
-> ReadS [FeatureGroupSummary]
-> ReadPrec FeatureGroupSummary
-> ReadPrec [FeatureGroupSummary]
-> Read FeatureGroupSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FeatureGroupSummary]
$creadListPrec :: ReadPrec [FeatureGroupSummary]
readPrec :: ReadPrec FeatureGroupSummary
$creadPrec :: ReadPrec FeatureGroupSummary
readList :: ReadS [FeatureGroupSummary]
$creadList :: ReadS [FeatureGroupSummary]
readsPrec :: Int -> ReadS FeatureGroupSummary
$creadsPrec :: Int -> ReadS FeatureGroupSummary
Prelude.Read, Int -> FeatureGroupSummary -> ShowS
[FeatureGroupSummary] -> ShowS
FeatureGroupSummary -> String
(Int -> FeatureGroupSummary -> ShowS)
-> (FeatureGroupSummary -> String)
-> ([FeatureGroupSummary] -> ShowS)
-> Show FeatureGroupSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FeatureGroupSummary] -> ShowS
$cshowList :: [FeatureGroupSummary] -> ShowS
show :: FeatureGroupSummary -> String
$cshow :: FeatureGroupSummary -> String
showsPrec :: Int -> FeatureGroupSummary -> ShowS
$cshowsPrec :: Int -> FeatureGroupSummary -> ShowS
Prelude.Show, (forall x. FeatureGroupSummary -> Rep FeatureGroupSummary x)
-> (forall x. Rep FeatureGroupSummary x -> FeatureGroupSummary)
-> Generic FeatureGroupSummary
forall x. Rep FeatureGroupSummary x -> FeatureGroupSummary
forall x. FeatureGroupSummary -> Rep FeatureGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FeatureGroupSummary x -> FeatureGroupSummary
$cfrom :: forall x. FeatureGroupSummary -> Rep FeatureGroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'FeatureGroupSummary' 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:
--
-- 'featureGroupStatus', 'featureGroupSummary_featureGroupStatus' - The status of a FeatureGroup. The status can be any of the following:
-- @Creating@, @Created@, @CreateFail@, @Deleting@ or @DetailFail@.
--
-- 'offlineStoreStatus', 'featureGroupSummary_offlineStoreStatus' - Notifies you if replicating data into the @OfflineStore@ has failed.
-- Returns either: @Active@ or @Blocked@.
--
-- 'featureGroupName', 'featureGroupSummary_featureGroupName' - The name of @FeatureGroup@.
--
-- 'featureGroupArn', 'featureGroupSummary_featureGroupArn' - Unique identifier for the @FeatureGroup@.
--
-- 'creationTime', 'featureGroupSummary_creationTime' - A timestamp indicating the time of creation time of the @FeatureGroup@.
newFeatureGroupSummary ::
  -- | 'featureGroupName'
  Prelude.Text ->
  -- | 'featureGroupArn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  FeatureGroupSummary
newFeatureGroupSummary :: Text -> Text -> UTCTime -> FeatureGroupSummary
newFeatureGroupSummary
  Text
pFeatureGroupName_
  Text
pFeatureGroupArn_
  UTCTime
pCreationTime_ =
    FeatureGroupSummary' :: Maybe FeatureGroupStatus
-> Maybe OfflineStoreStatus
-> Text
-> Text
-> POSIX
-> FeatureGroupSummary
FeatureGroupSummary'
      { $sel:featureGroupStatus:FeatureGroupSummary' :: Maybe FeatureGroupStatus
featureGroupStatus =
          Maybe FeatureGroupStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:offlineStoreStatus:FeatureGroupSummary' :: Maybe OfflineStoreStatus
offlineStoreStatus = Maybe OfflineStoreStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:featureGroupName:FeatureGroupSummary' :: Text
featureGroupName = Text
pFeatureGroupName_,
        $sel:featureGroupArn:FeatureGroupSummary' :: Text
featureGroupArn = Text
pFeatureGroupArn_,
        $sel:creationTime:FeatureGroupSummary' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_
      }

-- | The status of a FeatureGroup. The status can be any of the following:
-- @Creating@, @Created@, @CreateFail@, @Deleting@ or @DetailFail@.
featureGroupSummary_featureGroupStatus :: Lens.Lens' FeatureGroupSummary (Prelude.Maybe FeatureGroupStatus)
featureGroupSummary_featureGroupStatus :: (Maybe FeatureGroupStatus -> f (Maybe FeatureGroupStatus))
-> FeatureGroupSummary -> f FeatureGroupSummary
featureGroupSummary_featureGroupStatus = (FeatureGroupSummary -> Maybe FeatureGroupStatus)
-> (FeatureGroupSummary
    -> Maybe FeatureGroupStatus -> FeatureGroupSummary)
-> Lens
     FeatureGroupSummary
     FeatureGroupSummary
     (Maybe FeatureGroupStatus)
     (Maybe FeatureGroupStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureGroupSummary' {Maybe FeatureGroupStatus
featureGroupStatus :: Maybe FeatureGroupStatus
$sel:featureGroupStatus:FeatureGroupSummary' :: FeatureGroupSummary -> Maybe FeatureGroupStatus
featureGroupStatus} -> Maybe FeatureGroupStatus
featureGroupStatus) (\s :: FeatureGroupSummary
s@FeatureGroupSummary' {} Maybe FeatureGroupStatus
a -> FeatureGroupSummary
s {$sel:featureGroupStatus:FeatureGroupSummary' :: Maybe FeatureGroupStatus
featureGroupStatus = Maybe FeatureGroupStatus
a} :: FeatureGroupSummary)

-- | Notifies you if replicating data into the @OfflineStore@ has failed.
-- Returns either: @Active@ or @Blocked@.
featureGroupSummary_offlineStoreStatus :: Lens.Lens' FeatureGroupSummary (Prelude.Maybe OfflineStoreStatus)
featureGroupSummary_offlineStoreStatus :: (Maybe OfflineStoreStatus -> f (Maybe OfflineStoreStatus))
-> FeatureGroupSummary -> f FeatureGroupSummary
featureGroupSummary_offlineStoreStatus = (FeatureGroupSummary -> Maybe OfflineStoreStatus)
-> (FeatureGroupSummary
    -> Maybe OfflineStoreStatus -> FeatureGroupSummary)
-> Lens
     FeatureGroupSummary
     FeatureGroupSummary
     (Maybe OfflineStoreStatus)
     (Maybe OfflineStoreStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureGroupSummary' {Maybe OfflineStoreStatus
offlineStoreStatus :: Maybe OfflineStoreStatus
$sel:offlineStoreStatus:FeatureGroupSummary' :: FeatureGroupSummary -> Maybe OfflineStoreStatus
offlineStoreStatus} -> Maybe OfflineStoreStatus
offlineStoreStatus) (\s :: FeatureGroupSummary
s@FeatureGroupSummary' {} Maybe OfflineStoreStatus
a -> FeatureGroupSummary
s {$sel:offlineStoreStatus:FeatureGroupSummary' :: Maybe OfflineStoreStatus
offlineStoreStatus = Maybe OfflineStoreStatus
a} :: FeatureGroupSummary)

-- | The name of @FeatureGroup@.
featureGroupSummary_featureGroupName :: Lens.Lens' FeatureGroupSummary Prelude.Text
featureGroupSummary_featureGroupName :: (Text -> f Text) -> FeatureGroupSummary -> f FeatureGroupSummary
featureGroupSummary_featureGroupName = (FeatureGroupSummary -> Text)
-> (FeatureGroupSummary -> Text -> FeatureGroupSummary)
-> Lens FeatureGroupSummary FeatureGroupSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureGroupSummary' {Text
featureGroupName :: Text
$sel:featureGroupName:FeatureGroupSummary' :: FeatureGroupSummary -> Text
featureGroupName} -> Text
featureGroupName) (\s :: FeatureGroupSummary
s@FeatureGroupSummary' {} Text
a -> FeatureGroupSummary
s {$sel:featureGroupName:FeatureGroupSummary' :: Text
featureGroupName = Text
a} :: FeatureGroupSummary)

-- | Unique identifier for the @FeatureGroup@.
featureGroupSummary_featureGroupArn :: Lens.Lens' FeatureGroupSummary Prelude.Text
featureGroupSummary_featureGroupArn :: (Text -> f Text) -> FeatureGroupSummary -> f FeatureGroupSummary
featureGroupSummary_featureGroupArn = (FeatureGroupSummary -> Text)
-> (FeatureGroupSummary -> Text -> FeatureGroupSummary)
-> Lens FeatureGroupSummary FeatureGroupSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureGroupSummary' {Text
featureGroupArn :: Text
$sel:featureGroupArn:FeatureGroupSummary' :: FeatureGroupSummary -> Text
featureGroupArn} -> Text
featureGroupArn) (\s :: FeatureGroupSummary
s@FeatureGroupSummary' {} Text
a -> FeatureGroupSummary
s {$sel:featureGroupArn:FeatureGroupSummary' :: Text
featureGroupArn = Text
a} :: FeatureGroupSummary)

-- | A timestamp indicating the time of creation time of the @FeatureGroup@.
featureGroupSummary_creationTime :: Lens.Lens' FeatureGroupSummary Prelude.UTCTime
featureGroupSummary_creationTime :: (UTCTime -> f UTCTime)
-> FeatureGroupSummary -> f FeatureGroupSummary
featureGroupSummary_creationTime = (FeatureGroupSummary -> POSIX)
-> (FeatureGroupSummary -> POSIX -> FeatureGroupSummary)
-> Lens FeatureGroupSummary FeatureGroupSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FeatureGroupSummary' {POSIX
creationTime :: POSIX
$sel:creationTime:FeatureGroupSummary' :: FeatureGroupSummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: FeatureGroupSummary
s@FeatureGroupSummary' {} POSIX
a -> FeatureGroupSummary
s {$sel:creationTime:FeatureGroupSummary' :: POSIX
creationTime = POSIX
a} :: FeatureGroupSummary) ((POSIX -> f POSIX)
 -> FeatureGroupSummary -> f FeatureGroupSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> FeatureGroupSummary
-> f FeatureGroupSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON FeatureGroupSummary where
  parseJSON :: Value -> Parser FeatureGroupSummary
parseJSON =
    String
-> (Object -> Parser FeatureGroupSummary)
-> Value
-> Parser FeatureGroupSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FeatureGroupSummary"
      ( \Object
x ->
          Maybe FeatureGroupStatus
-> Maybe OfflineStoreStatus
-> Text
-> Text
-> POSIX
-> FeatureGroupSummary
FeatureGroupSummary'
            (Maybe FeatureGroupStatus
 -> Maybe OfflineStoreStatus
 -> Text
 -> Text
 -> POSIX
 -> FeatureGroupSummary)
-> Parser (Maybe FeatureGroupStatus)
-> Parser
     (Maybe OfflineStoreStatus
      -> Text -> Text -> POSIX -> FeatureGroupSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FeatureGroupStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FeatureGroupStatus")
            Parser
  (Maybe OfflineStoreStatus
   -> Text -> Text -> POSIX -> FeatureGroupSummary)
-> Parser (Maybe OfflineStoreStatus)
-> Parser (Text -> Text -> POSIX -> FeatureGroupSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OfflineStoreStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OfflineStoreStatus")
            Parser (Text -> Text -> POSIX -> FeatureGroupSummary)
-> Parser Text -> Parser (Text -> POSIX -> FeatureGroupSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FeatureGroupName")
            Parser (Text -> POSIX -> FeatureGroupSummary)
-> Parser Text -> Parser (POSIX -> FeatureGroupSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FeatureGroupArn")
            Parser (POSIX -> FeatureGroupSummary)
-> Parser POSIX -> Parser FeatureGroupSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationTime")
      )

instance Prelude.Hashable FeatureGroupSummary

instance Prelude.NFData FeatureGroupSummary