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