{-# 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 #-}
module Amazonka.SageMaker.Types.NotebookInstanceLifecycleHook 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
data NotebookInstanceLifecycleHook = NotebookInstanceLifecycleHook'
{
NotebookInstanceLifecycleHook -> Maybe Text
content :: Prelude.Maybe Prelude.Text
}
deriving (NotebookInstanceLifecycleHook
-> NotebookInstanceLifecycleHook -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotebookInstanceLifecycleHook
-> NotebookInstanceLifecycleHook -> Bool
$c/= :: NotebookInstanceLifecycleHook
-> NotebookInstanceLifecycleHook -> Bool
== :: NotebookInstanceLifecycleHook
-> NotebookInstanceLifecycleHook -> Bool
$c== :: NotebookInstanceLifecycleHook
-> NotebookInstanceLifecycleHook -> Bool
Prelude.Eq, ReadPrec [NotebookInstanceLifecycleHook]
ReadPrec NotebookInstanceLifecycleHook
Int -> ReadS NotebookInstanceLifecycleHook
ReadS [NotebookInstanceLifecycleHook]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotebookInstanceLifecycleHook]
$creadListPrec :: ReadPrec [NotebookInstanceLifecycleHook]
readPrec :: ReadPrec NotebookInstanceLifecycleHook
$creadPrec :: ReadPrec NotebookInstanceLifecycleHook
readList :: ReadS [NotebookInstanceLifecycleHook]
$creadList :: ReadS [NotebookInstanceLifecycleHook]
readsPrec :: Int -> ReadS NotebookInstanceLifecycleHook
$creadsPrec :: Int -> ReadS NotebookInstanceLifecycleHook
Prelude.Read, Int -> NotebookInstanceLifecycleHook -> ShowS
[NotebookInstanceLifecycleHook] -> ShowS
NotebookInstanceLifecycleHook -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotebookInstanceLifecycleHook] -> ShowS
$cshowList :: [NotebookInstanceLifecycleHook] -> ShowS
show :: NotebookInstanceLifecycleHook -> String
$cshow :: NotebookInstanceLifecycleHook -> String
showsPrec :: Int -> NotebookInstanceLifecycleHook -> ShowS
$cshowsPrec :: Int -> NotebookInstanceLifecycleHook -> ShowS
Prelude.Show, forall x.
Rep NotebookInstanceLifecycleHook x
-> NotebookInstanceLifecycleHook
forall x.
NotebookInstanceLifecycleHook
-> Rep NotebookInstanceLifecycleHook x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NotebookInstanceLifecycleHook x
-> NotebookInstanceLifecycleHook
$cfrom :: forall x.
NotebookInstanceLifecycleHook
-> Rep NotebookInstanceLifecycleHook x
Prelude.Generic)
newNotebookInstanceLifecycleHook ::
NotebookInstanceLifecycleHook
newNotebookInstanceLifecycleHook :: NotebookInstanceLifecycleHook
newNotebookInstanceLifecycleHook =
NotebookInstanceLifecycleHook'
{ $sel:content:NotebookInstanceLifecycleHook' :: Maybe Text
content =
forall a. Maybe a
Prelude.Nothing
}
notebookInstanceLifecycleHook_content :: Lens.Lens' NotebookInstanceLifecycleHook (Prelude.Maybe Prelude.Text)
notebookInstanceLifecycleHook_content :: Lens' NotebookInstanceLifecycleHook (Maybe Text)
notebookInstanceLifecycleHook_content = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotebookInstanceLifecycleHook' {Maybe Text
content :: Maybe Text
$sel:content:NotebookInstanceLifecycleHook' :: NotebookInstanceLifecycleHook -> Maybe Text
content} -> Maybe Text
content) (\s :: NotebookInstanceLifecycleHook
s@NotebookInstanceLifecycleHook' {} Maybe Text
a -> NotebookInstanceLifecycleHook
s {$sel:content:NotebookInstanceLifecycleHook' :: Maybe Text
content = Maybe Text
a} :: NotebookInstanceLifecycleHook)
instance Data.FromJSON NotebookInstanceLifecycleHook where
parseJSON :: Value -> Parser NotebookInstanceLifecycleHook
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NotebookInstanceLifecycleHook"
( \Object
x ->
Maybe Text -> NotebookInstanceLifecycleHook
NotebookInstanceLifecycleHook'
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
"Content")
)
instance
Prelude.Hashable
NotebookInstanceLifecycleHook
where
hashWithSalt :: Int -> NotebookInstanceLifecycleHook -> Int
hashWithSalt Int
_salt NotebookInstanceLifecycleHook' {Maybe Text
content :: Maybe Text
$sel:content:NotebookInstanceLifecycleHook' :: NotebookInstanceLifecycleHook -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
content
instance Prelude.NFData NotebookInstanceLifecycleHook where
rnf :: NotebookInstanceLifecycleHook -> ()
rnf NotebookInstanceLifecycleHook' {Maybe Text
content :: Maybe Text
$sel:content:NotebookInstanceLifecycleHook' :: NotebookInstanceLifecycleHook -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
content
instance Data.ToJSON NotebookInstanceLifecycleHook where
toJSON :: NotebookInstanceLifecycleHook -> Value
toJSON NotebookInstanceLifecycleHook' {Maybe Text
content :: Maybe Text
$sel:content:NotebookInstanceLifecycleHook' :: NotebookInstanceLifecycleHook -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"Content" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
content]
)