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