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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of a notebook instance lifecycle configuration.
--
-- /See:/ 'newNotebookInstanceLifecycleConfigSummary' smart constructor.
data NotebookInstanceLifecycleConfigSummary = NotebookInstanceLifecycleConfigSummary'
  { -- | A timestamp that tells when the lifecycle configuration was created.
    NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | A timestamp that tells when the lifecycle configuration was last
    -- modified.
    NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the lifecycle configuration.
    NotebookInstanceLifecycleConfigSummary -> Text
notebookInstanceLifecycleConfigName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the lifecycle configuration.
    NotebookInstanceLifecycleConfigSummary -> Text
notebookInstanceLifecycleConfigArn :: Prelude.Text
  }
  deriving (NotebookInstanceLifecycleConfigSummary
-> NotebookInstanceLifecycleConfigSummary -> Bool
(NotebookInstanceLifecycleConfigSummary
 -> NotebookInstanceLifecycleConfigSummary -> Bool)
-> (NotebookInstanceLifecycleConfigSummary
    -> NotebookInstanceLifecycleConfigSummary -> Bool)
-> Eq NotebookInstanceLifecycleConfigSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotebookInstanceLifecycleConfigSummary
-> NotebookInstanceLifecycleConfigSummary -> Bool
$c/= :: NotebookInstanceLifecycleConfigSummary
-> NotebookInstanceLifecycleConfigSummary -> Bool
== :: NotebookInstanceLifecycleConfigSummary
-> NotebookInstanceLifecycleConfigSummary -> Bool
$c== :: NotebookInstanceLifecycleConfigSummary
-> NotebookInstanceLifecycleConfigSummary -> Bool
Prelude.Eq, ReadPrec [NotebookInstanceLifecycleConfigSummary]
ReadPrec NotebookInstanceLifecycleConfigSummary
Int -> ReadS NotebookInstanceLifecycleConfigSummary
ReadS [NotebookInstanceLifecycleConfigSummary]
(Int -> ReadS NotebookInstanceLifecycleConfigSummary)
-> ReadS [NotebookInstanceLifecycleConfigSummary]
-> ReadPrec NotebookInstanceLifecycleConfigSummary
-> ReadPrec [NotebookInstanceLifecycleConfigSummary]
-> Read NotebookInstanceLifecycleConfigSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotebookInstanceLifecycleConfigSummary]
$creadListPrec :: ReadPrec [NotebookInstanceLifecycleConfigSummary]
readPrec :: ReadPrec NotebookInstanceLifecycleConfigSummary
$creadPrec :: ReadPrec NotebookInstanceLifecycleConfigSummary
readList :: ReadS [NotebookInstanceLifecycleConfigSummary]
$creadList :: ReadS [NotebookInstanceLifecycleConfigSummary]
readsPrec :: Int -> ReadS NotebookInstanceLifecycleConfigSummary
$creadsPrec :: Int -> ReadS NotebookInstanceLifecycleConfigSummary
Prelude.Read, Int -> NotebookInstanceLifecycleConfigSummary -> ShowS
[NotebookInstanceLifecycleConfigSummary] -> ShowS
NotebookInstanceLifecycleConfigSummary -> String
(Int -> NotebookInstanceLifecycleConfigSummary -> ShowS)
-> (NotebookInstanceLifecycleConfigSummary -> String)
-> ([NotebookInstanceLifecycleConfigSummary] -> ShowS)
-> Show NotebookInstanceLifecycleConfigSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotebookInstanceLifecycleConfigSummary] -> ShowS
$cshowList :: [NotebookInstanceLifecycleConfigSummary] -> ShowS
show :: NotebookInstanceLifecycleConfigSummary -> String
$cshow :: NotebookInstanceLifecycleConfigSummary -> String
showsPrec :: Int -> NotebookInstanceLifecycleConfigSummary -> ShowS
$cshowsPrec :: Int -> NotebookInstanceLifecycleConfigSummary -> ShowS
Prelude.Show, (forall x.
 NotebookInstanceLifecycleConfigSummary
 -> Rep NotebookInstanceLifecycleConfigSummary x)
-> (forall x.
    Rep NotebookInstanceLifecycleConfigSummary x
    -> NotebookInstanceLifecycleConfigSummary)
-> Generic NotebookInstanceLifecycleConfigSummary
forall x.
Rep NotebookInstanceLifecycleConfigSummary x
-> NotebookInstanceLifecycleConfigSummary
forall x.
NotebookInstanceLifecycleConfigSummary
-> Rep NotebookInstanceLifecycleConfigSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NotebookInstanceLifecycleConfigSummary x
-> NotebookInstanceLifecycleConfigSummary
$cfrom :: forall x.
NotebookInstanceLifecycleConfigSummary
-> Rep NotebookInstanceLifecycleConfigSummary x
Prelude.Generic)

