{-# 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.MQ.DeleteBroker
(
DeleteBroker (..),
newDeleteBroker,
deleteBroker_brokerId,
DeleteBrokerResponse (..),
newDeleteBrokerResponse,
deleteBrokerResponse_brokerId,
deleteBrokerResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MQ.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteBroker = DeleteBroker'
{
DeleteBroker -> Text
brokerId :: Prelude.Text
}
deriving (DeleteBroker -> DeleteBroker -> Bool
(DeleteBroker -> DeleteBroker -> Bool)
-> (DeleteBroker -> DeleteBroker -> Bool) -> Eq DeleteBroker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBroker -> DeleteBroker -> Bool
$c/= :: DeleteBroker -> DeleteBroker -> Bool
== :: DeleteBroker -> DeleteBroker -> Bool
$c== :: DeleteBroker -> DeleteBroker -> Bool
Prelude.Eq, ReadPrec [DeleteBroker]
ReadPrec DeleteBroker
Int -> ReadS DeleteBroker
ReadS [DeleteBroker]
(Int -> ReadS DeleteBroker)
-> ReadS [DeleteBroker]
-> ReadPrec DeleteBroker
-> ReadPrec [DeleteBroker]
-> Read DeleteBroker
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBroker]
$creadListPrec :: ReadPrec [DeleteBroker]
readPrec :: ReadPrec DeleteBroker
$creadPrec :: ReadPrec DeleteBroker
readList :: ReadS [DeleteBroker]
$creadList :: ReadS [DeleteBroker]
readsPrec :: Int -> ReadS DeleteBroker
$creadsPrec :: Int -> ReadS DeleteBroker
Prelude.Read, Int -> DeleteBroker -> ShowS
[DeleteBroker] -> ShowS
DeleteBroker -> String
(Int -> DeleteBroker -> ShowS)
-> (DeleteBroker -> String)
-> ([DeleteBroker] -> ShowS)
-> Show DeleteBroker
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBroker] -> ShowS
$cshowList :: [DeleteBroker] -> ShowS
show :: DeleteBroker -> String
$cshow :: DeleteBroker -> String
showsPrec :: Int -> DeleteBroker -> ShowS
$cshowsPrec :: Int -> DeleteBroker -> ShowS
Prelude.Show, (forall x. DeleteBroker -> Rep DeleteBroker x)
-> (forall x. Rep DeleteBroker x -> DeleteBroker)
-> Generic DeleteBroker
forall x. Rep DeleteBroker x -> DeleteBroker
forall x. DeleteBroker -> Rep DeleteBroker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBroker x -> DeleteBroker
$cfrom :: forall x. DeleteBroker -> Rep DeleteBroker x
Prelude.Generic)
newDeleteBroker ::
Prelude.Text ->
DeleteBroker
newDeleteBroker :: Text -> DeleteBroker
newDeleteBroker Text
pBrokerId_ =
DeleteBroker' :: Text -> DeleteBroker
DeleteBroker' {$sel:brokerId:DeleteBroker' :: Text
brokerId = Text
pBrokerId_}
deleteBroker_brokerId :: Lens.Lens' DeleteBroker Prelude.Text
deleteBroker_brokerId :: (Text -> f Text) -> DeleteBroker -> f DeleteBroker
deleteBroker_brokerId = (DeleteBroker -> Text)
-> (DeleteBroker -> Text -> DeleteBroker)
-> Lens DeleteBroker DeleteBroker Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBroker' {Text
brokerId :: Text
$sel:brokerId:DeleteBroker' :: DeleteBroker -> Text
brokerId} -> Text
brokerId) (\s :: DeleteBroker
s@DeleteBroker' {} Text
a -> DeleteBroker
s {$sel:brokerId:DeleteBroker' :: Text
brokerId = Text
a} :: DeleteBroker)
instance Core.AWSRequest DeleteBroker where
type AWSResponse DeleteBroker = DeleteBrokerResponse
request :: DeleteBroker -> Request DeleteBroker
request = Service -> DeleteBroker -> Request DeleteBroker
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteBroker
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteBroker)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteBroker))
-> Logger
-> Service
-> Proxy DeleteBroker
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteBroker)))
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 Text -> Int -> DeleteBrokerResponse
DeleteBrokerResponse'
(Maybe Text -> Int -> DeleteBrokerResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeleteBrokerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"brokerId")
Either String (Int -> DeleteBrokerResponse)
-> Either String Int -> Either String DeleteBrokerResponse
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 DeleteBroker
instance Prelude.NFData DeleteBroker
instance Core.ToHeaders DeleteBroker where
toHeaders :: DeleteBroker -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteBroker -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeleteBroker where
toPath :: DeleteBroker -> ByteString
toPath DeleteBroker' {Text
brokerId :: Text
$sel:brokerId:DeleteBroker' :: DeleteBroker -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/v1/brokers/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
brokerId]
instance Core.ToQuery DeleteBroker where
toQuery :: DeleteBroker -> QueryString
toQuery = QueryString -> DeleteBroker -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteBrokerResponse = DeleteBrokerResponse'
{
DeleteBrokerResponse -> Maybe Text
brokerId :: Prelude.Maybe Prelude.Text,
DeleteBrokerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteBrokerResponse -> DeleteBrokerResponse -> Bool
(DeleteBrokerResponse -> DeleteBrokerResponse -> Bool)
-> (DeleteBrokerResponse -> DeleteBrokerResponse -> Bool)
-> Eq DeleteBrokerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBrokerResponse -> DeleteBrokerResponse -> Bool
$c/= :: DeleteBrokerResponse -> DeleteBrokerResponse -> Bool
== :: DeleteBrokerResponse -> DeleteBrokerResponse -> Bool
$c== :: DeleteBrokerResponse -> DeleteBrokerResponse -> Bool
Prelude.Eq, ReadPrec [DeleteBrokerResponse]
ReadPrec DeleteBrokerResponse
Int -> ReadS DeleteBrokerResponse
ReadS [DeleteBrokerResponse]
(Int -> ReadS DeleteBrokerResponse)
-> ReadS [DeleteBrokerResponse]
-> ReadPrec DeleteBrokerResponse
-> ReadPrec [DeleteBrokerResponse]
-> Read DeleteBrokerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBrokerResponse]
$creadListPrec :: ReadPrec [DeleteBrokerResponse]
readPrec :: ReadPrec DeleteBrokerResponse
$creadPrec :: ReadPrec DeleteBrokerResponse
readList :: ReadS [DeleteBrokerResponse]
$creadList :: ReadS [DeleteBrokerResponse]
readsPrec :: Int -> ReadS DeleteBrokerResponse
$creadsPrec :: Int -> ReadS DeleteBrokerResponse
Prelude.Read, Int -> DeleteBrokerResponse -> ShowS
[DeleteBrokerResponse] -> ShowS
DeleteBrokerResponse -> String
(Int -> DeleteBrokerResponse -> ShowS)
-> (DeleteBrokerResponse -> String)
-> ([DeleteBrokerResponse] -> ShowS)
-> Show DeleteBrokerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBrokerResponse] -> ShowS
$cshowList :: [DeleteBrokerResponse] -> ShowS
show :: DeleteBrokerResponse -> String
$cshow :: DeleteBrokerResponse -> String
showsPrec :: Int -> DeleteBrokerResponse -> ShowS
$cshowsPrec :: Int -> DeleteBrokerResponse -> ShowS
Prelude.Show, (forall x. DeleteBrokerResponse -> Rep DeleteBrokerResponse x)
-> (forall x. Rep DeleteBrokerResponse x -> DeleteBrokerResponse)
-> Generic DeleteBrokerResponse
forall x. Rep DeleteBrokerResponse x -> DeleteBrokerResponse
forall x. DeleteBrokerResponse -> Rep DeleteBrokerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBrokerResponse x -> DeleteBrokerResponse
$cfrom :: forall x. DeleteBrokerResponse -> Rep DeleteBrokerResponse x
Prelude.Generic)
newDeleteBrokerResponse ::
Prelude.Int ->
DeleteBrokerResponse
newDeleteBrokerResponse :: Int -> DeleteBrokerResponse
newDeleteBrokerResponse Int
pHttpStatus_ =
DeleteBrokerResponse' :: Maybe Text -> Int -> DeleteBrokerResponse
DeleteBrokerResponse'
{ $sel:brokerId:DeleteBrokerResponse' :: Maybe Text
brokerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteBrokerResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteBrokerResponse_brokerId :: Lens.Lens' DeleteBrokerResponse (Prelude.Maybe Prelude.Text)
deleteBrokerResponse_brokerId :: (Maybe Text -> f (Maybe Text))
-> DeleteBrokerResponse -> f DeleteBrokerResponse
deleteBrokerResponse_brokerId = (DeleteBrokerResponse -> Maybe Text)
-> (DeleteBrokerResponse -> Maybe Text -> DeleteBrokerResponse)
-> Lens
DeleteBrokerResponse DeleteBrokerResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBrokerResponse' {Maybe Text
brokerId :: Maybe Text
$sel:brokerId:DeleteBrokerResponse' :: DeleteBrokerResponse -> Maybe Text
brokerId} -> Maybe Text
brokerId) (\s :: DeleteBrokerResponse
s@DeleteBrokerResponse' {} Maybe Text
a -> DeleteBrokerResponse
s {$sel:brokerId:DeleteBrokerResponse' :: Maybe Text
brokerId = Maybe Text
a} :: DeleteBrokerResponse)
deleteBrokerResponse_httpStatus :: Lens.Lens' DeleteBrokerResponse Prelude.Int
deleteBrokerResponse_httpStatus :: (Int -> f Int) -> DeleteBrokerResponse -> f DeleteBrokerResponse
deleteBrokerResponse_httpStatus = (DeleteBrokerResponse -> Int)
-> (DeleteBrokerResponse -> Int -> DeleteBrokerResponse)
-> Lens DeleteBrokerResponse DeleteBrokerResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBrokerResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteBrokerResponse' :: DeleteBrokerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteBrokerResponse
s@DeleteBrokerResponse' {} Int
a -> DeleteBrokerResponse
s {$sel:httpStatus:DeleteBrokerResponse' :: Int
httpStatus = Int
a} :: DeleteBrokerResponse)
instance Prelude.NFData DeleteBrokerResponse