{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NotebookInstanceLifecycleHook = NotebookInstanceLifecycleHook'
{
NotebookInstanceLifecycleHook -> Maybe Text
content :: Prelude.Maybe Prelude.Text
}
deriving (NotebookInstanceLifecycleHook
-> NotebookInstanceLifecycleHook -> Bool
(NotebookInstanceLifecycleHook
-> NotebookInstanceLifecycleHook -> Bool)
-> (NotebookInstanceLifecycleHook
-> NotebookInstanceLifecycleHook -> Bool)
-> Eq NotebookInstanceLifecycleHook
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]
(Int -> ReadS NotebookInstanceLifecycleHook)
-> ReadS [NotebookInstanceLifecycleHook]
-> ReadPrec NotebookInstanceLifecycleHook
-> ReadPrec [NotebookInstanceLifecycleHook]
-> Read 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
(Int -> NotebookInstanceLifecycleHook -> ShowS)
-> (NotebookInstanceLifecycleHook -> String)
-> ([NotebookInstanceLifecycleHook] -> ShowS)
-> Show NotebookInstanceLifecycleHook
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.
NotebookInstanceLifecycleHook
-> Rep NotebookInstanceLifecycleHook x)
-> (forall x.
Rep NotebookInstanceLifecycleHook x
-> NotebookInstanceLifecycleHook)
-> Generic NotebookInstanceLifecycleHook
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' :: Maybe Text -> NotebookInstanceLifecycleHook
NotebookInstanceLifecycleHook'
{ $sel:content:NotebookInstanceLifecycleHook' :: Maybe Text
content =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
notebookInstanceLifecycleHook_content :: Lens.Lens' NotebookInstanceLifecycleHook (Prelude.Maybe Prelude.Text)
notebookInstanceLifecycleHook_content :: (Maybe Text -> f (Maybe Text))
-> NotebookInstanceLifecycleHook -> f NotebookInstanceLifecycleHook
notebookInstanceLifecycleHook_content = (NotebookInstanceLifecycleHook -> Maybe Text)
-> (NotebookInstanceLifecycleHook
-> Maybe Text -> NotebookInstanceLifecycleHook)
-> Lens
NotebookInstanceLifecycleHook
NotebookInstanceLifecycleHook
(Maybe Text)
(Maybe Text)
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 Core.FromJSON NotebookInstanceLifecycleHook where
parseJSON :: Value -> Parser NotebookInstanceLifecycleHook
parseJSON =
String
-> (Object -> Parser NotebookInstanceLifecycleHook)
-> Value
-> Parser NotebookInstanceLifecycleHook
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NotebookInstanceLifecycleHook"
( \Object
x ->
Maybe Text -> NotebookInstanceLifecycleHook
NotebookInstanceLifecycleHook'
(Maybe Text -> NotebookInstanceLifecycleHook)
-> Parser (Maybe Text) -> Parser NotebookInstanceLifecycleHook
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Content")
)
instance
Prelude.Hashable
NotebookInstanceLifecycleHook
instance Prelude.NFData NotebookInstanceLifecycleHook
instance Core.ToJSON NotebookInstanceLifecycleHook where
toJSON :: NotebookInstanceLifecycleHook -> Value
toJSON NotebookInstanceLifecycleHook' {Maybe Text
content :: Maybe Text
$sel:content:NotebookInstanceLifecycleHook' :: NotebookInstanceLifecycleHook -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"Content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
content]
)