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