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