{-# 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.CodeGuruProfiler.RemoveNotificationChannel
(
RemoveNotificationChannel (..),
newRemoveNotificationChannel,
removeNotificationChannel_channelId,
removeNotificationChannel_profilingGroupName,
RemoveNotificationChannelResponse (..),
newRemoveNotificationChannelResponse,
removeNotificationChannelResponse_notificationConfiguration,
removeNotificationChannelResponse_httpStatus,
)
where
import Amazonka.CodeGuruProfiler.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RemoveNotificationChannel = RemoveNotificationChannel'
{
RemoveNotificationChannel -> Text
channelId :: Prelude.Text,
RemoveNotificationChannel -> Text
profilingGroupName :: Prelude.Text
}
deriving (RemoveNotificationChannel -> RemoveNotificationChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveNotificationChannel -> RemoveNotificationChannel -> Bool
$c/= :: RemoveNotificationChannel -> RemoveNotificationChannel -> Bool
== :: RemoveNotificationChannel -> RemoveNotificationChannel -> Bool
$c== :: RemoveNotificationChannel -> RemoveNotificationChannel -> Bool
Prelude.Eq, ReadPrec [RemoveNotificationChannel]
ReadPrec RemoveNotificationChannel
Int -> ReadS RemoveNotificationChannel
ReadS [RemoveNotificationChannel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveNotificationChannel]
$creadListPrec :: ReadPrec [RemoveNotificationChannel]
readPrec :: ReadPrec RemoveNotificationChannel
$creadPrec :: ReadPrec RemoveNotificationChannel
readList :: ReadS [RemoveNotificationChannel]
$creadList :: ReadS [RemoveNotificationChannel]
readsPrec :: Int -> ReadS RemoveNotificationChannel
$creadsPrec :: Int -> ReadS RemoveNotificationChannel
Prelude.Read, Int -> RemoveNotificationChannel -> ShowS
[RemoveNotificationChannel] -> ShowS
RemoveNotificationChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveNotificationChannel] -> ShowS
$cshowList :: [RemoveNotificationChannel] -> ShowS
show :: RemoveNotificationChannel -> String
$cshow :: RemoveNotificationChannel -> String
showsPrec :: Int -> RemoveNotificationChannel -> ShowS
$cshowsPrec :: Int -> RemoveNotificationChannel -> ShowS
Prelude.Show, forall x.
Rep RemoveNotificationChannel x -> RemoveNotificationChannel
forall x.
RemoveNotificationChannel -> Rep RemoveNotificationChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveNotificationChannel x -> RemoveNotificationChannel
$cfrom :: forall x.
RemoveNotificationChannel -> Rep RemoveNotificationChannel x
Prelude.Generic)
newRemoveNotificationChannel ::
Prelude.Text ->
Prelude.Text ->
RemoveNotificationChannel
newRemoveNotificationChannel :: Text -> Text -> RemoveNotificationChannel
newRemoveNotificationChannel
Text
pChannelId_
Text
pProfilingGroupName_ =
RemoveNotificationChannel'
{ $sel:channelId:RemoveNotificationChannel' :: Text
channelId = Text
pChannelId_,
$sel:profilingGroupName:RemoveNotificationChannel' :: Text
profilingGroupName = Text
pProfilingGroupName_
}
removeNotificationChannel_channelId :: Lens.Lens' RemoveNotificationChannel Prelude.Text
removeNotificationChannel_channelId :: Lens' RemoveNotificationChannel Text
removeNotificationChannel_channelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveNotificationChannel' {Text
channelId :: Text
$sel:channelId:RemoveNotificationChannel' :: RemoveNotificationChannel -> Text
channelId} -> Text
channelId) (\s :: RemoveNotificationChannel
s@RemoveNotificationChannel' {} Text
a -> RemoveNotificationChannel
s {$sel:channelId:RemoveNotificationChannel' :: Text
channelId = Text
a} :: RemoveNotificationChannel)
removeNotificationChannel_profilingGroupName :: Lens.Lens' RemoveNotificationChannel Prelude.Text
removeNotificationChannel_profilingGroupName :: Lens' RemoveNotificationChannel Text
removeNotificationChannel_profilingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveNotificationChannel' {Text
profilingGroupName :: Text
$sel:profilingGroupName:RemoveNotificationChannel' :: RemoveNotificationChannel -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: RemoveNotificationChannel
s@RemoveNotificationChannel' {} Text
a -> RemoveNotificationChannel
s {$sel:profilingGroupName:RemoveNotificationChannel' :: Text
profilingGroupName = Text
a} :: RemoveNotificationChannel)
instance Core.AWSRequest RemoveNotificationChannel where
type
AWSResponse RemoveNotificationChannel =
RemoveNotificationChannelResponse
request :: (Service -> Service)
-> RemoveNotificationChannel -> Request RemoveNotificationChannel
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy RemoveNotificationChannel
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveNotificationChannel)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe NotificationConfiguration
-> Int -> RemoveNotificationChannelResponse
RemoveNotificationChannelResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"notificationConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable RemoveNotificationChannel where
hashWithSalt :: Int -> RemoveNotificationChannel -> Int
hashWithSalt Int
_salt RemoveNotificationChannel' {Text
profilingGroupName :: Text
channelId :: Text
$sel:profilingGroupName:RemoveNotificationChannel' :: RemoveNotificationChannel -> Text
$sel:channelId:RemoveNotificationChannel' :: RemoveNotificationChannel -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profilingGroupName
instance Prelude.NFData RemoveNotificationChannel where
rnf :: RemoveNotificationChannel -> ()
rnf RemoveNotificationChannel' {Text
profilingGroupName :: Text
channelId :: Text
$sel:profilingGroupName:RemoveNotificationChannel' :: RemoveNotificationChannel -> Text
$sel:channelId:RemoveNotificationChannel' :: RemoveNotificationChannel -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
channelId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profilingGroupName
instance Data.ToHeaders RemoveNotificationChannel where
toHeaders :: RemoveNotificationChannel -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath RemoveNotificationChannel where
toPath :: RemoveNotificationChannel -> ByteString
toPath RemoveNotificationChannel' {Text
profilingGroupName :: Text
channelId :: Text
$sel:profilingGroupName:RemoveNotificationChannel' :: RemoveNotificationChannel -> Text
$sel:channelId:RemoveNotificationChannel' :: RemoveNotificationChannel -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/profilingGroups/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
profilingGroupName,
ByteString
"/notificationConfiguration/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
channelId
]
instance Data.ToQuery RemoveNotificationChannel where
toQuery :: RemoveNotificationChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data RemoveNotificationChannelResponse = RemoveNotificationChannelResponse'
{
RemoveNotificationChannelResponse
-> Maybe NotificationConfiguration
notificationConfiguration :: Prelude.Maybe NotificationConfiguration,
RemoveNotificationChannelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RemoveNotificationChannelResponse
-> RemoveNotificationChannelResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveNotificationChannelResponse
-> RemoveNotificationChannelResponse -> Bool
$c/= :: RemoveNotificationChannelResponse
-> RemoveNotificationChannelResponse -> Bool
== :: RemoveNotificationChannelResponse
-> RemoveNotificationChannelResponse -> Bool
$c== :: RemoveNotificationChannelResponse
-> RemoveNotificationChannelResponse -> Bool
Prelude.Eq, ReadPrec [RemoveNotificationChannelResponse]
ReadPrec RemoveNotificationChannelResponse
Int -> ReadS RemoveNotificationChannelResponse
ReadS [RemoveNotificationChannelResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveNotificationChannelResponse]
$creadListPrec :: ReadPrec [RemoveNotificationChannelResponse]
readPrec :: ReadPrec RemoveNotificationChannelResponse
$creadPrec :: ReadPrec RemoveNotificationChannelResponse
readList :: ReadS [RemoveNotificationChannelResponse]
$creadList :: ReadS [RemoveNotificationChannelResponse]
readsPrec :: Int -> ReadS RemoveNotificationChannelResponse
$creadsPrec :: Int -> ReadS RemoveNotificationChannelResponse
Prelude.Read, Int -> RemoveNotificationChannelResponse -> ShowS
[RemoveNotificationChannelResponse] -> ShowS
RemoveNotificationChannelResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveNotificationChannelResponse] -> ShowS
$cshowList :: [RemoveNotificationChannelResponse] -> ShowS
show :: RemoveNotificationChannelResponse -> String
$cshow :: RemoveNotificationChannelResponse -> String
showsPrec :: Int -> RemoveNotificationChannelResponse -> ShowS
$cshowsPrec :: Int -> RemoveNotificationChannelResponse -> ShowS
Prelude.Show, forall x.
Rep RemoveNotificationChannelResponse x
-> RemoveNotificationChannelResponse
forall x.
RemoveNotificationChannelResponse
-> Rep RemoveNotificationChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveNotificationChannelResponse x
-> RemoveNotificationChannelResponse
$cfrom :: forall x.
RemoveNotificationChannelResponse
-> Rep RemoveNotificationChannelResponse x
Prelude.Generic)
newRemoveNotificationChannelResponse ::
Prelude.Int ->
RemoveNotificationChannelResponse
newRemoveNotificationChannelResponse :: Int -> RemoveNotificationChannelResponse
newRemoveNotificationChannelResponse Int
pHttpStatus_ =
RemoveNotificationChannelResponse'
{ $sel:notificationConfiguration:RemoveNotificationChannelResponse' :: Maybe NotificationConfiguration
notificationConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RemoveNotificationChannelResponse' :: Int
httpStatus = Int
pHttpStatus_
}
removeNotificationChannelResponse_notificationConfiguration :: Lens.Lens' RemoveNotificationChannelResponse (Prelude.Maybe NotificationConfiguration)
removeNotificationChannelResponse_notificationConfiguration :: Lens'
RemoveNotificationChannelResponse (Maybe NotificationConfiguration)
removeNotificationChannelResponse_notificationConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveNotificationChannelResponse' {Maybe NotificationConfiguration
notificationConfiguration :: Maybe NotificationConfiguration
$sel:notificationConfiguration:RemoveNotificationChannelResponse' :: RemoveNotificationChannelResponse
-> Maybe NotificationConfiguration
notificationConfiguration} -> Maybe NotificationConfiguration
notificationConfiguration) (\s :: RemoveNotificationChannelResponse
s@RemoveNotificationChannelResponse' {} Maybe NotificationConfiguration
a -> RemoveNotificationChannelResponse
s {$sel:notificationConfiguration:RemoveNotificationChannelResponse' :: Maybe NotificationConfiguration
notificationConfiguration = Maybe NotificationConfiguration
a} :: RemoveNotificationChannelResponse)
removeNotificationChannelResponse_httpStatus :: Lens.Lens' RemoveNotificationChannelResponse Prelude.Int
removeNotificationChannelResponse_httpStatus :: Lens' RemoveNotificationChannelResponse Int
removeNotificationChannelResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveNotificationChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:RemoveNotificationChannelResponse' :: RemoveNotificationChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RemoveNotificationChannelResponse
s@RemoveNotificationChannelResponse' {} Int
a -> RemoveNotificationChannelResponse
s {$sel:httpStatus:RemoveNotificationChannelResponse' :: Int
httpStatus = Int
a} :: RemoveNotificationChannelResponse)
instance
Prelude.NFData
RemoveNotificationChannelResponse
where
rnf :: RemoveNotificationChannelResponse -> ()
rnf RemoveNotificationChannelResponse' {Int
Maybe NotificationConfiguration
httpStatus :: Int
notificationConfiguration :: Maybe NotificationConfiguration
$sel:httpStatus:RemoveNotificationChannelResponse' :: RemoveNotificationChannelResponse -> Int
$sel:notificationConfiguration:RemoveNotificationChannelResponse' :: RemoveNotificationChannelResponse
-> Maybe NotificationConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe NotificationConfiguration
notificationConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus