{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.NotebookInstanceLifecycleConfigSummary 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 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 Data.POSIX,
    -- | A timestamp that tells when the lifecycle configuration was last
    -- modified.
    NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.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
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]
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
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.
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'
      { $sel:creationTime:NotebookInstanceLifecycleConfigSummary' :: Maybe POSIX
creationTime =
          forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedTime:NotebookInstanceLifecycleConfigSummary' :: Maybe POSIX
lastModifiedTime = 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 :: Lens' NotebookInstanceLifecycleConfigSummary (Maybe UTCTime)
notebookInstanceLifecycleConfigSummary_creationTime = 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) 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

-- | A timestamp that tells when the lifecycle configuration was last
-- modified.
notebookInstanceLifecycleConfigSummary_lastModifiedTime :: Lens.Lens' NotebookInstanceLifecycleConfigSummary (Prelude.Maybe Prelude.UTCTime)
notebookInstanceLifecycleConfigSummary_lastModifiedTime :: Lens' NotebookInstanceLifecycleConfigSummary (Maybe UTCTime)
notebookInstanceLifecycleConfigSummary_lastModifiedTime = 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) 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 lifecycle configuration.
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigName :: Lens.Lens' NotebookInstanceLifecycleConfigSummary Prelude.Text
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigName :: Lens' NotebookInstanceLifecycleConfigSummary Text
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigName = 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 :: Lens' NotebookInstanceLifecycleConfigSummary Text
notebookInstanceLifecycleConfigSummary_notebookInstanceLifecycleConfigArn = 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
  Data.FromJSON
    NotebookInstanceLifecycleConfigSummary
  where
  parseJSON :: Value -> Parser NotebookInstanceLifecycleConfigSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NotebookInstanceLifecycleConfigSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Text
-> Text
-> NotebookInstanceLifecycleConfigSummary
NotebookInstanceLifecycleConfigSummary'
            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
"CreationTime")
            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
"LastModifiedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"NotebookInstanceLifecycleConfigName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"NotebookInstanceLifecycleConfigArn")
      )

instance
  Prelude.Hashable
    NotebookInstanceLifecycleConfigSummary
  where
  hashWithSalt :: Int -> NotebookInstanceLifecycleConfigSummary -> Int
hashWithSalt
    Int
_salt
    NotebookInstanceLifecycleConfigSummary' {Maybe POSIX
Text
notebookInstanceLifecycleConfigArn :: Text
notebookInstanceLifecycleConfigName :: Text
lastModifiedTime :: Maybe POSIX
creationTime :: Maybe POSIX
$sel:notebookInstanceLifecycleConfigArn:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Text
$sel:notebookInstanceLifecycleConfigName:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Text
$sel:lastModifiedTime:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
$sel:creationTime:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTime
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
notebookInstanceLifecycleConfigName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
notebookInstanceLifecycleConfigArn

instance
  Prelude.NFData
    NotebookInstanceLifecycleConfigSummary
  where
  rnf :: NotebookInstanceLifecycleConfigSummary -> ()
rnf NotebookInstanceLifecycleConfigSummary' {Maybe POSIX
Text
notebookInstanceLifecycleConfigArn :: Text
notebookInstanceLifecycleConfigName :: Text
lastModifiedTime :: Maybe POSIX
creationTime :: Maybe POSIX
$sel:notebookInstanceLifecycleConfigArn:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Text
$sel:notebookInstanceLifecycleConfigName:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Text
$sel:lastModifiedTime:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
$sel:creationTime:NotebookInstanceLifecycleConfigSummary' :: NotebookInstanceLifecycleConfigSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
notebookInstanceLifecycleConfigName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
notebookInstanceLifecycleConfigArn