-- |
-- Create a value of 'NotebookInstanceLifecycleConfigSummary' 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:
--
-- 'creationTime', 'notebookInstanceLifecycleConfigSummary_creationTime' - A timestamp that tells when the lifecycle configuration was created.
--
-- 'lastModifiedTime', 'notebookInstanceLifecycleConfigSummary_lastModifiedTime' - A timestamp that tells when the lifecycle configuration was last
-- modified.
--
-- 'notebookInstanceLifecycleConfigName', 'notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigName' - The name of the lifecycle configuration.
--
-- 'notebookInstanceLifecycleConfigArn', 'notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigArn' - The Amazon Resource Name (ARN) of the lifecycle configuration.
newNotebookInstanceLifecycleConfigSummary ::
  -- | 'notebookInstanceLifecycleConfigName'
  Prelude.Text ->
  -- | 'notebookInstanceLifecycleConfigArn'
  Prelude.Text ->
  NotebookInstanceLifecycleConfigSummary
newNotebookInstanceLifecycleConfigSummary :: Text -> Text -> NotebookInstanceLifecycleConfigSummary
newNotebookInstanceLifecycleConfigSummary
  Text
pNotebookInstanceLifecycleConfigName_
  Text
pNotebookInstanceLifecycleConfigArn_ =
    NotebookInstanceLifecycleConfigSummary' :: Maybe POSIX
-> Maybe POSIX
-> Text
-> Text
-> NotebookInstanceLifecycleConfigSummary
NotebookInstanceLifecycleConfigSummary'
      { $sel:creationTime:NotebookInstanceLifecycleConfigSummary' :: Maybe POSIX
creationTime =
          Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedTime:NotebookInstanceLifecycleConfigSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:notebookInstanceLifecycleConfigName:NotebookInstanceLifecycleConfigSummary' :: Text
notebookInstanceLifecycleConfigName =
          Text
pNotebookInstanceLifecycleConfigName_,
        $sel:notebookInstanceLifecycleConfigArn:NotebookInstanceLifecycleConfigSummary' :: Text
notebookInstanceLifecycleConfigArn =
          Text
pNotebookInstanceLifecycleConfigArn_
      }

-- | A timestamp that tells when the lifecycle configuration was created.
notebookInstanceLifecycleConfigSummary_creationTime :: Lens.Lens' NotebookInstanceLifecycleConfigSummary (Prelude.Maybe Prelude.UTCTime)
notebookInstanceLifecycleConfigSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> NotebookInstanceLifecycleConfigSummary
-> f NotebookInstanceLifecycleConfigSummary
notebookInstanceLifecycleConfigSummary_creationTime = (NotebookInstanceLifecycleConfigSummary -> Maybe POSIX)
-> (NotebookInstanceLifecycleConfigSummary
    -> Maybe POSIX -> NotebookInstanceLifecycleConfigSummary)
-> Lens
     NotebookInstanceLifecycleConfigSummary
     NotebookInstanceLifecycleConfigSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookInstanceLifecycleConfigSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: NotebookInstanceLifecycleConfigSummary
