{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:serverId:StopServer' :: Text
serverId = Text
pServerId_}
stopServer_serverId :: Lens.Lens' StopServer Prelude.Text
stopServer_serverId :: Lens' StopServer Text
stopServer_serverId = 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 :: (Service -> Service) -> StopServer -> Request StopServer
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StopServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopServer)))
response = forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull StopServerResponse
StopServerResponse'
instance Prelude.Hashable StopServer where
hashWithSalt :: Int -> StopServer -> Int
hashWithSalt Int
_salt StopServer' {Text
serverId :: Text
$sel:serverId:StopServer' :: StopServer -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serverId
instance Prelude.NFData StopServer where
rnf :: StopServer -> ()
rnf StopServer' {Text
serverId :: Text
$sel:serverId:StopServer' :: StopServer -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
serverId
instance Data.ToHeaders StopServer where
toHeaders :: StopServer -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# (ByteString
"TransferService.StopServer" :: Prelude.ByteString),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StopServer where
toJSON :: StopServer -> Value
toJSON StopServer' {Text
serverId :: Text
$sel:serverId:StopServer' :: StopServer -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"ServerId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serverId)]
)
instance Data.ToPath StopServer where
toPath :: StopServer -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopServer where
toQuery :: StopServer -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopServerResponse = StopServerResponse'
{
}
deriving (StopServerResponse -> StopServerResponse -> Bool
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]
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
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. 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 where
rnf :: StopServerResponse -> ()
rnf StopServerResponse
_ = ()