{-# 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.UpdateVolume
(
UpdateVolume (..),
newUpdateVolume,
updateVolume_mountPoint,
updateVolume_name,
updateVolume_volumeId,
UpdateVolumeResponse (..),
newUpdateVolumeResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpsWorks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateVolume = UpdateVolume'
{
UpdateVolume -> Maybe Text
mountPoint :: Prelude.Maybe Prelude.Text,
UpdateVolume -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateVolume -> Text
volumeId :: Prelude.Text
}
deriving (UpdateVolume -> UpdateVolume -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateVolume -> UpdateVolume -> Bool
$c/= :: UpdateVolume -> UpdateVolume -> Bool
== :: UpdateVolume -> UpdateVolume -> Bool
$c== :: UpdateVolume -> UpdateVolume -> Bool
Prelude.Eq, ReadPrec [UpdateVolume]
ReadPrec UpdateVolume
Int -> ReadS UpdateVolume
ReadS [UpdateVolume]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateVolume]
$creadListPrec :: ReadPrec [UpdateVolume]
readPrec :: ReadPrec UpdateVolume
$creadPrec :: ReadPrec UpdateVolume
readList :: ReadS [UpdateVolume]
$creadList :: ReadS [UpdateVolume]
readsPrec :: Int -> ReadS UpdateVolume
$creadsPrec :: Int -> ReadS UpdateVolume
Prelude.Read, Int -> UpdateVolume -> ShowS
[UpdateVolume] -> ShowS
UpdateVolume -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateVolume] -> ShowS
$cshowList :: [UpdateVolume] -> ShowS
show :: UpdateVolume -> String
$cshow :: UpdateVolume -> String
showsPrec :: Int -> UpdateVolume -> ShowS
$cshowsPrec :: Int -> UpdateVolume -> ShowS
Prelude.Show, forall x. Rep UpdateVolume x -> UpdateVolume
forall x. UpdateVolume -> Rep UpdateVolume x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateVolume x -> UpdateVolume
$cfrom :: forall x. UpdateVolume -> Rep UpdateVolume x
Prelude.Generic)
newUpdateVolume ::
Prelude.Text ->
UpdateVolume
newUpdateVolume :: Text -> UpdateVolume
newUpdateVolume Text
pVolumeId_ =
UpdateVolume'
{ $sel:mountPoint:UpdateVolume' :: Maybe Text
mountPoint = forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateVolume' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:volumeId:UpdateVolume' :: Text
volumeId = Text
pVolumeId_
}
updateVolume_mountPoint :: Lens.Lens' UpdateVolume (Prelude.Maybe Prelude.Text)
updateVolume_mountPoint :: Lens' UpdateVolume (Maybe Text)
updateVolume_mountPoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVolume' {Maybe Text
mountPoint :: Maybe Text
$sel:mountPoint:UpdateVolume' :: UpdateVolume -> Maybe Text
mountPoint} -> Maybe Text
mountPoint) (\s :: UpdateVolume
s@UpdateVolume' {} Maybe Text
a -> UpdateVolume
s {$sel:mountPoint:UpdateVolume' :: Maybe Text
mountPoint = Maybe Text
a} :: UpdateVolume)
updateVolume_name :: Lens.Lens' UpdateVolume (Prelude.Maybe Prelude.Text)
updateVolume_name :: Lens' UpdateVolume (Maybe Text)
updateVolume_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVolume' {Maybe Text
name :: Maybe Text
$sel:name:UpdateVolume' :: UpdateVolume -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateVolume
s@UpdateVolume' {} Maybe Text
a -> UpdateVolume
s {$sel:name:UpdateVolume' :: Maybe Text
name = Maybe Text
a} :: UpdateVolume)
updateVolume_volumeId :: Lens.Lens' UpdateVolume Prelude.Text
updateVolume_volumeId :: Lens' UpdateVolume Text
updateVolume_volumeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVolume' {Text
volumeId :: Text
$sel:volumeId:UpdateVolume' :: UpdateVolume -> Text
volumeId} -> Text
volumeId) (\s :: UpdateVolume
s@UpdateVolume' {} Text
a -> UpdateVolume
s {$sel:volumeId:UpdateVolume' :: Text
volumeId = Text
a} :: UpdateVolume)
instance Core.AWSRequest UpdateVolume where
type AWSResponse UpdateVolume = UpdateVolumeResponse
request :: (Service -> Service) -> UpdateVolume -> Request UpdateVolume
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 UpdateVolume
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateVolume)))
response = forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UpdateVolumeResponse
UpdateVolumeResponse'
instance Prelude.Hashable UpdateVolume where
hashWithSalt :: Int -> UpdateVolume -> Int
hashWithSalt Int
_salt UpdateVolume' {Maybe Text
Text
volumeId :: Text
name :: Maybe Text
mountPoint :: Maybe Text
$sel:volumeId:UpdateVolume' :: UpdateVolume -> Text
$sel:name:UpdateVolume' :: UpdateVolume -> Maybe Text
$sel:mountPoint:UpdateVolume' :: UpdateVolume -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
mountPoint
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
volumeId
instance Prelude.NFData UpdateVolume where
rnf :: UpdateVolume -> ()
rnf UpdateVolume' {Maybe Text
Text
volumeId :: Text
name :: Maybe Text
mountPoint :: Maybe Text
$sel:volumeId:UpdateVolume' :: UpdateVolume -> Text
$sel:name:UpdateVolume' :: UpdateVolume -> Maybe Text
$sel:mountPoint:UpdateVolume' :: UpdateVolume -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mountPoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
volumeId
instance Data.ToHeaders UpdateVolume where
toHeaders :: UpdateVolume -> [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
"OpsWorks_20130218.UpdateVolume" ::
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 UpdateVolume where
toJSON :: UpdateVolume -> Value
toJSON UpdateVolume' {Maybe Text
Text
volumeId :: Text
name :: Maybe Text
mountPoint :: Maybe Text
$sel:volumeId:UpdateVolume' :: UpdateVolume -> Text
$sel:name:UpdateVolume' :: UpdateVolume -> Maybe Text
$sel:mountPoint:UpdateVolume' :: UpdateVolume -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MountPoint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
mountPoint,
(Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
forall a. a -> Maybe a
Prelude.Just (Key
"VolumeId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
volumeId)
]
)
instance Data.ToPath UpdateVolume where
toPath :: UpdateVolume -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateVolume where
toQuery :: UpdateVolume -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateVolumeResponse = UpdateVolumeResponse'
{
}
deriving (UpdateVolumeResponse -> UpdateVolumeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateVolumeResponse -> UpdateVolumeResponse -> Bool
$c/= :: UpdateVolumeResponse -> UpdateVolumeResponse -> Bool
== :: UpdateVolumeResponse -> UpdateVolumeResponse -> Bool
$c== :: UpdateVolumeResponse -> UpdateVolumeResponse -> Bool
Prelude.Eq, ReadPrec [UpdateVolumeResponse]
ReadPrec UpdateVolumeResponse
Int -> ReadS UpdateVolumeResponse
ReadS [UpdateVolumeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateVolumeResponse]
$creadListPrec :: ReadPrec [UpdateVolumeResponse]
readPrec :: ReadPrec UpdateVolumeResponse
$creadPrec :: ReadPrec UpdateVolumeResponse
readList :: ReadS [UpdateVolumeResponse]
$creadList :: ReadS [UpdateVolumeResponse]
readsPrec :: Int -> ReadS UpdateVolumeResponse
$creadsPrec :: Int -> ReadS UpdateVolumeResponse
Prelude.Read, Int -> UpdateVolumeResponse -> ShowS
[UpdateVolumeResponse] -> ShowS
UpdateVolumeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateVolumeResponse] -> ShowS
$cshowList :: [UpdateVolumeResponse] -> ShowS
show :: UpdateVolumeResponse -> String
$cshow :: UpdateVolumeResponse -> String
showsPrec :: Int -> UpdateVolumeResponse -> ShowS
$cshowsPrec :: Int -> UpdateVolumeResponse -> ShowS
Prelude.Show, forall x. Rep UpdateVolumeResponse x -> UpdateVolumeResponse
forall x. UpdateVolumeResponse -> Rep UpdateVolumeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateVolumeResponse x -> UpdateVolumeResponse
$cfrom :: forall x. UpdateVolumeResponse -> Rep UpdateVolumeResponse x
Prelude.Generic)
newUpdateVolumeResponse ::
UpdateVolumeResponse
newUpdateVolumeResponse :: UpdateVolumeResponse
newUpdateVolumeResponse = UpdateVolumeResponse
UpdateVolumeResponse'
instance Prelude.NFData UpdateVolumeResponse where
rnf :: UpdateVolumeResponse -> ()
rnf UpdateVolumeResponse
_ = ()