{-# 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.UpdateEventLabel
(
UpdateEventLabel (..),
newUpdateEventLabel,
updateEventLabel_eventId,
updateEventLabel_eventTypeName,
updateEventLabel_assignedLabel,
updateEventLabel_labelTimestamp,
UpdateEventLabelResponse (..),
newUpdateEventLabelResponse,
updateEventLabelResponse_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 UpdateEventLabel = UpdateEventLabel'
{
UpdateEventLabel -> Text
eventId :: Prelude.Text,
UpdateEventLabel -> Text
eventTypeName :: Prelude.Text,
UpdateEventLabel -> Text
assignedLabel :: Prelude.Text,
UpdateEventLabel -> Text
labelTimestamp :: Prelude.Text
}
deriving (UpdateEventLabel -> UpdateEventLabel -> Bool
(UpdateEventLabel -> UpdateEventLabel -> Bool)
-> (UpdateEventLabel -> UpdateEventLabel -> Bool)
-> Eq UpdateEventLabel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEventLabel -> UpdateEventLabel -> Bool
$c/= :: UpdateEventLabel -> UpdateEventLabel -> Bool
== :: UpdateEventLabel -> UpdateEventLabel -> Bool
$c== :: UpdateEventLabel -> UpdateEventLabel -> Bool
Prelude.Eq, ReadPrec [UpdateEventLabel]
ReadPrec UpdateEventLabel
Int -> ReadS UpdateEventLabel
ReadS [UpdateEventLabel]
(Int -> ReadS UpdateEventLabel)
-> ReadS [UpdateEventLabel]
-> ReadPrec UpdateEventLabel
-> ReadPrec [UpdateEventLabel]
-> Read UpdateEventLabel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEventLabel]
$creadListPrec :: ReadPrec [UpdateEventLabel]
readPrec :: ReadPrec UpdateEventLabel
$creadPrec :: ReadPrec UpdateEventLabel
readList :: ReadS [UpdateEventLabel]
$creadList :: ReadS [UpdateEventLabel]
readsPrec :: Int -> ReadS UpdateEventLabel
$creadsPrec :: Int -> ReadS UpdateEventLabel
Prelude.Read, Int -> UpdateEventLabel -> ShowS
[UpdateEventLabel] -> ShowS
UpdateEventLabel -> String
(Int -> UpdateEventLabel -> ShowS)
-> (UpdateEventLabel -> String)
-> ([UpdateEventLabel] -> ShowS)
-> Show UpdateEventLabel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEventLabel] -> ShowS
$cshowList :: [UpdateEventLabel] -> ShowS
show :: UpdateEventLabel -> String
$cshow :: UpdateEventLabel -> String
showsPrec :: Int -> UpdateEventLabel -> ShowS
$cshowsPrec :: Int -> UpdateEventLabel -> ShowS
Prelude.Show, (forall x. UpdateEventLabel -> Rep UpdateEventLabel x)
-> (forall x. Rep UpdateEventLabel x -> UpdateEventLabel)
-> Generic UpdateEventLabel
forall x. Rep UpdateEventLabel x -> UpdateEventLabel
forall x. UpdateEventLabel -> Rep UpdateEventLabel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateEventLabel x -> UpdateEventLabel
$cfrom :: forall x. UpdateEventLabel -> Rep UpdateEventLabel x
Prelude.Generic)
newUpdateEventLabel ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
UpdateEventLabel
newUpdateEventLabel :: Text -> Text -> Text -> Text -> UpdateEventLabel
newUpdateEventLabel
Text
pEventId_
Text
pEventTypeName_
Text
pAssignedLabel_
Text
pLabelTimestamp_ =
UpdateEventLabel' :: Text -> Text -> Text -> Text -> UpdateEventLabel
UpdateEventLabel'
{ $sel:eventId:UpdateEventLabel' :: Text
eventId = Text
pEventId_,
$sel:eventTypeName:UpdateEventLabel' :: Text
eventTypeName = Text
pEventTypeName_,
$sel:assignedLabel:UpdateEventLabel' :: Text
assignedLabel = Text
pAssignedLabel_,
$sel:labelTimestamp:UpdateEventLabel' :: Text
labelTimestamp = Text
pLabelTimestamp_
}
updateEventLabel_eventId :: Lens.Lens' UpdateEventLabel Prelude.Text
updateEventLabel_eventId :: (Text -> f Text) -> UpdateEventLabel -> f UpdateEventLabel
updateEventLabel_eventId = (UpdateEventLabel -> Text)
-> (UpdateEventLabel -> Text -> UpdateEventLabel)
-> Lens UpdateEventLabel UpdateEventLabel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventLabel' {Text
eventId :: Text
$sel:eventId:UpdateEventLabel' :: UpdateEventLabel -> Text
eventId} -> Text
eventId) (\s :: UpdateEventLabel
s@UpdateEventLabel' {} Text
a -> UpdateEventLabel
s {$sel:eventId:UpdateEventLabel' :: Text
eventId = Text
a} :: UpdateEventLabel)
updateEventLabel_eventTypeName :: Lens.Lens' UpdateEventLabel Prelude.Text
updateEventLabel_eventTypeName :: (Text -> f Text) -> UpdateEventLabel -> f UpdateEventLabel
updateEventLabel_eventTypeName = (UpdateEventLabel -> Text)
-> (UpdateEventLabel -> Text -> UpdateEventLabel)
-> Lens UpdateEventLabel UpdateEventLabel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventLabel' {Text
eventTypeName :: Text
$sel:eventTypeName:UpdateEventLabel' :: UpdateEventLabel -> Text
eventTypeName} -> Text
eventTypeName) (\s :: UpdateEventLabel
s@UpdateEventLabel' {} Text
a -> UpdateEventLabel
s {$sel:eventTypeName:UpdateEventLabel' :: Text
eventTypeName = Text
a} :: UpdateEventLabel)
updateEventLabel_assignedLabel :: Lens.Lens' UpdateEventLabel Prelude.Text
updateEventLabel_assignedLabel :: (Text -> f Text) -> UpdateEventLabel -> f UpdateEventLabel
updateEventLabel_assignedLabel = (UpdateEventLabel -> Text)
-> (UpdateEventLabel -> Text -> UpdateEventLabel)
-> Lens UpdateEventLabel UpdateEventLabel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventLabel' {Text
assignedLabel :: Text
$sel:assignedLabel:UpdateEventLabel' :: UpdateEventLabel -> Text
assignedLabel} -> Text
assignedLabel) (\s :: UpdateEventLabel
s@UpdateEventLabel' {} Text
a -> UpdateEventLabel
s {$sel:assignedLabel:UpdateEventLabel' :: Text
assignedLabel = Text
a} :: UpdateEventLabel)
updateEventLabel_labelTimestamp :: Lens.Lens' UpdateEventLabel Prelude.Text
updateEventLabel_labelTimestamp :: (Text -> f Text) -> UpdateEventLabel -> f UpdateEventLabel
updateEventLabel_labelTimestamp = (UpdateEventLabel -> Text)
-> (UpdateEventLabel -> Text -> UpdateEventLabel)
-> Lens UpdateEventLabel UpdateEventLabel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventLabel' {Text
labelTimestamp :: Text
$sel:labelTimestamp:UpdateEventLabel' :: UpdateEventLabel -> Text
labelTimestamp} -> Text
labelTimestamp) (\s :: UpdateEventLabel
s@UpdateEventLabel' {} Text
a -> UpdateEventLabel
s {$sel:labelTimestamp:UpdateEventLabel' :: Text
labelTimestamp = Text
a} :: UpdateEventLabel)
instance Core.AWSRequest UpdateEventLabel where
type
AWSResponse UpdateEventLabel =
UpdateEventLabelResponse
request :: UpdateEventLabel -> Request UpdateEventLabel
request = Service -> UpdateEventLabel -> Request UpdateEventLabel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateEventLabel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateEventLabel)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateEventLabel))
-> Logger
-> Service
-> Proxy UpdateEventLabel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateEventLabel)))
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 -> UpdateEventLabelResponse
UpdateEventLabelResponse'
(Int -> UpdateEventLabelResponse)
-> Either String Int -> Either String UpdateEventLabelResponse
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 UpdateEventLabel
instance Prelude.NFData UpdateEventLabel
instance Core.ToHeaders UpdateEventLabel where
toHeaders :: UpdateEventLabel -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateEventLabel -> 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.UpdateEventLabel" ::
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 UpdateEventLabel where
toJSON :: UpdateEventLabel -> Value
toJSON UpdateEventLabel' {Text
labelTimestamp :: Text
assignedLabel :: Text
eventTypeName :: Text
eventId :: Text
$sel:labelTimestamp:UpdateEventLabel' :: UpdateEventLabel -> Text
$sel:assignedLabel:UpdateEventLabel' :: UpdateEventLabel -> Text
$sel:eventTypeName:UpdateEventLabel' :: UpdateEventLabel -> Text
$sel:eventId:UpdateEventLabel' :: UpdateEventLabel -> 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
"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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"assignedLabel" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assignedLabel),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"labelTimestamp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
labelTimestamp)
]
)
instance Core.ToPath UpdateEventLabel where
toPath :: UpdateEventLabel -> ByteString
toPath = ByteString -> UpdateEventLabel -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateEventLabel where
toQuery :: UpdateEventLabel -> QueryString
toQuery = QueryString -> UpdateEventLabel -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateEventLabelResponse = UpdateEventLabelResponse'
{
UpdateEventLabelResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateEventLabelResponse -> UpdateEventLabelResponse -> Bool
(UpdateEventLabelResponse -> UpdateEventLabelResponse -> Bool)
-> (UpdateEventLabelResponse -> UpdateEventLabelResponse -> Bool)
-> Eq UpdateEventLabelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEventLabelResponse -> UpdateEventLabelResponse -> Bool
$c/= :: UpdateEventLabelResponse -> UpdateEventLabelResponse -> Bool
== :: UpdateEventLabelResponse -> UpdateEventLabelResponse -> Bool
$c== :: UpdateEventLabelResponse -> UpdateEventLabelResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEventLabelResponse]
ReadPrec UpdateEventLabelResponse
Int -> ReadS UpdateEventLabelResponse
ReadS [UpdateEventLabelResponse]
(Int -> ReadS UpdateEventLabelResponse)
-> ReadS [UpdateEventLabelResponse]
-> ReadPrec UpdateEventLabelResponse
-> ReadPrec [UpdateEventLabelResponse]
-> Read UpdateEventLabelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEventLabelResponse]
$creadListPrec :: ReadPrec [UpdateEventLabelResponse]
readPrec :: ReadPrec UpdateEventLabelResponse
$creadPrec :: ReadPrec UpdateEventLabelResponse
readList :: ReadS [UpdateEventLabelResponse]
$creadList :: ReadS [UpdateEventLabelResponse]
readsPrec :: Int -> ReadS UpdateEventLabelResponse
$creadsPrec :: Int -> ReadS UpdateEventLabelResponse
Prelude.Read, Int -> UpdateEventLabelResponse -> ShowS
[UpdateEventLabelResponse] -> ShowS
UpdateEventLabelResponse -> String
(Int -> UpdateEventLabelResponse -> ShowS)
-> (UpdateEventLabelResponse -> String)
-> ([UpdateEventLabelResponse] -> ShowS)
-> Show UpdateEventLabelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEventLabelResponse] -> ShowS
$cshowList :: [UpdateEventLabelResponse] -> ShowS
show :: UpdateEventLabelResponse -> String
$cshow :: UpdateEventLabelResponse -> String
showsPrec :: Int -> UpdateEventLabelResponse -> ShowS
$cshowsPrec :: Int -> UpdateEventLabelResponse -> ShowS
Prelude.Show, (forall x.
UpdateEventLabelResponse -> Rep UpdateEventLabelResponse x)
-> (forall x.
Rep UpdateEventLabelResponse x -> UpdateEventLabelResponse)
-> Generic UpdateEventLabelResponse
forall x.
Rep UpdateEventLabelResponse x -> UpdateEventLabelResponse
forall x.
UpdateEventLabelResponse -> Rep UpdateEventLabelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEventLabelResponse x -> UpdateEventLabelResponse
$cfrom :: forall x.
UpdateEventLabelResponse -> Rep UpdateEventLabelResponse x
Prelude.Generic)
newUpdateEventLabelResponse ::
Prelude.Int ->
UpdateEventLabelResponse
newUpdateEventLabelResponse :: Int -> UpdateEventLabelResponse
newUpdateEventLabelResponse Int
pHttpStatus_ =
UpdateEventLabelResponse' :: Int -> UpdateEventLabelResponse
UpdateEventLabelResponse'
{ $sel:httpStatus:UpdateEventLabelResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateEventLabelResponse_httpStatus :: Lens.Lens' UpdateEventLabelResponse Prelude.Int
updateEventLabelResponse_httpStatus :: (Int -> f Int)
-> UpdateEventLabelResponse -> f UpdateEventLabelResponse
updateEventLabelResponse_httpStatus = (UpdateEventLabelResponse -> Int)
-> (UpdateEventLabelResponse -> Int -> UpdateEventLabelResponse)
-> Lens UpdateEventLabelResponse UpdateEventLabelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEventLabelResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEventLabelResponse' :: UpdateEventLabelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEventLabelResponse
s@UpdateEventLabelResponse' {} Int
a -> UpdateEventLabelResponse
s {$sel:httpStatus:UpdateEventLabelResponse' :: Int
httpStatus = Int
a} :: UpdateEventLabelResponse)
instance Prelude.NFData UpdateEventLabelResponse