{-# 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.GetEventPrediction
(
GetEventPrediction (..),
newGetEventPrediction,
getEventPrediction_detectorVersionId,
getEventPrediction_externalModelEndpointDataBlobs,
getEventPrediction_detectorId,
getEventPrediction_eventId,
getEventPrediction_eventTypeName,
getEventPrediction_entities,
getEventPrediction_eventTimestamp,
getEventPrediction_eventVariables,
GetEventPredictionResponse (..),
newGetEventPredictionResponse,
getEventPredictionResponse_modelScores,
getEventPredictionResponse_externalModelOutputs,
getEventPredictionResponse_ruleResults,
getEventPredictionResponse_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 GetEventPrediction = GetEventPrediction'
{
GetEventPrediction -> Maybe Text
detectorVersionId :: Prelude.Maybe Prelude.Text,
GetEventPrediction
-> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
externalModelEndpointDataBlobs :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text ModelEndpointDataBlob)),
GetEventPrediction -> Text
detectorId :: Prelude.Text,
GetEventPrediction -> Text
eventId :: Prelude.Text,
GetEventPrediction -> Text
eventTypeName :: Prelude.Text,
GetEventPrediction -> [Sensitive Entity]
entities :: [Core.Sensitive Entity],
GetEventPrediction -> Text
eventTimestamp :: Prelude.Text,
GetEventPrediction -> HashMap Text (Sensitive Text)
eventVariables :: Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)
}
deriving (GetEventPrediction -> GetEventPrediction -> Bool
(GetEventPrediction -> GetEventPrediction -> Bool)
-> (GetEventPrediction -> GetEventPrediction -> Bool)
-> Eq GetEventPrediction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEventPrediction -> GetEventPrediction -> Bool
$c/= :: GetEventPrediction -> GetEventPrediction -> Bool
== :: GetEventPrediction -> GetEventPrediction -> Bool
$c== :: GetEventPrediction -> GetEventPrediction -> Bool
Prelude.Eq, Int -> GetEventPrediction -> ShowS
[GetEventPrediction] -> ShowS
GetEventPrediction -> String
(Int -> GetEventPrediction -> ShowS)
-> (GetEventPrediction -> String)
-> ([GetEventPrediction] -> ShowS)
-> Show GetEventPrediction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEventPrediction] -> ShowS
$cshowList :: [GetEventPrediction] -> ShowS
show :: GetEventPrediction -> String
$cshow :: GetEventPrediction -> String
showsPrec :: Int -> GetEventPrediction -> ShowS
$cshowsPrec :: Int -> GetEventPrediction -> ShowS
Prelude.Show, (forall x. GetEventPrediction -> Rep GetEventPrediction x)
-> (forall x. Rep GetEventPrediction x -> GetEventPrediction)
-> Generic GetEventPrediction
forall x. Rep GetEventPrediction x -> GetEventPrediction
forall x. GetEventPrediction -> Rep GetEventPrediction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetEventPrediction x -> GetEventPrediction
$cfrom :: forall x. GetEventPrediction -> Rep GetEventPrediction x
Prelude.Generic)
newGetEventPrediction ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
GetEventPrediction
newGetEventPrediction :: Text -> Text -> Text -> Text -> GetEventPrediction
newGetEventPrediction
Text
pDetectorId_
Text
pEventId_
Text
pEventTypeName_
Text
pEventTimestamp_ =
GetEventPrediction' :: Maybe Text
-> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
-> Text
-> Text
-> Text
-> [Sensitive Entity]
-> Text
-> HashMap Text (Sensitive Text)
-> GetEventPrediction
GetEventPrediction'
{ $sel:detectorVersionId:GetEventPrediction' :: Maybe Text
detectorVersionId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:externalModelEndpointDataBlobs:GetEventPrediction' :: Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
externalModelEndpointDataBlobs = Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
forall a. Maybe a
Prelude.Nothing,
$sel:detectorId:GetEventPrediction' :: Text
detectorId = Text
pDetectorId_,
$sel:eventId:GetEventPrediction' :: Text
eventId = Text
pEventId_,
$sel:eventTypeName:GetEventPrediction' :: Text
eventTypeName = Text
pEventTypeName_,
$sel:entities:GetEventPrediction' :: [Sensitive Entity]
entities = [Sensitive Entity]
forall a. Monoid a => a
Prelude.mempty,
$sel:eventTimestamp:GetEventPrediction' :: Text
eventTimestamp = Text
pEventTimestamp_,
$sel:eventVariables:GetEventPrediction' :: HashMap Text (Sensitive Text)
eventVariables = HashMap Text (Sensitive Text)
forall a. Monoid a => a
Prelude.mempty
}
getEventPrediction_detectorVersionId :: Lens.Lens' GetEventPrediction (Prelude.Maybe Prelude.Text)
getEventPrediction_detectorVersionId :: (Maybe Text -> f (Maybe Text))
-> GetEventPrediction -> f GetEventPrediction
getEventPrediction_detectorVersionId = (GetEventPrediction -> Maybe Text)
-> (GetEventPrediction -> Maybe Text -> GetEventPrediction)
-> Lens
GetEventPrediction GetEventPrediction (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPrediction' {Maybe Text
detectorVersionId :: Maybe Text
$sel:detectorVersionId:GetEventPrediction' :: GetEventPrediction -> Maybe Text
detectorVersionId} -> Maybe Text
detectorVersionId) (\s :: GetEventPrediction
s@GetEventPrediction' {} Maybe Text
a -> GetEventPrediction
s {$sel:detectorVersionId:GetEventPrediction' :: Maybe Text
detectorVersionId = Maybe Text
a} :: GetEventPrediction)
getEventPrediction_externalModelEndpointDataBlobs :: Lens.Lens' GetEventPrediction (Prelude.Maybe (Prelude.HashMap Prelude.Text ModelEndpointDataBlob))
getEventPrediction_externalModelEndpointDataBlobs :: (Maybe (HashMap Text ModelEndpointDataBlob)
-> f (Maybe (HashMap Text ModelEndpointDataBlob)))
-> GetEventPrediction -> f GetEventPrediction
getEventPrediction_externalModelEndpointDataBlobs = (GetEventPrediction
-> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob)))
-> (GetEventPrediction
-> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
-> GetEventPrediction)
-> Lens
GetEventPrediction
GetEventPrediction
(Maybe (Sensitive (HashMap Text ModelEndpointDataBlob)))
(Maybe (Sensitive (HashMap Text ModelEndpointDataBlob)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPrediction' {Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
externalModelEndpointDataBlobs :: Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
$sel:externalModelEndpointDataBlobs:GetEventPrediction' :: GetEventPrediction
-> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
externalModelEndpointDataBlobs} -> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
externalModelEndpointDataBlobs) (\s :: GetEventPrediction
s@GetEventPrediction' {} Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
a -> GetEventPrediction
s {$sel:externalModelEndpointDataBlobs:GetEventPrediction' :: Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
externalModelEndpointDataBlobs = Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
a} :: GetEventPrediction) ((Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
-> f (Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))))
-> GetEventPrediction -> f GetEventPrediction)
-> ((Maybe (HashMap Text ModelEndpointDataBlob)
-> f (Maybe (HashMap Text ModelEndpointDataBlob)))
-> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
-> f (Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))))
-> (Maybe (HashMap Text ModelEndpointDataBlob)
-> f (Maybe (HashMap Text ModelEndpointDataBlob)))
-> GetEventPrediction
-> f GetEventPrediction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (HashMap Text ModelEndpointDataBlob))
(Sensitive (HashMap Text ModelEndpointDataBlob))
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
-> Iso
(Maybe (Sensitive (HashMap Text ModelEndpointDataBlob)))
(Maybe (Sensitive (HashMap Text ModelEndpointDataBlob)))
(Maybe (HashMap Text ModelEndpointDataBlob))
(Maybe (HashMap Text ModelEndpointDataBlob))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping (AnIso
(Sensitive (HashMap Text ModelEndpointDataBlob))
(Sensitive (HashMap Text ModelEndpointDataBlob))
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
(Sensitive (HashMap Text ModelEndpointDataBlob))
(Sensitive (HashMap Text ModelEndpointDataBlob))
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
-> (Exchange
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
(Identity (HashMap Text ModelEndpointDataBlob))
-> Exchange
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
(Identity (HashMap Text ModelEndpointDataBlob)))
-> AnIso
(Sensitive (HashMap Text ModelEndpointDataBlob))
(Sensitive (HashMap Text ModelEndpointDataBlob))
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
(Identity (HashMap Text ModelEndpointDataBlob))
-> Exchange
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
(HashMap Text ModelEndpointDataBlob)
(Identity (HashMap Text ModelEndpointDataBlob))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
getEventPrediction_detectorId :: Lens.Lens' GetEventPrediction Prelude.Text
getEventPrediction_detectorId :: (Text -> f Text) -> GetEventPrediction -> f GetEventPrediction
getEventPrediction_detectorId = (GetEventPrediction -> Text)
-> (GetEventPrediction -> Text -> GetEventPrediction)
-> Lens GetEventPrediction GetEventPrediction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPrediction' {Text
detectorId :: Text
$sel:detectorId:GetEventPrediction' :: GetEventPrediction -> Text
detectorId} -> Text
detectorId) (\s :: GetEventPrediction
s@GetEventPrediction' {} Text
a -> GetEventPrediction
s {$sel:detectorId:GetEventPrediction' :: Text
detectorId = Text
a} :: GetEventPrediction)
getEventPrediction_eventId :: Lens.Lens' GetEventPrediction Prelude.Text
getEventPrediction_eventId :: (Text -> f Text) -> GetEventPrediction -> f GetEventPrediction
getEventPrediction_eventId = (GetEventPrediction -> Text)
-> (GetEventPrediction -> Text -> GetEventPrediction)
-> Lens GetEventPrediction GetEventPrediction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPrediction' {Text
eventId :: Text
$sel:eventId:GetEventPrediction' :: GetEventPrediction -> Text
eventId} -> Text
eventId) (\s :: GetEventPrediction
s@GetEventPrediction' {} Text
a -> GetEventPrediction
s {$sel:eventId:GetEventPrediction' :: Text
eventId = Text
a} :: GetEventPrediction)
getEventPrediction_eventTypeName :: Lens.Lens' GetEventPrediction Prelude.Text
getEventPrediction_eventTypeName :: (Text -> f Text) -> GetEventPrediction -> f GetEventPrediction
getEventPrediction_eventTypeName = (GetEventPrediction -> Text)
-> (GetEventPrediction -> Text -> GetEventPrediction)
-> Lens GetEventPrediction GetEventPrediction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPrediction' {Text
eventTypeName :: Text
$sel:eventTypeName:GetEventPrediction' :: GetEventPrediction -> Text
eventTypeName} -> Text
eventTypeName) (\s :: GetEventPrediction
s@GetEventPrediction' {} Text
a -> GetEventPrediction
s {$sel:eventTypeName:GetEventPrediction' :: Text
eventTypeName = Text
a} :: GetEventPrediction)
getEventPrediction_entities :: Lens.Lens' GetEventPrediction [Entity]
getEventPrediction_entities :: ([Entity] -> f [Entity])
-> GetEventPrediction -> f GetEventPrediction
getEventPrediction_entities = (GetEventPrediction -> [Sensitive Entity])
-> (GetEventPrediction -> [Sensitive Entity] -> GetEventPrediction)
-> Lens
GetEventPrediction
GetEventPrediction
[Sensitive Entity]
[Sensitive Entity]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPrediction' {[Sensitive Entity]
entities :: [Sensitive Entity]
$sel:entities:GetEventPrediction' :: GetEventPrediction -> [Sensitive Entity]
entities} -> [Sensitive Entity]
entities) (\s :: GetEventPrediction
s@GetEventPrediction' {} [Sensitive Entity]
a -> GetEventPrediction
s {$sel:entities:GetEventPrediction' :: [Sensitive Entity]
entities = [Sensitive Entity]
a} :: GetEventPrediction) (([Sensitive Entity] -> f [Sensitive Entity])
-> GetEventPrediction -> f GetEventPrediction)
-> (([Entity] -> f [Entity])
-> [Sensitive Entity] -> f [Sensitive Entity])
-> ([Entity] -> f [Entity])
-> GetEventPrediction
-> f GetEventPrediction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Entity] -> f [Entity])
-> [Sensitive Entity] -> f [Sensitive Entity]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEventPrediction_eventTimestamp :: Lens.Lens' GetEventPrediction Prelude.Text
getEventPrediction_eventTimestamp :: (Text -> f Text) -> GetEventPrediction -> f GetEventPrediction
getEventPrediction_eventTimestamp = (GetEventPrediction -> Text)
-> (GetEventPrediction -> Text -> GetEventPrediction)
-> Lens GetEventPrediction GetEventPrediction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPrediction' {Text
eventTimestamp :: Text
$sel:eventTimestamp:GetEventPrediction' :: GetEventPrediction -> Text
eventTimestamp} -> Text
eventTimestamp) (\s :: GetEventPrediction
s@GetEventPrediction' {} Text
a -> GetEventPrediction
s {$sel:eventTimestamp:GetEventPrediction' :: Text
eventTimestamp = Text
a} :: GetEventPrediction)
getEventPrediction_eventVariables :: Lens.Lens' GetEventPrediction (Prelude.HashMap Prelude.Text Prelude.Text)
getEventPrediction_eventVariables :: (HashMap Text Text -> f (HashMap Text Text))
-> GetEventPrediction -> f GetEventPrediction
getEventPrediction_eventVariables = (GetEventPrediction -> HashMap Text (Sensitive Text))
-> (GetEventPrediction
-> HashMap Text (Sensitive Text) -> GetEventPrediction)
-> Lens
GetEventPrediction
GetEventPrediction
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPrediction' {HashMap Text (Sensitive Text)
eventVariables :: HashMap Text (Sensitive Text)
$sel:eventVariables:GetEventPrediction' :: GetEventPrediction -> HashMap Text (Sensitive Text)
eventVariables} -> HashMap Text (Sensitive Text)
eventVariables) (\s :: GetEventPrediction
s@GetEventPrediction' {} HashMap Text (Sensitive Text)
a -> GetEventPrediction
s {$sel:eventVariables:GetEventPrediction' :: HashMap Text (Sensitive Text)
eventVariables = HashMap Text (Sensitive Text)
a} :: GetEventPrediction) ((HashMap Text (Sensitive Text)
-> f (HashMap Text (Sensitive Text)))
-> GetEventPrediction -> f GetEventPrediction)
-> ((HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text (Sensitive Text)
-> f (HashMap Text (Sensitive Text)))
-> (HashMap Text Text -> f (HashMap Text Text))
-> GetEventPrediction
-> f GetEventPrediction
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text (Sensitive Text)
-> f (HashMap Text (Sensitive Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest GetEventPrediction where
type
AWSResponse GetEventPrediction =
GetEventPredictionResponse
request :: GetEventPrediction -> Request GetEventPrediction
request = Service -> GetEventPrediction -> Request GetEventPrediction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetEventPrediction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEventPrediction)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetEventPrediction))
-> Logger
-> Service
-> Proxy GetEventPrediction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEventPrediction)))
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 [ModelScores]
-> Maybe [ExternalModelOutputs]
-> Maybe [RuleResult]
-> Int
-> GetEventPredictionResponse
GetEventPredictionResponse'
(Maybe [ModelScores]
-> Maybe [ExternalModelOutputs]
-> Maybe [RuleResult]
-> Int
-> GetEventPredictionResponse)
-> Either String (Maybe [ModelScores])
-> Either
String
(Maybe [ExternalModelOutputs]
-> Maybe [RuleResult] -> Int -> GetEventPredictionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ModelScores]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"modelScores" Either String (Maybe (Maybe [ModelScores]))
-> Maybe [ModelScores] -> Either String (Maybe [ModelScores])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ModelScores]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Maybe [ExternalModelOutputs]
-> Maybe [RuleResult] -> Int -> GetEventPredictionResponse)
-> Either String (Maybe [ExternalModelOutputs])
-> Either
String (Maybe [RuleResult] -> Int -> GetEventPredictionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ExternalModelOutputs]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"externalModelOutputs"
Either String (Maybe (Maybe [ExternalModelOutputs]))
-> Maybe [ExternalModelOutputs]
-> Either String (Maybe [ExternalModelOutputs])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ExternalModelOutputs]
forall a. Monoid a => a
Prelude.mempty
)
Either
String (Maybe [RuleResult] -> Int -> GetEventPredictionResponse)
-> Either String (Maybe [RuleResult])
-> Either String (Int -> GetEventPredictionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [RuleResult]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ruleResults" Either String (Maybe (Maybe [RuleResult]))
-> Maybe [RuleResult] -> Either String (Maybe [RuleResult])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RuleResult]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetEventPredictionResponse)
-> Either String Int -> Either String GetEventPredictionResponse
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 GetEventPrediction
instance Prelude.NFData GetEventPrediction
instance Core.ToHeaders GetEventPrediction where
toHeaders :: GetEventPrediction -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetEventPrediction -> 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.GetEventPrediction" ::
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 GetEventPrediction where
toJSON :: GetEventPrediction -> Value
toJSON GetEventPrediction' {[Sensitive Entity]
Maybe Text
Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
Text
HashMap Text (Sensitive Text)
eventVariables :: HashMap Text (Sensitive Text)
eventTimestamp :: Text
entities :: [Sensitive Entity]
eventTypeName :: Text
eventId :: Text
detectorId :: Text
externalModelEndpointDataBlobs :: Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
detectorVersionId :: Maybe Text
$sel:eventVariables:GetEventPrediction' :: GetEventPrediction -> HashMap Text (Sensitive Text)
$sel:eventTimestamp:GetEventPrediction' :: GetEventPrediction -> Text
$sel:entities:GetEventPrediction' :: GetEventPrediction -> [Sensitive Entity]
$sel:eventTypeName:GetEventPrediction' :: GetEventPrediction -> Text
$sel:eventId:GetEventPrediction' :: GetEventPrediction -> Text
$sel:detectorId:GetEventPrediction' :: GetEventPrediction -> Text
$sel:externalModelEndpointDataBlobs:GetEventPrediction' :: GetEventPrediction
-> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
$sel:detectorVersionId:GetEventPrediction' :: GetEventPrediction -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"detectorVersionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
detectorVersionId,
(Text
"externalModelEndpointDataBlobs" Text -> Sensitive (HashMap Text ModelEndpointDataBlob) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Sensitive (HashMap Text ModelEndpointDataBlob) -> Pair)
-> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (HashMap Text ModelEndpointDataBlob))
externalModelEndpointDataBlobs,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"detectorId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
detectorId),
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
"entities" Text -> [Sensitive Entity] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Sensitive Entity]
entities),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"eventTimestamp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventTimestamp),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"eventVariables" Text -> HashMap Text (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text (Sensitive Text)
eventVariables)
]
)
instance Core.ToPath GetEventPrediction where
toPath :: GetEventPrediction -> ByteString
toPath = ByteString -> GetEventPrediction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetEventPrediction where
toQuery :: GetEventPrediction -> QueryString
toQuery = QueryString -> GetEventPrediction -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetEventPredictionResponse = GetEventPredictionResponse'
{
GetEventPredictionResponse -> Maybe [ModelScores]
modelScores :: Prelude.Maybe [ModelScores],
GetEventPredictionResponse -> Maybe [ExternalModelOutputs]
externalModelOutputs :: Prelude.Maybe [ExternalModelOutputs],
GetEventPredictionResponse -> Maybe [RuleResult]
ruleResults :: Prelude.Maybe [RuleResult],
GetEventPredictionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetEventPredictionResponse -> GetEventPredictionResponse -> Bool
(GetEventPredictionResponse -> GetEventPredictionResponse -> Bool)
-> (GetEventPredictionResponse
-> GetEventPredictionResponse -> Bool)
-> Eq GetEventPredictionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEventPredictionResponse -> GetEventPredictionResponse -> Bool
$c/= :: GetEventPredictionResponse -> GetEventPredictionResponse -> Bool
== :: GetEventPredictionResponse -> GetEventPredictionResponse -> Bool
$c== :: GetEventPredictionResponse -> GetEventPredictionResponse -> Bool
Prelude.Eq, ReadPrec [GetEventPredictionResponse]
ReadPrec GetEventPredictionResponse
Int -> ReadS GetEventPredictionResponse
ReadS [GetEventPredictionResponse]
(Int -> ReadS GetEventPredictionResponse)
-> ReadS [GetEventPredictionResponse]
-> ReadPrec GetEventPredictionResponse
-> ReadPrec [GetEventPredictionResponse]
-> Read GetEventPredictionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEventPredictionResponse]
$creadListPrec :: ReadPrec [GetEventPredictionResponse]
readPrec :: ReadPrec GetEventPredictionResponse
$creadPrec :: ReadPrec GetEventPredictionResponse
readList :: ReadS [GetEventPredictionResponse]
$creadList :: ReadS [GetEventPredictionResponse]
readsPrec :: Int -> ReadS GetEventPredictionResponse
$creadsPrec :: Int -> ReadS GetEventPredictionResponse
Prelude.Read, Int -> GetEventPredictionResponse -> ShowS
[GetEventPredictionResponse] -> ShowS
GetEventPredictionResponse -> String
(Int -> GetEventPredictionResponse -> ShowS)
-> (GetEventPredictionResponse -> String)
-> ([GetEventPredictionResponse] -> ShowS)
-> Show GetEventPredictionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEventPredictionResponse] -> ShowS
$cshowList :: [GetEventPredictionResponse] -> ShowS
show :: GetEventPredictionResponse -> String
$cshow :: GetEventPredictionResponse -> String
showsPrec :: Int -> GetEventPredictionResponse -> ShowS
$cshowsPrec :: Int -> GetEventPredictionResponse -> ShowS
Prelude.Show, (forall x.
GetEventPredictionResponse -> Rep GetEventPredictionResponse x)
-> (forall x.
Rep GetEventPredictionResponse x -> GetEventPredictionResponse)
-> Generic GetEventPredictionResponse
forall x.
Rep GetEventPredictionResponse x -> GetEventPredictionResponse
forall x.
GetEventPredictionResponse -> Rep GetEventPredictionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEventPredictionResponse x -> GetEventPredictionResponse
$cfrom :: forall x.
GetEventPredictionResponse -> Rep GetEventPredictionResponse x
Prelude.Generic)
newGetEventPredictionResponse ::
Prelude.Int ->
GetEventPredictionResponse
newGetEventPredictionResponse :: Int -> GetEventPredictionResponse
newGetEventPredictionResponse Int
pHttpStatus_ =
GetEventPredictionResponse' :: Maybe [ModelScores]
-> Maybe [ExternalModelOutputs]
-> Maybe [RuleResult]
-> Int
-> GetEventPredictionResponse
GetEventPredictionResponse'
{ $sel:modelScores:GetEventPredictionResponse' :: Maybe [ModelScores]
modelScores =
Maybe [ModelScores]
forall a. Maybe a
Prelude.Nothing,
$sel:externalModelOutputs:GetEventPredictionResponse' :: Maybe [ExternalModelOutputs]
externalModelOutputs = Maybe [ExternalModelOutputs]
forall a. Maybe a
Prelude.Nothing,
$sel:ruleResults:GetEventPredictionResponse' :: Maybe [RuleResult]
ruleResults = Maybe [RuleResult]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetEventPredictionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getEventPredictionResponse_modelScores :: Lens.Lens' GetEventPredictionResponse (Prelude.Maybe [ModelScores])
getEventPredictionResponse_modelScores :: (Maybe [ModelScores] -> f (Maybe [ModelScores]))
-> GetEventPredictionResponse -> f GetEventPredictionResponse
getEventPredictionResponse_modelScores = (GetEventPredictionResponse -> Maybe [ModelScores])
-> (GetEventPredictionResponse
-> Maybe [ModelScores] -> GetEventPredictionResponse)
-> Lens
GetEventPredictionResponse
GetEventPredictionResponse
(Maybe [ModelScores])
(Maybe [ModelScores])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPredictionResponse' {Maybe [ModelScores]
modelScores :: Maybe [ModelScores]
$sel:modelScores:GetEventPredictionResponse' :: GetEventPredictionResponse -> Maybe [ModelScores]
modelScores} -> Maybe [ModelScores]
modelScores) (\s :: GetEventPredictionResponse
s@GetEventPredictionResponse' {} Maybe [ModelScores]
a -> GetEventPredictionResponse
s {$sel:modelScores:GetEventPredictionResponse' :: Maybe [ModelScores]
modelScores = Maybe [ModelScores]
a} :: GetEventPredictionResponse) ((Maybe [ModelScores] -> f (Maybe [ModelScores]))
-> GetEventPredictionResponse -> f GetEventPredictionResponse)
-> ((Maybe [ModelScores] -> f (Maybe [ModelScores]))
-> Maybe [ModelScores] -> f (Maybe [ModelScores]))
-> (Maybe [ModelScores] -> f (Maybe [ModelScores]))
-> GetEventPredictionResponse
-> f GetEventPredictionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ModelScores] [ModelScores] [ModelScores] [ModelScores]
-> Iso
(Maybe [ModelScores])
(Maybe [ModelScores])
(Maybe [ModelScores])
(Maybe [ModelScores])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [ModelScores] [ModelScores] [ModelScores] [ModelScores]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEventPredictionResponse_externalModelOutputs :: Lens.Lens' GetEventPredictionResponse (Prelude.Maybe [ExternalModelOutputs])
getEventPredictionResponse_externalModelOutputs :: (Maybe [ExternalModelOutputs] -> f (Maybe [ExternalModelOutputs]))
-> GetEventPredictionResponse -> f GetEventPredictionResponse
getEventPredictionResponse_externalModelOutputs = (GetEventPredictionResponse -> Maybe [ExternalModelOutputs])
-> (GetEventPredictionResponse
-> Maybe [ExternalModelOutputs] -> GetEventPredictionResponse)
-> Lens
GetEventPredictionResponse
GetEventPredictionResponse
(Maybe [ExternalModelOutputs])
(Maybe [ExternalModelOutputs])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPredictionResponse' {Maybe [ExternalModelOutputs]
externalModelOutputs :: Maybe [ExternalModelOutputs]
$sel:externalModelOutputs:GetEventPredictionResponse' :: GetEventPredictionResponse -> Maybe [ExternalModelOutputs]
externalModelOutputs} -> Maybe [ExternalModelOutputs]
externalModelOutputs) (\s :: GetEventPredictionResponse
s@GetEventPredictionResponse' {} Maybe [ExternalModelOutputs]
a -> GetEventPredictionResponse
s {$sel:externalModelOutputs:GetEventPredictionResponse' :: Maybe [ExternalModelOutputs]
externalModelOutputs = Maybe [ExternalModelOutputs]
a} :: GetEventPredictionResponse) ((Maybe [ExternalModelOutputs] -> f (Maybe [ExternalModelOutputs]))
-> GetEventPredictionResponse -> f GetEventPredictionResponse)
-> ((Maybe [ExternalModelOutputs]
-> f (Maybe [ExternalModelOutputs]))
-> Maybe [ExternalModelOutputs]
-> f (Maybe [ExternalModelOutputs]))
-> (Maybe [ExternalModelOutputs]
-> f (Maybe [ExternalModelOutputs]))
-> GetEventPredictionResponse
-> f GetEventPredictionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ExternalModelOutputs]
[ExternalModelOutputs]
[ExternalModelOutputs]
[ExternalModelOutputs]
-> Iso
(Maybe [ExternalModelOutputs])
(Maybe [ExternalModelOutputs])
(Maybe [ExternalModelOutputs])
(Maybe [ExternalModelOutputs])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ExternalModelOutputs]
[ExternalModelOutputs]
[ExternalModelOutputs]
[ExternalModelOutputs]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEventPredictionResponse_ruleResults :: Lens.Lens' GetEventPredictionResponse (Prelude.Maybe [RuleResult])
getEventPredictionResponse_ruleResults :: (Maybe [RuleResult] -> f (Maybe [RuleResult]))
-> GetEventPredictionResponse -> f GetEventPredictionResponse
getEventPredictionResponse_ruleResults = (GetEventPredictionResponse -> Maybe [RuleResult])
-> (GetEventPredictionResponse
-> Maybe [RuleResult] -> GetEventPredictionResponse)
-> Lens
GetEventPredictionResponse
GetEventPredictionResponse
(Maybe [RuleResult])
(Maybe [RuleResult])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPredictionResponse' {Maybe [RuleResult]
ruleResults :: Maybe [RuleResult]
$sel:ruleResults:GetEventPredictionResponse' :: GetEventPredictionResponse -> Maybe [RuleResult]
ruleResults} -> Maybe [RuleResult]
ruleResults) (\s :: GetEventPredictionResponse
s@GetEventPredictionResponse' {} Maybe [RuleResult]
a -> GetEventPredictionResponse
s {$sel:ruleResults:GetEventPredictionResponse' :: Maybe [RuleResult]
ruleResults = Maybe [RuleResult]
a} :: GetEventPredictionResponse) ((Maybe [RuleResult] -> f (Maybe [RuleResult]))
-> GetEventPredictionResponse -> f GetEventPredictionResponse)
-> ((Maybe [RuleResult] -> f (Maybe [RuleResult]))
-> Maybe [RuleResult] -> f (Maybe [RuleResult]))
-> (Maybe [RuleResult] -> f (Maybe [RuleResult]))
-> GetEventPredictionResponse
-> f GetEventPredictionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [RuleResult] [RuleResult] [RuleResult] [RuleResult]
-> Iso
(Maybe [RuleResult])
(Maybe [RuleResult])
(Maybe [RuleResult])
(Maybe [RuleResult])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [RuleResult] [RuleResult] [RuleResult] [RuleResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEventPredictionResponse_httpStatus :: Lens.Lens' GetEventPredictionResponse Prelude.Int
getEventPredictionResponse_httpStatus :: (Int -> f Int)
-> GetEventPredictionResponse -> f GetEventPredictionResponse
getEventPredictionResponse_httpStatus = (GetEventPredictionResponse -> Int)
-> (GetEventPredictionResponse
-> Int -> GetEventPredictionResponse)
-> Lens
GetEventPredictionResponse GetEventPredictionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEventPredictionResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEventPredictionResponse' :: GetEventPredictionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEventPredictionResponse
s@GetEventPredictionResponse' {} Int
a -> GetEventPredictionResponse
s {$sel:httpStatus:GetEventPredictionResponse' :: Int
httpStatus = Int
a} :: GetEventPredictionResponse)
instance Prelude.NFData GetEventPredictionResponse