s@NotebookInstanceLifecycleConfigSummary' {} Maybe POSIX
a -> NotebookInstanceLifecycleConfigSummary
s {$sel:creationTime:NotebookInstanceLifecycleConfigSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: NotebookInstanceLifecycleConfigSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> NotebookInstanceLifecycleConfigSummary
 -> f NotebookInstanceLifecycleConfigSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> NotebookInstanceLifecycleConfigSummary
-> f NotebookInstanceLifecycleConfigSummary
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

-- | A timestamp that tells when the lifecycle configuration was last
-- modified.
notebookInstanceLifecycleConfigSummary_lastModifiedTime :: Lens.Lens' NotebookInstanceLifecycleConfigSummary (Prelude.Maybe Prelude.UTCTime)
notebookInstanceLifecycleConfigSummary_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> NotebookInstanceLifecycleConfigSummary
-> f NotebookInstanceLifecycleConfigSummary
notebookInstanceLifecycleConfigSummary_lastModifiedTime = (NotebookInstanceLifecycleConfigSummary -> Maybe POSIX)
-> (NotebookInstanceLifecycleConfigSummary
    -> Maybe POSIX -> NotebookInstanceLifecycleConfigSummary)
-> Lens
     NotebookInstanceLifecycleConfigSummary
     NotebookInstanceLifecycleConfigSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookInstanceLifecycleConfigSummary' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: NotebookInstanceLifecycleConfigSummary
s@NotebookInstanceLifecycleConfigSummary' {} Maybe POSIX
a -> NotebookInstanceLifecycleConfigSummary
s {$sel:lastModifiedTime:NotebookInstanceLifecycleConfigSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: NotebookInstanceLifecycleConfigSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> NotebookInstanceLifecycleConfigSummary
 -> f NotebookInstanceLifecycleConfigSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> NotebookInstanceLifecycleConfigSummary
-> f NotebookInstanceLifecycleConfigSummary
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 name of the lifecycle configuration.
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigName :: Lens.Lens' NotebookInstanceLifecycleConfigSummary Prelude.Text
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigName :: (Text -> f Text)
-> NotebookInstanceLifecycleConfigSummary
-> f NotebookInstanceLifecycleConfigSummary
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigName = (NotebookInstanceLifecycleConfigSummary -> Text)
-> (NotebookInstanceLifecycleConfigSummary
    -> Text -> NotebookInstanceLifecycleConfigSummary)
-> Lens
     NotebookInstanceLifecycleConfigSummary
     NotebookInstanceLifecycleConfigSummary
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookInstanceLifecycleConfigSummary' {Text
notebookInstanceLifecycleConfigName :: Text
$sel:notebookInstanceLifecycleConfigName:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Text
notebookInstanceLifecycleConfigName} -> Text
notebookInstanceLifecycleConfigName) (\s :: NotebookInstanceLifecycleConfigSummary
s@NotebookInstanceLifecycleConfigSummary' {} Text
a -> NotebookInstanceLifecycleConfigSummary
s {$sel:notebookInstanceLifecycleConfigName:NotebookInstanceLifecycleConfigSummary' :: Text
notebookInstanceLifecycleConfigName = Text
a} :: NotebookInstanceLifecycleConfigSummary)

-- | The Amazon Resource Name (ARN) of the lifecycle configuration.
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigArn :: Lens.Lens' NotebookInstanceLifecycleConfigSummary Prelude.Text
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigArn :: (Text -> f Text)
-> NotebookInstanceLifecycleConfigSummary
-> f NotebookInstanceLifecycleConfigSummary
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigArn = (NotebookInstanceLifecycleConfigSummary -> Text)
-> (NotebookInstanceLifecycleConfigSummary
    -> Text -> NotebookInstanceLifecycleConfigSummary)
-> Lens
     NotebookInstanceLifecycleConfigSummary
     NotebookInstanceLifecycleConfigSummary
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookInstanceLifecycleConfigSummary' {Text
notebookInstanceLifecycleConfigArn :: Text
$sel:notebookInstanceLifecycleConfigArn:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Text
notebookInstanceLifecycleConfigArn} -> Text
notebookInstanceLifecycleConfigArn) (\s :: NotebookInstanceLifecycleConfigSummary
s@NotebookInstanceLifecycleConfigSummary' {} Text
a -> NotebookInstanceLifecycleConfigSummary
s {$sel:notebookInstanceLifecycleConfigArn:NotebookInstanceLifecycleConfigSummary' :: Text
notebookInstanceLifecycleConfigArn = Text
a} :: NotebookInstanceLifecycleConfigSummary)

instance
  Core.FromJSON
    NotebookInstanceLifecycleConfigSummary
  where
  parseJSON :: Value -> Parser NotebookInstanceLifecycleConfigSummary
parseJSON =
    String
-> (Object -> Parser NotebookInstanceLifecycleConfigSummary)
-> Value
-> Parser NotebookInstanceLifecycleConfigSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NotebookInstanceLifecycleConfigSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Text
-> Text
-> NotebookInstanceLifecycleConfigSummary
NotebookInstanceLifecycleConfigSummary'
            (Maybe POSIX
 -> Maybe POSIX
 -> Text
 -> Text
 -> NotebookInstanceLifecycleConfigSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Text -> Text -> NotebookInstanceLifecycleConfigSummary)
forall (f :: * -> *) a b. Functor 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
"CreationTime")
            Parser
  (Maybe POSIX
   -> Text -> Text -> NotebookInstanceLifecycleConfigSummary)
-> Parser (Maybe POSIX)
-> Parser (Text -> Text -> NotebookInstanceLifecycleConfigSummary)
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
"LastModifiedTime")
            Parser (Text -> Text -> NotebookInstanceLifecycleConfigSummary)
-> Parser Text
-> Parser (Text -> NotebookInstanceLifecycleConfigSummary)
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
"NotebookInstanceLifecycleConfigName")
            Parser (Text -> NotebookInstanceLifecycleConfigSummary)
-> Parser Text -> Parser NotebookInstanceLifecycleConfigSummary
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
"NotebookInstanceLifecycleConfigArn")
      )

instance
  Prelude.Hashable
    NotebookInstanceLifecycleConfigSummary

instance
  Prelude.NFData
    NotebookInstanceLifecycleConfigSummary