{-# 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.StopNotebookInstance
(
StopNotebookInstance (..),
newStopNotebookInstance,
stopNotebookInstance_notebookInstanceName,
StopNotebookInstanceResponse (..),
newStopNotebookInstanceResponse,
)
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 StopNotebookInstance = StopNotebookInstance'
{
StopNotebookInstance -> Text
notebookInstanceName :: Prelude.Text
}
deriving (StopNotebookInstance -> StopNotebookInstance -> Bool
(StopNotebookInstance -> StopNotebookInstance -> Bool)
-> (StopNotebookInstance -> StopNotebookInstance -> Bool)
-> Eq StopNotebookInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopNotebookInstance -> StopNotebookInstance -> Bool
$c/= :: StopNotebookInstance -> StopNotebookInstance -> Bool
== :: StopNotebookInstance -> StopNotebookInstance -> Bool
$c== :: StopNotebookInstance -> StopNotebookInstance -> Bool
Prelude.Eq, ReadPrec [StopNotebookInstance]
ReadPrec StopNotebookInstance
Int -> ReadS StopNotebookInstance
ReadS [StopNotebookInstance]
(Int -> ReadS StopNotebookInstance)
-> ReadS [StopNotebookInstance]
-> ReadPrec StopNotebookInstance
-> ReadPrec [StopNotebookInstance]
-> Read StopNotebookInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopNotebookInstance]
$creadListPrec :: ReadPrec [StopNotebookInstance]
readPrec :: ReadPrec StopNotebookInstance
$creadPrec :: ReadPrec StopNotebookInstance
readList :: ReadS [StopNotebookInstance]
$creadList :: ReadS [StopNotebookInstance]
readsPrec :: Int -> ReadS StopNotebookInstance
$creadsPrec :: Int -> ReadS StopNotebookInstance
Prelude.Read, Int -> StopNotebookInstance -> ShowS
[StopNotebookInstance] -> ShowS
StopNotebookInstance -> String
(Int -> StopNotebookInstance -> ShowS)
-> (StopNotebookInstance -> String)
-> ([StopNotebookInstance] -> ShowS)
-> Show StopNotebookInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopNotebookInstance] -> ShowS
$cshowList :: [StopNotebookInstance] -> ShowS
show :: StopNotebookInstance -> String
$cshow :: StopNotebookInstance -> String
showsPrec :: Int -> StopNotebookInstance -> ShowS
$cshowsPrec :: Int -> StopNotebookInstance -> ShowS
Prelude.Show, (forall x. StopNotebookInstance -> Rep StopNotebookInstance x)
-> (forall x. Rep StopNotebookInstance x -> StopNotebookInstance)
-> Generic StopNotebookInstance
forall x. Rep StopNotebookInstance x -> StopNotebookInstance
forall x. StopNotebookInstance -> Rep StopNotebookInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopNotebookInstance x -> StopNotebookInstance
$cfrom :: forall x. StopNotebookInstance -> Rep StopNotebookInstance x
Prelude.Generic)
newStopNotebookInstance ::
Prelude.Text ->
StopNotebookInstance
newStopNotebookInstance :: Text -> StopNotebookInstance
newStopNotebookInstance Text
pNotebookInstanceName_ =
StopNotebookInstance' :: Text -> StopNotebookInstance
StopNotebookInstance'
{ $sel:notebookInstanceName:StopNotebookInstance' :: Text
notebookInstanceName =
Text
pNotebookInstanceName_
}
stopNotebookInstance_notebookInstanceName :: Lens.Lens' StopNotebookInstance Prelude.Text
stopNotebookInstance_notebookInstanceName :: (Text -> f Text) -> StopNotebookInstance -> f StopNotebookInstance
stopNotebookInstance_notebookInstanceName = (StopNotebookInstance -> Text)
-> (StopNotebookInstance -> Text -> StopNotebookInstance)
-> Lens StopNotebookInstance StopNotebookInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopNotebookInstance' {Text
notebookInstanceName :: Text
$sel:notebookInstanceName:StopNotebookInstance' :: StopNotebookInstance -> Text
notebookInstanceName} -> Text
notebookInstanceName) (\s :: StopNotebookInstance
s@StopNotebookInstance' {} Text
a -> StopNotebookInstance
s {$sel:notebookInstanceName:StopNotebookInstance' :: Text
notebookInstanceName = Text
a} :: StopNotebookInstance)
instance Core.AWSRequest StopNotebookInstance where
type
AWSResponse StopNotebookInstance =
StopNotebookInstanceResponse
request :: StopNotebookInstance -> Request StopNotebookInstance
request = Service -> StopNotebookInstance -> Request StopNotebookInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopNotebookInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopNotebookInstance)))
response =
AWSResponse StopNotebookInstance
-> Logger
-> Service
-> Proxy StopNotebookInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopNotebookInstance)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse StopNotebookInstance
StopNotebookInstanceResponse
StopNotebookInstanceResponse'
instance Prelude.Hashable StopNotebookInstance
instance Prelude.NFData StopNotebookInstance
instance Core.ToHeaders StopNotebookInstance where
toHeaders :: StopNotebookInstance -> [Header]
toHeaders =
[Header] -> StopNotebookInstance -> [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.StopNotebookInstance" ::
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 StopNotebookInstance where
toJSON :: StopNotebookInstance -> Value
toJSON StopNotebookInstance' {Text
notebookInstanceName :: Text
$sel:notebookInstanceName:StopNotebookInstance' :: StopNotebookInstance -> 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 StopNotebookInstance where
toPath :: StopNotebookInstance -> ByteString
toPath = ByteString -> StopNotebookInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopNotebookInstance where
toQuery :: StopNotebookInstance -> QueryString
toQuery = QueryString -> StopNotebookInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopNotebookInstanceResponse = StopNotebookInstanceResponse'
{
}
deriving (StopNotebookInstanceResponse
-> StopNotebookInstanceResponse -> Bool
(StopNotebookInstanceResponse
-> StopNotebookInstanceResponse -> Bool)
-> (StopNotebookInstanceResponse
-> StopNotebookInstanceResponse -> Bool)
-> Eq StopNotebookInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopNotebookInstanceResponse
-> StopNotebookInstanceResponse -> Bool
$c/= :: StopNotebookInstanceResponse
-> StopNotebookInstanceResponse -> Bool
== :: StopNotebookInstanceResponse
-> StopNotebookInstanceResponse -> Bool
$c== :: StopNotebookInstanceResponse
-> StopNotebookInstanceResponse -> Bool
Prelude.Eq, ReadPrec [StopNotebookInstanceResponse]
ReadPrec StopNotebookInstanceResponse
Int -> ReadS StopNotebookInstanceResponse
ReadS [StopNotebookInstanceResponse]
(Int -> ReadS StopNotebookInstanceResponse)
-> ReadS [StopNotebookInstanceResponse]
-> ReadPrec StopNotebookInstanceResponse
-> ReadPrec [StopNotebookInstanceResponse]
-> Read StopNotebookInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopNotebookInstanceResponse]
$creadListPrec :: ReadPrec [StopNotebookInstanceResponse]
readPrec :: ReadPrec StopNotebookInstanceResponse
$creadPrec :: ReadPrec StopNotebookInstanceResponse
readList :: ReadS [StopNotebookInstanceResponse]
$creadList :: ReadS [StopNotebookInstanceResponse]
readsPrec :: Int -> ReadS StopNotebookInstanceResponse
$creadsPrec :: Int -> ReadS StopNotebookInstanceResponse
Prelude.Read, Int -> StopNotebookInstanceResponse -> ShowS
[StopNotebookInstanceResponse] -> ShowS
StopNotebookInstanceResponse -> String
(Int -> StopNotebookInstanceResponse -> ShowS)
-> (StopNotebookInstanceResponse -> String)
-> ([StopNotebookInstanceResponse] -> ShowS)
-> Show StopNotebookInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopNotebookInstanceResponse] -> ShowS
$cshowList :: [StopNotebookInstanceResponse] -> ShowS
show :: StopNotebookInstanceResponse -> String
$cshow :: StopNotebookInstanceResponse -> String
showsPrec :: Int -> StopNotebookInstanceResponse -> ShowS
$cshowsPrec :: Int -> StopNotebookInstanceResponse -> ShowS
Prelude.Show, (forall x.
StopNotebookInstanceResponse -> Rep StopNotebookInstanceResponse x)
-> (forall x.
Rep StopNotebookInstanceResponse x -> StopNotebookInstanceResponse)
-> Generic StopNotebookInstanceResponse
forall x.
Rep StopNotebookInstanceResponse x -> StopNotebookInstanceResponse
forall x.
StopNotebookInstanceResponse -> Rep StopNotebookInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopNotebookInstanceResponse x -> StopNotebookInstanceResponse
$cfrom :: forall x.
StopNotebookInstanceResponse -> Rep StopNotebookInstanceResponse x
Prelude.Generic)
newStopNotebookInstanceResponse ::
StopNotebookInstanceResponse
newStopNotebookInstanceResponse :: StopNotebookInstanceResponse
newStopNotebookInstanceResponse =
StopNotebookInstanceResponse
StopNotebookInstanceResponse'
instance Prelude.NFData StopNotebookInstanceResponse