{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SageMaker.StartNotebookInstance
(
StartNotebookInstance (..),
newStartNotebookInstance,
startNotebookInstance_notebookInstanceName,
StartNotebookInstanceResponse (..),
newStartNotebookInstanceResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types
data StartNotebookInstance = StartNotebookInstance'
{
StartNotebookInstance -> Text
notebookInstanceName :: Prelude.Text
}
deriving (StartNotebookInstance -> StartNotebookInstance -> Bool
(StartNotebookInstance -> StartNotebookInstance -> Bool)
-> (StartNotebookInstance -> StartNotebookInstance -> Bool)
-> Eq StartNotebookInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartNotebookInstance -> StartNotebookInstance -> Bool
$c/= :: StartNotebookInstance -> StartNotebookInstance -> Bool
== :: StartNotebookInstance -> StartNotebookInstance -> Bool
$c== :: StartNotebookInstance -> StartNotebookInstance -> Bool
Prelude.Eq, ReadPrec [StartNotebookInstance]
ReadPrec StartNotebookInstance
Int -> ReadS StartNotebookInstance
ReadS [StartNotebookInstance]
(Int -> ReadS StartNotebookInstance)
-> ReadS [StartNotebookInstance]
-> ReadPrec StartNotebookInstance
-> ReadPrec [StartNotebookInstance]
-> Read StartNotebookInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartNotebookInstance]
$creadListPrec :: ReadPrec [StartNotebookInstance]
readPrec :: ReadPrec StartNotebookInstance
$creadPrec :: ReadPrec StartNotebookInstance
readList :: ReadS [StartNotebookInstance]
$creadList :: ReadS [StartNotebookInstance]
readsPrec :: Int -> ReadS StartNotebookInstance
$creadsPrec :: Int -> ReadS StartNotebookInstance
Prelude.Read, Int -> StartNotebookInstance -> ShowS
[StartNotebookInstance] -> ShowS
StartNotebookInstance -> String
(Int -> StartNotebookInstance -> ShowS)
-> (StartNotebookInstance -> String)
-> ([StartNotebookInstance] -> ShowS)
-> Show StartNotebookInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartNotebookInstance] -> ShowS
$cshowList :: [StartNotebookInstance] -> ShowS
show :: StartNotebookInstance -> String
$cshow :: StartNotebookInstance -> String
showsPrec :: Int -> StartNotebookInstance -> ShowS
$cshowsPrec :: Int -> StartNotebookInstance -> ShowS
Prelude.Show, (forall x. StartNotebookInstance -> Rep StartNotebookInstance x)
-> (forall x. Rep StartNotebookInstance x -> StartNotebookInstance)
-> Generic StartNotebookInstance
forall x. Rep StartNotebookInstance x -> StartNotebookInstance
forall x. StartNotebookInstance -> Rep StartNotebookInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartNotebookInstance x -> StartNotebookInstance
$cfrom :: forall x. StartNotebookInstance -> Rep StartNotebookInstance x
Prelude.Generic)
newStartNotebookInstance ::
Prelude.Text ->
StartNotebookInstance
newStartNotebookInstance :: Text -> StartNotebookInstance
newStartNotebookInstance Text
pNotebookInstanceName_ =
StartNotebookInstance' :: Text -> StartNotebookInstance
StartNotebookInstance'
{ $sel:notebookInstanceName:StartNotebookInstance' :: Text
notebookInstanceName =
Text
pNotebookInstanceName_
}
startNotebookInstance_notebookInstanceName :: Lens.Lens' StartNotebookInstance Prelude.Text
startNotebookInstance_notebookInstanceName :: (Text -> f Text)
-> StartNotebookInstance -> f StartNotebookInstance
startNotebookInstance_notebookInstanceName = (StartNotebookInstance -> Text)
-> (StartNotebookInstance -> Text -> StartNotebookInstance)
-> Lens StartNotebookInstance StartNotebookInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartNotebookInstance' {Text
notebookInstanceName :: Text
$sel:notebookInstanceName:StartNotebookInstance' :: StartNotebookInstance -> Text
notebookInstanceName} -> Text
notebookInstanceName) (\s :: StartNotebookInstance
s@StartNotebookInstance' {} Text
a -> StartNotebookInstance
s {$sel:notebookInstanceName:StartNotebookInstance' :: Text
notebookInstanceName = Text
a} :: StartNotebookInstance)
instance Core.AWSRequest StartNotebookInstance where
type
AWSResponse StartNotebookInstance =
StartNotebookInstanceResponse
request :: StartNotebookInstance -> Request StartNotebookInstance
request = Service -> StartNotebookInstance -> Request StartNotebookInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartNotebookInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartNotebookInstance)))
response =
AWSResponse StartNotebookInstance
-> Logger
-> Service
-> Proxy StartNotebookInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartNotebookInstance)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse StartNotebookInstance
StartNotebookInstanceResponse
StartNotebookInstanceResponse'
instance Prelude.Hashable StartNotebookInstance
instance Prelude.NFData StartNotebookInstance
instance Core.ToHeaders StartNotebookInstance where
toHeaders :: StartNotebookInstance -> [Header]
toHeaders =
[Header] -> StartNotebookInstance -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"SageMaker.StartNotebookInstance" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON StartNotebookInstance where
toJSON :: StartNotebookInstance -> Value
toJSON StartNotebookInstance' {Text
notebookInstanceName :: Text
$sel:notebookInstanceName:StartNotebookInstance' :: StartNotebookInstance -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"NotebookInstanceName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
notebookInstanceName
)
]
)
instance Core.ToPath StartNotebookInstance where
toPath :: StartNotebookInstance -> ByteString
toPath = ByteString -> StartNotebookInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartNotebookInstance where
toQuery :: StartNotebookInstance -> QueryString
toQuery = QueryString -> StartNotebookInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartNotebookInstanceResponse = StartNotebookInstanceResponse'
{
}
deriving (StartNotebookInstanceResponse
-> StartNotebookInstanceResponse -> Bool
(StartNotebookInstanceResponse
-> StartNotebookInstanceResponse -> Bool)
-> (StartNotebookInstanceResponse
-> StartNotebookInstanceResponse -> Bool)
-> Eq StartNotebookInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartNotebookInstanceResponse
-> StartNotebookInstanceResponse -> Bool
$c/= :: StartNotebookInstanceResponse
-> StartNotebookInstanceResponse -> Bool
== :: StartNotebookInstanceResponse
-> StartNotebookInstanceResponse -> Bool
$c== :: StartNotebookInstanceResponse
-> StartNotebookInstanceResponse -> Bool
Prelude.Eq, ReadPrec [StartNotebookInstanceResponse]
ReadPrec StartNotebookInstanceResponse
Int -> ReadS StartNotebookInstanceResponse
ReadS [StartNotebookInstanceResponse]
(Int -> ReadS StartNotebookInstanceResponse)
-> ReadS [StartNotebookInstanceResponse]
-> ReadPrec StartNotebookInstanceResponse
-> ReadPrec [StartNotebookInstanceResponse]
-> Read StartNotebookInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartNotebookInstanceResponse]
$creadListPrec :: ReadPrec [StartNotebookInstanceResponse]
readPrec :: ReadPrec StartNotebookInstanceResponse
$creadPrec :: ReadPrec StartNotebookInstanceResponse
readList :: ReadS [StartNotebookInstanceResponse]
$creadList :: ReadS [StartNotebookInstanceResponse]
readsPrec :: Int -> ReadS StartNotebookInstanceResponse
$creadsPrec :: Int -> ReadS StartNotebookInstanceResponse
Prelude.Read, Int -> StartNotebookInstanceResponse -> ShowS
[StartNotebookInstanceResponse] -> ShowS
StartNotebookInstanceResponse -> String
(Int -> StartNotebookInstanceResponse -> ShowS)
-> (StartNotebookInstanceResponse -> String)
-> ([StartNotebookInstanceResponse] -> ShowS)
-> Show StartNotebookInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartNotebookInstanceResponse] -> ShowS
$cshowList :: [StartNotebookInstanceResponse] -> ShowS
show :: StartNotebookInstanceResponse -> String
$cshow :: StartNotebookInstanceResponse -> String
showsPrec :: Int -> StartNotebookInstanceResponse -> ShowS
$cshowsPrec :: Int -> StartNotebookInstanceResponse -> ShowS
Prelude.Show, (forall x.
StartNotebookInstanceResponse
-> Rep StartNotebookInstanceResponse x)
-> (forall x.
Rep StartNotebookInstanceResponse x
-> StartNotebookInstanceResponse)
-> Generic StartNotebookInstanceResponse
forall x.
Rep StartNotebookInstanceResponse x
-> StartNotebookInstanceResponse
forall x.
StartNotebookInstanceResponse
-> Rep StartNotebookInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartNotebookInstanceResponse x
-> StartNotebookInstanceResponse
$cfrom :: forall x.
StartNotebookInstanceResponse
-> Rep StartNotebookInstanceResponse x
Prelude.Generic)
newStartNotebookInstanceResponse ::
StartNotebookInstanceResponse
newStartNotebookInstanceResponse :: StartNotebookInstanceResponse
newStartNotebookInstanceResponse =
StartNotebookInstanceResponse
StartNotebookInstanceResponse'
instance Prelude.NFData StartNotebookInstanceResponse