{-# 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.MemoryDb.DeleteParameterGroup
(
DeleteParameterGroup (..),
newDeleteParameterGroup,
deleteParameterGroup_parameterGroupName,
DeleteParameterGroupResponse (..),
newDeleteParameterGroupResponse,
deleteParameterGroupResponse_parameterGroup,
deleteParameterGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteParameterGroup = DeleteParameterGroup'
{
DeleteParameterGroup -> Text
parameterGroupName :: Prelude.Text
}
deriving (DeleteParameterGroup -> DeleteParameterGroup -> Bool
(DeleteParameterGroup -> DeleteParameterGroup -> Bool)
-> (DeleteParameterGroup -> DeleteParameterGroup -> Bool)
-> Eq DeleteParameterGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteParameterGroup -> DeleteParameterGroup -> Bool
$c/= :: DeleteParameterGroup -> DeleteParameterGroup -> Bool
== :: DeleteParameterGroup -> DeleteParameterGroup -> Bool
$c== :: DeleteParameterGroup -> DeleteParameterGroup -> Bool
Prelude.Eq, ReadPrec [DeleteParameterGroup]
ReadPrec DeleteParameterGroup
Int -> ReadS DeleteParameterGroup
ReadS [DeleteParameterGroup]
(Int -> ReadS DeleteParameterGroup)
-> ReadS [DeleteParameterGroup]
-> ReadPrec DeleteParameterGroup
-> ReadPrec [DeleteParameterGroup]
-> Read DeleteParameterGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteParameterGroup]
$creadListPrec :: ReadPrec [DeleteParameterGroup]
readPrec :: ReadPrec DeleteParameterGroup
$creadPrec :: ReadPrec DeleteParameterGroup
readList :: ReadS [DeleteParameterGroup]
$creadList :: ReadS [DeleteParameterGroup]
readsPrec :: Int -> ReadS DeleteParameterGroup
$creadsPrec :: Int -> ReadS DeleteParameterGroup
Prelude.Read, Int -> DeleteParameterGroup -> ShowS
[DeleteParameterGroup] -> ShowS
DeleteParameterGroup -> String
(Int -> DeleteParameterGroup -> ShowS)
-> (DeleteParameterGroup -> String)
-> ([DeleteParameterGroup] -> ShowS)
-> Show DeleteParameterGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteParameterGroup] -> ShowS
$cshowList :: [DeleteParameterGroup] -> ShowS
show :: DeleteParameterGroup -> String
$cshow :: DeleteParameterGroup -> String
showsPrec :: Int -> DeleteParameterGroup -> ShowS
$cshowsPrec :: Int -> DeleteParameterGroup -> ShowS
Prelude.Show, (forall x. DeleteParameterGroup -> Rep DeleteParameterGroup x)
-> (forall x. Rep DeleteParameterGroup x -> DeleteParameterGroup)
-> Generic DeleteParameterGroup
forall x. Rep DeleteParameterGroup x -> DeleteParameterGroup
forall x. DeleteParameterGroup -> Rep DeleteParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteParameterGroup x -> DeleteParameterGroup
$cfrom :: forall x. DeleteParameterGroup -> Rep DeleteParameterGroup x
Prelude.Generic)
newDeleteParameterGroup ::
Prelude.Text ->
DeleteParameterGroup
newDeleteParameterGroup :: Text -> DeleteParameterGroup
newDeleteParameterGroup Text
pParameterGroupName_ =
DeleteParameterGroup' :: Text -> DeleteParameterGroup
DeleteParameterGroup'
{ $sel:parameterGroupName:DeleteParameterGroup' :: Text
parameterGroupName =
Text
pParameterGroupName_
}
deleteParameterGroup_parameterGroupName :: Lens.Lens' DeleteParameterGroup Prelude.Text
deleteParameterGroup_parameterGroupName :: (Text -> f Text) -> DeleteParameterGroup -> f DeleteParameterGroup
deleteParameterGroup_parameterGroupName = (DeleteParameterGroup -> Text)
-> (DeleteParameterGroup -> Text -> DeleteParameterGroup)
-> Lens DeleteParameterGroup DeleteParameterGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteParameterGroup' {Text
parameterGroupName :: Text
$sel:parameterGroupName:DeleteParameterGroup' :: DeleteParameterGroup -> Text
parameterGroupName} -> Text
parameterGroupName) (\s :: DeleteParameterGroup
s@DeleteParameterGroup' {} Text
a -> DeleteParameterGroup
s {$sel:parameterGroupName:DeleteParameterGroup' :: Text
parameterGroupName = Text
a} :: DeleteParameterGroup)
instance Core.AWSRequest DeleteParameterGroup where
type
AWSResponse DeleteParameterGroup =
DeleteParameterGroupResponse
request :: DeleteParameterGroup -> Request DeleteParameterGroup
request = Service -> DeleteParameterGroup -> Request DeleteParameterGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteParameterGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteParameterGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteParameterGroup))
-> Logger
-> Service
-> Proxy DeleteParameterGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteParameterGroup)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe ParameterGroup -> Int -> DeleteParameterGroupResponse
DeleteParameterGroupResponse'
(Maybe ParameterGroup -> Int -> DeleteParameterGroupResponse)
-> Either String (Maybe ParameterGroup)
-> Either String (Int -> DeleteParameterGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ParameterGroup)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ParameterGroup")
Either String (Int -> DeleteParameterGroupResponse)
-> Either String Int -> Either String DeleteParameterGroupResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteParameterGroup
instance Prelude.NFData DeleteParameterGroup
instance Core.ToHeaders DeleteParameterGroup where
toHeaders :: DeleteParameterGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteParameterGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonMemoryDB.DeleteParameterGroup" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteParameterGroup where
toJSON :: DeleteParameterGroup -> Value
toJSON DeleteParameterGroup' {Text
parameterGroupName :: Text
$sel:parameterGroupName:DeleteParameterGroup' :: DeleteParameterGroup -> 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
"ParameterGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
parameterGroupName)
]
)
instance Core.ToPath DeleteParameterGroup where
toPath :: DeleteParameterGroup -> ByteString
toPath = ByteString -> DeleteParameterGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteParameterGroup where
toQuery :: DeleteParameterGroup -> QueryString
toQuery = QueryString -> DeleteParameterGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteParameterGroupResponse = DeleteParameterGroupResponse'
{
DeleteParameterGroupResponse -> Maybe ParameterGroup
parameterGroup :: Prelude.Maybe ParameterGroup,
DeleteParameterGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteParameterGroupResponse
-> DeleteParameterGroupResponse -> Bool
(DeleteParameterGroupResponse
-> DeleteParameterGroupResponse -> Bool)
-> (DeleteParameterGroupResponse
-> DeleteParameterGroupResponse -> Bool)
-> Eq DeleteParameterGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteParameterGroupResponse
-> DeleteParameterGroupResponse -> Bool
$c/= :: DeleteParameterGroupResponse
-> DeleteParameterGroupResponse -> Bool
== :: DeleteParameterGroupResponse
-> DeleteParameterGroupResponse -> Bool
$c== :: DeleteParameterGroupResponse
-> DeleteParameterGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteParameterGroupResponse]
ReadPrec DeleteParameterGroupResponse
Int -> ReadS DeleteParameterGroupResponse
ReadS [DeleteParameterGroupResponse]
(Int -> ReadS DeleteParameterGroupResponse)
-> ReadS [DeleteParameterGroupResponse]
-> ReadPrec DeleteParameterGroupResponse
-> ReadPrec [DeleteParameterGroupResponse]
-> Read DeleteParameterGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteParameterGroupResponse]
$creadListPrec :: ReadPrec [DeleteParameterGroupResponse]
readPrec :: ReadPrec DeleteParameterGroupResponse
$creadPrec :: ReadPrec DeleteParameterGroupResponse
readList :: ReadS [DeleteParameterGroupResponse]
$creadList :: ReadS [DeleteParameterGroupResponse]
readsPrec :: Int -> ReadS DeleteParameterGroupResponse
$creadsPrec :: Int -> ReadS DeleteParameterGroupResponse
Prelude.Read, Int -> DeleteParameterGroupResponse -> ShowS
[DeleteParameterGroupResponse] -> ShowS
DeleteParameterGroupResponse -> String
(Int -> DeleteParameterGroupResponse -> ShowS)
-> (DeleteParameterGroupResponse -> String)
-> ([DeleteParameterGroupResponse] -> ShowS)
-> Show DeleteParameterGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteParameterGroupResponse] -> ShowS
$cshowList :: [DeleteParameterGroupResponse] -> ShowS
show :: DeleteParameterGroupResponse -> String
$cshow :: DeleteParameterGroupResponse -> String
showsPrec :: Int -> DeleteParameterGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteParameterGroupResponse -> ShowS
Prelude.Show, (forall x.
DeleteParameterGroupResponse -> Rep DeleteParameterGroupResponse x)
-> (forall x.
Rep DeleteParameterGroupResponse x -> DeleteParameterGroupResponse)
-> Generic DeleteParameterGroupResponse
forall x.
Rep DeleteParameterGroupResponse x -> DeleteParameterGroupResponse
forall x.
DeleteParameterGroupResponse -> Rep DeleteParameterGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteParameterGroupResponse x -> DeleteParameterGroupResponse
$cfrom :: forall x.
DeleteParameterGroupResponse -> Rep DeleteParameterGroupResponse x
Prelude.Generic)
newDeleteParameterGroupResponse ::
Prelude.Int ->
DeleteParameterGroupResponse
newDeleteParameterGroupResponse :: Int -> DeleteParameterGroupResponse
newDeleteParameterGroupResponse Int
pHttpStatus_ =
DeleteParameterGroupResponse' :: Maybe ParameterGroup -> Int -> DeleteParameterGroupResponse
DeleteParameterGroupResponse'
{ $sel:parameterGroup:DeleteParameterGroupResponse' :: Maybe ParameterGroup
parameterGroup =
Maybe ParameterGroup
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteParameterGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteParameterGroupResponse_parameterGroup :: Lens.Lens' DeleteParameterGroupResponse (Prelude.Maybe ParameterGroup)
deleteParameterGroupResponse_parameterGroup :: (Maybe ParameterGroup -> f (Maybe ParameterGroup))
-> DeleteParameterGroupResponse -> f DeleteParameterGroupResponse
deleteParameterGroupResponse_parameterGroup = (DeleteParameterGroupResponse -> Maybe ParameterGroup)
-> (DeleteParameterGroupResponse
-> Maybe ParameterGroup -> DeleteParameterGroupResponse)
-> Lens
DeleteParameterGroupResponse
DeleteParameterGroupResponse
(Maybe ParameterGroup)
(Maybe ParameterGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteParameterGroupResponse' {Maybe ParameterGroup
parameterGroup :: Maybe ParameterGroup
$sel:parameterGroup:DeleteParameterGroupResponse' :: DeleteParameterGroupResponse -> Maybe ParameterGroup
parameterGroup} -> Maybe ParameterGroup
parameterGroup) (\s :: DeleteParameterGroupResponse
s@DeleteParameterGroupResponse' {} Maybe ParameterGroup
a -> DeleteParameterGroupResponse
s {$sel:parameterGroup:DeleteParameterGroupResponse' :: Maybe ParameterGroup
parameterGroup = Maybe ParameterGroup
a} :: DeleteParameterGroupResponse)
deleteParameterGroupResponse_httpStatus :: Lens.Lens' DeleteParameterGroupResponse Prelude.Int
deleteParameterGroupResponse_httpStatus :: (Int -> f Int)
-> DeleteParameterGroupResponse -> f DeleteParameterGroupResponse
deleteParameterGroupResponse_httpStatus = (DeleteParameterGroupResponse -> Int)
-> (DeleteParameterGroupResponse
-> Int -> DeleteParameterGroupResponse)
-> Lens
DeleteParameterGroupResponse DeleteParameterGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteParameterGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteParameterGroupResponse' :: DeleteParameterGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteParameterGroupResponse
s@DeleteParameterGroupResponse' {} Int
a -> DeleteParameterGroupResponse
s {$sel:httpStatus:DeleteParameterGroupResponse' :: Int
httpStatus = Int
a} :: DeleteParameterGroupResponse)
instance Prelude.NFData DeleteParameterGroupResponse