{-# 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.Inspector.UnsubscribeFromEvent
(
UnsubscribeFromEvent (..),
newUnsubscribeFromEvent,
unsubscribeFromEvent_resourceArn,
unsubscribeFromEvent_event,
unsubscribeFromEvent_topicArn,
UnsubscribeFromEventResponse (..),
newUnsubscribeFromEventResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UnsubscribeFromEvent = UnsubscribeFromEvent'
{
UnsubscribeFromEvent -> Text
resourceArn :: Prelude.Text,
UnsubscribeFromEvent -> InspectorEvent
event :: InspectorEvent,
UnsubscribeFromEvent -> Text
topicArn :: Prelude.Text
}
deriving (UnsubscribeFromEvent -> UnsubscribeFromEvent -> Bool
(UnsubscribeFromEvent -> UnsubscribeFromEvent -> Bool)
-> (UnsubscribeFromEvent -> UnsubscribeFromEvent -> Bool)
-> Eq UnsubscribeFromEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnsubscribeFromEvent -> UnsubscribeFromEvent -> Bool
$c/= :: UnsubscribeFromEvent -> UnsubscribeFromEvent -> Bool
== :: UnsubscribeFromEvent -> UnsubscribeFromEvent -> Bool
$c== :: UnsubscribeFromEvent -> UnsubscribeFromEvent -> Bool
Prelude.Eq, ReadPrec [UnsubscribeFromEvent]
ReadPrec UnsubscribeFromEvent
Int -> ReadS UnsubscribeFromEvent
ReadS [UnsubscribeFromEvent]
(Int -> ReadS UnsubscribeFromEvent)
-> ReadS [UnsubscribeFromEvent]
-> ReadPrec UnsubscribeFromEvent
-> ReadPrec [UnsubscribeFromEvent]
-> Read UnsubscribeFromEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnsubscribeFromEvent]
$creadListPrec :: ReadPrec [UnsubscribeFromEvent]
readPrec :: ReadPrec UnsubscribeFromEvent
$creadPrec :: ReadPrec UnsubscribeFromEvent
readList :: ReadS [UnsubscribeFromEvent]
$creadList :: ReadS [UnsubscribeFromEvent]
readsPrec :: Int -> ReadS UnsubscribeFromEvent
$creadsPrec :: Int -> ReadS UnsubscribeFromEvent
Prelude.Read, Int -> UnsubscribeFromEvent -> ShowS
[UnsubscribeFromEvent] -> ShowS
UnsubscribeFromEvent -> String
(Int -> UnsubscribeFromEvent -> ShowS)
-> (UnsubscribeFromEvent -> String)
-> ([UnsubscribeFromEvent] -> ShowS)
-> Show UnsubscribeFromEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnsubscribeFromEvent] -> ShowS
$cshowList :: [UnsubscribeFromEvent] -> ShowS
show :: UnsubscribeFromEvent -> String
$cshow :: UnsubscribeFromEvent -> String
showsPrec :: Int -> UnsubscribeFromEvent -> ShowS
$cshowsPrec :: Int -> UnsubscribeFromEvent -> ShowS
Prelude.Show, (forall x. UnsubscribeFromEvent -> Rep UnsubscribeFromEvent x)
-> (forall x. Rep UnsubscribeFromEvent x -> UnsubscribeFromEvent)
-> Generic UnsubscribeFromEvent
forall x. Rep UnsubscribeFromEvent x -> UnsubscribeFromEvent
forall x. UnsubscribeFromEvent -> Rep UnsubscribeFromEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnsubscribeFromEvent x -> UnsubscribeFromEvent
$cfrom :: forall x. UnsubscribeFromEvent -> Rep UnsubscribeFromEvent x
Prelude.Generic)
newUnsubscribeFromEvent ::
Prelude.Text ->
InspectorEvent ->
Prelude.Text ->
UnsubscribeFromEvent
newUnsubscribeFromEvent :: Text -> InspectorEvent -> Text -> UnsubscribeFromEvent
newUnsubscribeFromEvent
Text
pResourceArn_
InspectorEvent
pEvent_
Text
pTopicArn_ =
UnsubscribeFromEvent' :: Text -> InspectorEvent -> Text -> UnsubscribeFromEvent
UnsubscribeFromEvent'
{ $sel:resourceArn:UnsubscribeFromEvent' :: Text
resourceArn = Text
pResourceArn_,
$sel:event:UnsubscribeFromEvent' :: InspectorEvent
event = InspectorEvent
pEvent_,
$sel:topicArn:UnsubscribeFromEvent' :: Text
topicArn = Text
pTopicArn_
}
unsubscribeFromEvent_resourceArn :: Lens.Lens' UnsubscribeFromEvent Prelude.Text
unsubscribeFromEvent_resourceArn :: (Text -> f Text) -> UnsubscribeFromEvent -> f UnsubscribeFromEvent
unsubscribeFromEvent_resourceArn = (UnsubscribeFromEvent -> Text)
-> (UnsubscribeFromEvent -> Text -> UnsubscribeFromEvent)
-> Lens UnsubscribeFromEvent UnsubscribeFromEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsubscribeFromEvent' {Text
resourceArn :: Text
$sel:resourceArn:UnsubscribeFromEvent' :: UnsubscribeFromEvent -> Text
resourceArn} -> Text
resourceArn) (\s :: UnsubscribeFromEvent
s@UnsubscribeFromEvent' {} Text
a -> UnsubscribeFromEvent
s {$sel:resourceArn:UnsubscribeFromEvent' :: Text
resourceArn = Text
a} :: UnsubscribeFromEvent)
unsubscribeFromEvent_event :: Lens.Lens' UnsubscribeFromEvent InspectorEvent
unsubscribeFromEvent_event :: (InspectorEvent -> f InspectorEvent)
-> UnsubscribeFromEvent -> f UnsubscribeFromEvent
unsubscribeFromEvent_event = (UnsubscribeFromEvent -> InspectorEvent)
-> (UnsubscribeFromEvent -> InspectorEvent -> UnsubscribeFromEvent)
-> Lens
UnsubscribeFromEvent
UnsubscribeFromEvent
InspectorEvent
InspectorEvent
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsubscribeFromEvent' {InspectorEvent
event :: InspectorEvent
$sel:event:UnsubscribeFromEvent' :: UnsubscribeFromEvent -> InspectorEvent
event} -> InspectorEvent
event) (\s :: UnsubscribeFromEvent
s@UnsubscribeFromEvent' {} InspectorEvent
a -> UnsubscribeFromEvent
s {$sel:event:UnsubscribeFromEvent' :: InspectorEvent
event = InspectorEvent
a} :: UnsubscribeFromEvent)
unsubscribeFromEvent_topicArn :: Lens.Lens' UnsubscribeFromEvent Prelude.Text
unsubscribeFromEvent_topicArn :: (Text -> f Text) -> UnsubscribeFromEvent -> f UnsubscribeFromEvent
unsubscribeFromEvent_topicArn = (UnsubscribeFromEvent -> Text)
-> (UnsubscribeFromEvent -> Text -> UnsubscribeFromEvent)
-> Lens UnsubscribeFromEvent UnsubscribeFromEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsubscribeFromEvent' {Text
topicArn :: Text
$sel:topicArn:UnsubscribeFromEvent' :: UnsubscribeFromEvent -> Text
topicArn} -> Text
topicArn) (\s :: UnsubscribeFromEvent
s@UnsubscribeFromEvent' {} Text
a -> UnsubscribeFromEvent
s {$sel:topicArn:UnsubscribeFromEvent' :: Text
topicArn = Text
a} :: UnsubscribeFromEvent)
instance Core.AWSRequest UnsubscribeFromEvent where
type
AWSResponse UnsubscribeFromEvent =
UnsubscribeFromEventResponse
request :: UnsubscribeFromEvent -> Request UnsubscribeFromEvent
request = Service -> UnsubscribeFromEvent -> Request UnsubscribeFromEvent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UnsubscribeFromEvent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UnsubscribeFromEvent)))
response =
AWSResponse UnsubscribeFromEvent
-> Logger
-> Service
-> Proxy UnsubscribeFromEvent
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UnsubscribeFromEvent)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UnsubscribeFromEvent
UnsubscribeFromEventResponse
UnsubscribeFromEventResponse'
instance Prelude.Hashable UnsubscribeFromEvent
instance Prelude.NFData UnsubscribeFromEvent
instance Core.ToHeaders UnsubscribeFromEvent where
toHeaders :: UnsubscribeFromEvent -> [Header]
toHeaders =
[Header] -> UnsubscribeFromEvent -> [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
"InspectorService.UnsubscribeFromEvent" ::
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 UnsubscribeFromEvent where
toJSON :: UnsubscribeFromEvent -> Value
toJSON UnsubscribeFromEvent' {Text
InspectorEvent
topicArn :: Text
event :: InspectorEvent
resourceArn :: Text
$sel:topicArn:UnsubscribeFromEvent' :: UnsubscribeFromEvent -> Text
$sel:event:UnsubscribeFromEvent' :: UnsubscribeFromEvent -> InspectorEvent
$sel:resourceArn:UnsubscribeFromEvent' :: UnsubscribeFromEvent -> 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
"resourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"event" Text -> InspectorEvent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InspectorEvent
event),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"topicArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
topicArn)
]
)
instance Core.ToPath UnsubscribeFromEvent where
toPath :: UnsubscribeFromEvent -> ByteString
toPath = ByteString -> UnsubscribeFromEvent -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UnsubscribeFromEvent where
toQuery :: UnsubscribeFromEvent -> QueryString
toQuery = QueryString -> UnsubscribeFromEvent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UnsubscribeFromEventResponse = UnsubscribeFromEventResponse'
{
}
deriving (UnsubscribeFromEventResponse
-> UnsubscribeFromEventResponse -> Bool
(UnsubscribeFromEventResponse
-> UnsubscribeFromEventResponse -> Bool)
-> (UnsubscribeFromEventResponse
-> UnsubscribeFromEventResponse -> Bool)
-> Eq UnsubscribeFromEventResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnsubscribeFromEventResponse
-> UnsubscribeFromEventResponse -> Bool
$c/= :: UnsubscribeFromEventResponse
-> UnsubscribeFromEventResponse -> Bool
== :: UnsubscribeFromEventResponse
-> UnsubscribeFromEventResponse -> Bool
$c== :: UnsubscribeFromEventResponse
-> UnsubscribeFromEventResponse -> Bool
Prelude.Eq, ReadPrec [UnsubscribeFromEventResponse]
ReadPrec UnsubscribeFromEventResponse
Int -> ReadS UnsubscribeFromEventResponse
ReadS [UnsubscribeFromEventResponse]
(Int -> ReadS UnsubscribeFromEventResponse)
-> ReadS [UnsubscribeFromEventResponse]
-> ReadPrec UnsubscribeFromEventResponse
-> ReadPrec [UnsubscribeFromEventResponse]
-> Read UnsubscribeFromEventResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnsubscribeFromEventResponse]
$creadListPrec :: ReadPrec [UnsubscribeFromEventResponse]
readPrec :: ReadPrec UnsubscribeFromEventResponse
$creadPrec :: ReadPrec UnsubscribeFromEventResponse
readList :: ReadS [UnsubscribeFromEventResponse]
$creadList :: ReadS [UnsubscribeFromEventResponse]
readsPrec :: Int -> ReadS UnsubscribeFromEventResponse
$creadsPrec :: Int -> ReadS UnsubscribeFromEventResponse
Prelude.Read, Int -> UnsubscribeFromEventResponse -> ShowS
[UnsubscribeFromEventResponse] -> ShowS
UnsubscribeFromEventResponse -> String
(Int -> UnsubscribeFromEventResponse -> ShowS)
-> (UnsubscribeFromEventResponse -> String)
-> ([UnsubscribeFromEventResponse] -> ShowS)
-> Show UnsubscribeFromEventResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnsubscribeFromEventResponse] -> ShowS
$cshowList :: [UnsubscribeFromEventResponse] -> ShowS
show :: UnsubscribeFromEventResponse -> String
$cshow :: UnsubscribeFromEventResponse -> String
showsPrec :: Int -> UnsubscribeFromEventResponse -> ShowS
$cshowsPrec :: Int -> UnsubscribeFromEventResponse -> ShowS
Prelude.Show, (forall x.
UnsubscribeFromEventResponse -> Rep UnsubscribeFromEventResponse x)
-> (forall x.
Rep UnsubscribeFromEventResponse x -> UnsubscribeFromEventResponse)
-> Generic UnsubscribeFromEventResponse
forall x.
Rep UnsubscribeFromEventResponse x -> UnsubscribeFromEventResponse
forall x.
UnsubscribeFromEventResponse -> Rep UnsubscribeFromEventResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UnsubscribeFromEventResponse x -> UnsubscribeFromEventResponse
$cfrom :: forall x.
UnsubscribeFromEventResponse -> Rep UnsubscribeFromEventResponse x
Prelude.Generic)
newUnsubscribeFromEventResponse ::
UnsubscribeFromEventResponse
newUnsubscribeFromEventResponse :: UnsubscribeFromEventResponse
newUnsubscribeFromEventResponse =
UnsubscribeFromEventResponse
UnsubscribeFromEventResponse'
instance Prelude.NFData UnsubscribeFromEventResponse