{-# 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.FraudDetector.DeleteEvent
(
DeleteEvent (..),
newDeleteEvent,
deleteEvent_deleteAuditHistory,
deleteEvent_eventId,
deleteEvent_eventTypeName,
DeleteEventResponse (..),
newDeleteEventResponse,
deleteEventResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.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 DeleteEvent = DeleteEvent'
{
DeleteEvent -> Maybe Bool
deleteAuditHistory :: Prelude.Maybe Prelude.Bool,
DeleteEvent -> Text
eventId :: Prelude.Text,
DeleteEvent -> Text
eventTypeName :: Prelude.Text
}
deriving (DeleteEvent -> DeleteEvent -> Bool
(DeleteEvent -> DeleteEvent -> Bool)
-> (DeleteEvent -> DeleteEvent -> Bool) -> Eq DeleteEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEvent -> DeleteEvent -> Bool
$c/= :: DeleteEvent -> DeleteEvent -> Bool
== :: DeleteEvent -> DeleteEvent -> Bool
$c== :: DeleteEvent -> DeleteEvent -> Bool
Prelude.Eq, ReadPrec [DeleteEvent]
ReadPrec DeleteEvent
Int -> ReadS DeleteEvent
ReadS [DeleteEvent]
(Int -> ReadS DeleteEvent)
-> ReadS [DeleteEvent]
-> ReadPrec DeleteEvent
-> ReadPrec [DeleteEvent]
-> Read DeleteEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEvent]
$creadListPrec :: ReadPrec [DeleteEvent]
readPrec :: ReadPrec DeleteEvent
$creadPrec :: ReadPrec DeleteEvent
readList :: ReadS [DeleteEvent]
$creadList :: ReadS [DeleteEvent]
readsPrec :: Int -> ReadS DeleteEvent
$creadsPrec :: Int -> ReadS DeleteEvent
Prelude.Read, Int -> DeleteEvent -> ShowS
[DeleteEvent] -> ShowS
DeleteEvent -> String
(Int -> DeleteEvent -> ShowS)
-> (DeleteEvent -> String)
-> ([DeleteEvent] -> ShowS)
-> Show DeleteEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEvent] -> ShowS
$cshowList :: [DeleteEvent] -> ShowS
show :: DeleteEvent -> String
$cshow :: DeleteEvent -> String
showsPrec :: Int -> DeleteEvent -> ShowS
$cshowsPrec :: Int -> DeleteEvent -> ShowS
Prelude.Show, (forall x. DeleteEvent -> Rep DeleteEvent x)
-> (forall x. Rep DeleteEvent x -> DeleteEvent)
-> Generic DeleteEvent
forall x. Rep DeleteEvent x -> DeleteEvent
forall x. DeleteEvent -> Rep DeleteEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteEvent x -> DeleteEvent
$cfrom :: forall x. DeleteEvent -> Rep DeleteEvent x
Prelude.Generic)
newDeleteEvent ::
Prelude.Text ->
Prelude.Text ->
DeleteEvent
newDeleteEvent :: Text -> Text -> DeleteEvent
newDeleteEvent Text
pEventId_ Text
pEventTypeName_ =
DeleteEvent' :: Maybe Bool -> Text -> Text -> DeleteEvent
DeleteEvent'
{ $sel:deleteAuditHistory:DeleteEvent' :: Maybe Bool
deleteAuditHistory = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:eventId:DeleteEvent' :: Text
eventId = Text
pEventId_,
$sel:eventTypeName:DeleteEvent' :: Text
eventTypeName = Text
pEventTypeName_
}
deleteEvent_deleteAuditHistory :: Lens.Lens' DeleteEvent (Prelude.Maybe Prelude.Bool)
deleteEvent_deleteAuditHistory :: (Maybe Bool -> f (Maybe Bool)) -> DeleteEvent -> f DeleteEvent
deleteEvent_deleteAuditHistory = (DeleteEvent -> Maybe Bool)
-> (DeleteEvent -> Maybe Bool -> DeleteEvent)
-> Lens DeleteEvent DeleteEvent (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEvent' {Maybe Bool
deleteAuditHistory :: Maybe Bool
$sel:deleteAuditHistory:DeleteEvent' :: DeleteEvent -> Maybe Bool
deleteAuditHistory} -> Maybe Bool
deleteAuditHistory) (\s :: DeleteEvent
s@DeleteEvent' {} Maybe Bool
a -> DeleteEvent
s {$sel:deleteAuditHistory:DeleteEvent' :: Maybe Bool
deleteAuditHistory = Maybe Bool
a} :: DeleteEvent)
deleteEvent_eventId :: Lens.Lens' DeleteEvent Prelude.Text
deleteEvent_eventId :: (Text -> f Text) -> DeleteEvent -> f DeleteEvent
deleteEvent_eventId = (DeleteEvent -> Text)
-> (DeleteEvent -> Text -> DeleteEvent)
-> Lens DeleteEvent DeleteEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEvent' {Text
eventId :: Text
$sel:eventId:DeleteEvent' :: DeleteEvent -> Text
eventId} -> Text
eventId) (\s :: DeleteEvent
s@DeleteEvent' {} Text
a -> DeleteEvent
s {$sel:eventId:DeleteEvent' :: Text
eventId = Text
a} :: DeleteEvent)
deleteEvent_eventTypeName :: Lens.Lens' DeleteEvent Prelude.Text
deleteEvent_eventTypeName :: (Text -> f Text) -> DeleteEvent -> f DeleteEvent
deleteEvent_eventTypeName = (DeleteEvent -> Text)
-> (DeleteEvent -> Text -> DeleteEvent)
-> Lens DeleteEvent DeleteEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEvent' {Text
eventTypeName :: Text
$sel:eventTypeName:DeleteEvent' :: DeleteEvent -> Text
eventTypeName} -> Text
eventTypeName) (\s :: DeleteEvent
s@DeleteEvent' {} Text
a -> DeleteEvent
s {$sel:eventTypeName:DeleteEvent' :: Text
eventTypeName = Text
a} :: DeleteEvent)
instance Core.AWSRequest DeleteEvent where
type AWSResponse DeleteEvent = DeleteEventResponse
request :: DeleteEvent -> Request DeleteEvent
request = Service -> DeleteEvent -> Request DeleteEvent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteEvent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteEvent)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteEvent))
-> Logger
-> Service
-> Proxy DeleteEvent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteEvent)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteEventResponse
DeleteEventResponse'
(Int -> DeleteEventResponse)
-> Either String Int -> Either String DeleteEventResponse
forall (f :: * -> *) a b. Functor 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 DeleteEvent
instance Prelude.NFData DeleteEvent
instance Core.ToHeaders DeleteEvent where
toHeaders :: DeleteEvent -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteEvent -> 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
"AWSHawksNestServiceFacade.DeleteEvent" ::
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 DeleteEvent where
toJSON :: DeleteEvent -> Value
toJSON DeleteEvent' {Maybe Bool
Text
eventTypeName :: Text
eventId :: Text
deleteAuditHistory :: Maybe Bool
$sel:eventTypeName:DeleteEvent' :: DeleteEvent -> Text
$sel:eventId:DeleteEvent' :: DeleteEvent -> Text
$sel:deleteAuditHistory:DeleteEvent' :: DeleteEvent -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"deleteAuditHistory" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteAuditHistory,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"eventId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"eventTypeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventTypeName)
]
)
instance Core.ToPath DeleteEvent where
toPath :: DeleteEvent -> ByteString
toPath = ByteString -> DeleteEvent -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteEvent where
toQuery :: DeleteEvent -> QueryString
toQuery = QueryString -> DeleteEvent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteEventResponse = DeleteEventResponse'
{
DeleteEventResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteEventResponse -> DeleteEventResponse -> Bool
(DeleteEventResponse -> DeleteEventResponse -> Bool)
-> (DeleteEventResponse -> DeleteEventResponse -> Bool)
-> Eq DeleteEventResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEventResponse -> DeleteEventResponse -> Bool
$c/= :: DeleteEventResponse -> DeleteEventResponse -> Bool
== :: DeleteEventResponse -> DeleteEventResponse -> Bool
$c== :: DeleteEventResponse -> DeleteEventResponse -> Bool
Prelude.Eq, ReadPrec [DeleteEventResponse]
ReadPrec DeleteEventResponse
Int -> ReadS DeleteEventResponse
ReadS [DeleteEventResponse]
(Int -> ReadS DeleteEventResponse)
-> ReadS [DeleteEventResponse]
-> ReadPrec DeleteEventResponse
-> ReadPrec [DeleteEventResponse]
-> Read DeleteEventResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEventResponse]
$creadListPrec :: ReadPrec [DeleteEventResponse]
readPrec :: ReadPrec DeleteEventResponse
$creadPrec :: ReadPrec DeleteEventResponse
readList :: ReadS [DeleteEventResponse]
$creadList :: ReadS [DeleteEventResponse]
readsPrec :: Int -> ReadS DeleteEventResponse
$creadsPrec :: Int -> ReadS DeleteEventResponse
Prelude.Read, Int -> DeleteEventResponse -> ShowS
[DeleteEventResponse] -> ShowS
DeleteEventResponse -> String
(Int -> DeleteEventResponse -> ShowS)
-> (DeleteEventResponse -> String)
-> ([DeleteEventResponse] -> ShowS)
-> Show DeleteEventResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEventResponse] -> ShowS
$cshowList :: [DeleteEventResponse] -> ShowS
show :: DeleteEventResponse -> String
$cshow :: DeleteEventResponse -> String
showsPrec :: Int -> DeleteEventResponse -> ShowS
$cshowsPrec :: Int -> DeleteEventResponse -> ShowS
Prelude.Show, (forall x. DeleteEventResponse -> Rep DeleteEventResponse x)
-> (forall x. Rep DeleteEventResponse x -> DeleteEventResponse)
-> Generic DeleteEventResponse
forall x. Rep DeleteEventResponse x -> DeleteEventResponse
forall x. DeleteEventResponse -> Rep DeleteEventResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteEventResponse x -> DeleteEventResponse
$cfrom :: forall x. DeleteEventResponse -> Rep DeleteEventResponse x
Prelude.Generic)
newDeleteEventResponse ::
Prelude.Int ->
DeleteEventResponse
newDeleteEventResponse :: Int -> DeleteEventResponse
newDeleteEventResponse Int
pHttpStatus_ =
DeleteEventResponse' :: Int -> DeleteEventResponse
DeleteEventResponse' {$sel:httpStatus:DeleteEventResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteEventResponse_httpStatus :: Lens.Lens' DeleteEventResponse Prelude.Int
deleteEventResponse_httpStatus :: (Int -> f Int) -> DeleteEventResponse -> f DeleteEventResponse
deleteEventResponse_httpStatus = (DeleteEventResponse -> Int)
-> (DeleteEventResponse -> Int -> DeleteEventResponse)
-> Lens DeleteEventResponse DeleteEventResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEventResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteEventResponse' :: DeleteEventResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteEventResponse
s@DeleteEventResponse' {} Int
a -> DeleteEventResponse
s {$sel:httpStatus:DeleteEventResponse' :: Int
httpStatus = Int
a} :: DeleteEventResponse)
instance Prelude.NFData DeleteEventResponse