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