{-# 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.GetOutcomes
(
GetOutcomes (..),
newGetOutcomes,
getOutcomes_nextToken,
getOutcomes_name,
getOutcomes_maxResults,
GetOutcomesResponse (..),
newGetOutcomesResponse,
getOutcomesResponse_outcomes,
getOutcomesResponse_nextToken,
getOutcomesResponse_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 GetOutcomes = GetOutcomes'
{
GetOutcomes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetOutcomes -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
GetOutcomes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (GetOutcomes -> GetOutcomes -> Bool
(GetOutcomes -> GetOutcomes -> Bool)
-> (GetOutcomes -> GetOutcomes -> Bool) -> Eq GetOutcomes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOutcomes -> GetOutcomes -> Bool
$c/= :: GetOutcomes -> GetOutcomes -> Bool
== :: GetOutcomes -> GetOutcomes -> Bool
$c== :: GetOutcomes -> GetOutcomes -> Bool
Prelude.Eq, ReadPrec [GetOutcomes]
ReadPrec GetOutcomes
Int -> ReadS GetOutcomes
ReadS [GetOutcomes]
(Int -> ReadS GetOutcomes)
-> ReadS [GetOutcomes]
-> ReadPrec GetOutcomes
-> ReadPrec [GetOutcomes]
-> Read GetOutcomes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOutcomes]
$creadListPrec :: ReadPrec [GetOutcomes]
readPrec :: ReadPrec GetOutcomes
$creadPrec :: ReadPrec GetOutcomes
readList :: ReadS [GetOutcomes]
$creadList :: ReadS [GetOutcomes]
readsPrec :: Int -> ReadS GetOutcomes
$creadsPrec :: Int -> ReadS GetOutcomes
Prelude.Read, Int -> GetOutcomes -> ShowS
[GetOutcomes] -> ShowS
GetOutcomes -> String
(Int -> GetOutcomes -> ShowS)
-> (GetOutcomes -> String)
-> ([GetOutcomes] -> ShowS)
-> Show GetOutcomes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOutcomes] -> ShowS
$cshowList :: [GetOutcomes] -> ShowS
show :: GetOutcomes -> String
$cshow :: GetOutcomes -> String
showsPrec :: Int -> GetOutcomes -> ShowS
$cshowsPrec :: Int -> GetOutcomes -> ShowS
Prelude.Show, (forall x. GetOutcomes -> Rep GetOutcomes x)
-> (forall x. Rep GetOutcomes x -> GetOutcomes)
-> Generic GetOutcomes
forall x. Rep GetOutcomes x -> GetOutcomes
forall x. GetOutcomes -> Rep GetOutcomes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetOutcomes x -> GetOutcomes
$cfrom :: forall x. GetOutcomes -> Rep GetOutcomes x
Prelude.Generic)
newGetOutcomes ::
GetOutcomes
newGetOutcomes :: GetOutcomes
newGetOutcomes =
GetOutcomes' :: Maybe Text -> Maybe Text -> Maybe Natural -> GetOutcomes
GetOutcomes'
{ $sel:nextToken:GetOutcomes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:GetOutcomes' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetOutcomes' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
getOutcomes_nextToken :: Lens.Lens' GetOutcomes (Prelude.Maybe Prelude.Text)
getOutcomes_nextToken :: (Maybe Text -> f (Maybe Text)) -> GetOutcomes -> f GetOutcomes
getOutcomes_nextToken = (GetOutcomes -> Maybe Text)
-> (GetOutcomes -> Maybe Text -> GetOutcomes)
-> Lens GetOutcomes GetOutcomes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOutcomes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetOutcomes' :: GetOutcomes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetOutcomes
s@GetOutcomes' {} Maybe Text
a -> GetOutcomes
s {$sel:nextToken:GetOutcomes' :: Maybe Text
nextToken = Maybe Text
a} :: GetOutcomes)
getOutcomes_name :: Lens.Lens' GetOutcomes (Prelude.Maybe Prelude.Text)
getOutcomes_name :: (Maybe Text -> f (Maybe Text)) -> GetOutcomes -> f GetOutcomes
getOutcomes_name = (GetOutcomes -> Maybe Text)
-> (GetOutcomes -> Maybe Text -> GetOutcomes)
-> Lens GetOutcomes GetOutcomes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOutcomes' {Maybe Text
name :: Maybe Text
$sel:name:GetOutcomes' :: GetOutcomes -> Maybe Text
name} -> Maybe Text
name) (\s :: GetOutcomes
s@GetOutcomes' {} Maybe Text
a -> GetOutcomes
s {$sel:name:GetOutcomes' :: Maybe Text
name = Maybe Text
a} :: GetOutcomes)
getOutcomes_maxResults :: Lens.Lens' GetOutcomes (Prelude.Maybe Prelude.Natural)
getOutcomes_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetOutcomes -> f GetOutcomes
getOutcomes_maxResults = (GetOutcomes -> Maybe Natural)
-> (GetOutcomes -> Maybe Natural -> GetOutcomes)
-> Lens GetOutcomes GetOutcomes (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOutcomes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetOutcomes' :: GetOutcomes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetOutcomes
s@GetOutcomes' {} Maybe Natural
a -> GetOutcomes
s {$sel:maxResults:GetOutcomes' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetOutcomes)
instance Core.AWSRequest GetOutcomes where
type AWSResponse GetOutcomes = GetOutcomesResponse
request :: GetOutcomes -> Request GetOutcomes
request = Service -> GetOutcomes -> Request GetOutcomes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetOutcomes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetOutcomes)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetOutcomes))
-> Logger
-> Service
-> Proxy GetOutcomes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetOutcomes)))
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 [Outcome] -> Maybe Text -> Int -> GetOutcomesResponse
GetOutcomesResponse'
(Maybe [Outcome] -> Maybe Text -> Int -> GetOutcomesResponse)
-> Either String (Maybe [Outcome])
-> Either String (Maybe Text -> Int -> GetOutcomesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Outcome]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"outcomes" Either String (Maybe (Maybe [Outcome]))
-> Maybe [Outcome] -> Either String (Maybe [Outcome])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Outcome]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> GetOutcomesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetOutcomesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
Either String (Int -> GetOutcomesResponse)
-> Either String Int -> Either String GetOutcomesResponse
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 GetOutcomes
instance Prelude.NFData GetOutcomes
instance Core.ToHeaders GetOutcomes where
toHeaders :: GetOutcomes -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetOutcomes -> 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.GetOutcomes" ::
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 GetOutcomes where
toJSON :: GetOutcomes -> Value
toJSON GetOutcomes' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
name :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:GetOutcomes' :: GetOutcomes -> Maybe Natural
$sel:name:GetOutcomes' :: GetOutcomes -> Maybe Text
$sel:nextToken:GetOutcomes' :: GetOutcomes -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"nextToken" 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
nextToken,
(Text
"name" 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
name,
(Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
]
)
instance Core.ToPath GetOutcomes where
toPath :: GetOutcomes -> ByteString
toPath = ByteString -> GetOutcomes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetOutcomes where
toQuery :: GetOutcomes -> QueryString
toQuery = QueryString -> GetOutcomes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetOutcomesResponse = GetOutcomesResponse'
{
GetOutcomesResponse -> Maybe [Outcome]
outcomes :: Prelude.Maybe [Outcome],
GetOutcomesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetOutcomesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetOutcomesResponse -> GetOutcomesResponse -> Bool
(GetOutcomesResponse -> GetOutcomesResponse -> Bool)
-> (GetOutcomesResponse -> GetOutcomesResponse -> Bool)
-> Eq GetOutcomesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOutcomesResponse -> GetOutcomesResponse -> Bool
$c/= :: GetOutcomesResponse -> GetOutcomesResponse -> Bool
== :: GetOutcomesResponse -> GetOutcomesResponse -> Bool
$c== :: GetOutcomesResponse -> GetOutcomesResponse -> Bool
Prelude.Eq, ReadPrec [GetOutcomesResponse]
ReadPrec GetOutcomesResponse
Int -> ReadS GetOutcomesResponse
ReadS [GetOutcomesResponse]
(Int -> ReadS GetOutcomesResponse)
-> ReadS [GetOutcomesResponse]
-> ReadPrec GetOutcomesResponse
-> ReadPrec [GetOutcomesResponse]
-> Read GetOutcomesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOutcomesResponse]
$creadListPrec :: ReadPrec [GetOutcomesResponse]
readPrec :: ReadPrec GetOutcomesResponse
$creadPrec :: ReadPrec GetOutcomesResponse
readList :: ReadS [GetOutcomesResponse]
$creadList :: ReadS [GetOutcomesResponse]
readsPrec :: Int -> ReadS GetOutcomesResponse
$creadsPrec :: Int -> ReadS GetOutcomesResponse
Prelude.Read, Int -> GetOutcomesResponse -> ShowS
[GetOutcomesResponse] -> ShowS
GetOutcomesResponse -> String
(Int -> GetOutcomesResponse -> ShowS)
-> (GetOutcomesResponse -> String)
-> ([GetOutcomesResponse] -> ShowS)
-> Show GetOutcomesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOutcomesResponse] -> ShowS
$cshowList :: [GetOutcomesResponse] -> ShowS
show :: GetOutcomesResponse -> String
$cshow :: GetOutcomesResponse -> String
showsPrec :: Int -> GetOutcomesResponse -> ShowS
$cshowsPrec :: Int -> GetOutcomesResponse -> ShowS
Prelude.Show, (forall x. GetOutcomesResponse -> Rep GetOutcomesResponse x)
-> (forall x. Rep GetOutcomesResponse x -> GetOutcomesResponse)
-> Generic GetOutcomesResponse
forall x. Rep GetOutcomesResponse x -> GetOutcomesResponse
forall x. GetOutcomesResponse -> Rep GetOutcomesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetOutcomesResponse x -> GetOutcomesResponse
$cfrom :: forall x. GetOutcomesResponse -> Rep GetOutcomesResponse x
Prelude.Generic)
newGetOutcomesResponse ::
Prelude.Int ->
GetOutcomesResponse
newGetOutcomesResponse :: Int -> GetOutcomesResponse
newGetOutcomesResponse Int
pHttpStatus_ =
GetOutcomesResponse' :: Maybe [Outcome] -> Maybe Text -> Int -> GetOutcomesResponse
GetOutcomesResponse'
{ $sel:outcomes:GetOutcomesResponse' :: Maybe [Outcome]
outcomes = Maybe [Outcome]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetOutcomesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetOutcomesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getOutcomesResponse_outcomes :: Lens.Lens' GetOutcomesResponse (Prelude.Maybe [Outcome])
getOutcomesResponse_outcomes :: (Maybe [Outcome] -> f (Maybe [Outcome]))
-> GetOutcomesResponse -> f GetOutcomesResponse
getOutcomesResponse_outcomes = (GetOutcomesResponse -> Maybe [Outcome])
-> (GetOutcomesResponse -> Maybe [Outcome] -> GetOutcomesResponse)
-> Lens
GetOutcomesResponse
GetOutcomesResponse
(Maybe [Outcome])
(Maybe [Outcome])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOutcomesResponse' {Maybe [Outcome]
outcomes :: Maybe [Outcome]
$sel:outcomes:GetOutcomesResponse' :: GetOutcomesResponse -> Maybe [Outcome]
outcomes} -> Maybe [Outcome]
outcomes) (\s :: GetOutcomesResponse
s@GetOutcomesResponse' {} Maybe [Outcome]
a -> GetOutcomesResponse
s {$sel:outcomes:GetOutcomesResponse' :: Maybe [Outcome]
outcomes = Maybe [Outcome]
a} :: GetOutcomesResponse) ((Maybe [Outcome] -> f (Maybe [Outcome]))
-> GetOutcomesResponse -> f GetOutcomesResponse)
-> ((Maybe [Outcome] -> f (Maybe [Outcome]))
-> Maybe [Outcome] -> f (Maybe [Outcome]))
-> (Maybe [Outcome] -> f (Maybe [Outcome]))
-> GetOutcomesResponse
-> f GetOutcomesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Outcome] [Outcome] [Outcome] [Outcome]
-> Iso
(Maybe [Outcome])
(Maybe [Outcome])
(Maybe [Outcome])
(Maybe [Outcome])
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 [Outcome] [Outcome] [Outcome] [Outcome]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getOutcomesResponse_nextToken :: Lens.Lens' GetOutcomesResponse (Prelude.Maybe Prelude.Text)
getOutcomesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetOutcomesResponse -> f GetOutcomesResponse
getOutcomesResponse_nextToken = (GetOutcomesResponse -> Maybe Text)
-> (GetOutcomesResponse -> Maybe Text -> GetOutcomesResponse)
-> Lens
GetOutcomesResponse GetOutcomesResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOutcomesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetOutcomesResponse' :: GetOutcomesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetOutcomesResponse
s@GetOutcomesResponse' {} Maybe Text
a -> GetOutcomesResponse
s {$sel:nextToken:GetOutcomesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetOutcomesResponse)
getOutcomesResponse_httpStatus :: Lens.Lens' GetOutcomesResponse Prelude.Int
getOutcomesResponse_httpStatus :: (Int -> f Int) -> GetOutcomesResponse -> f GetOutcomesResponse
getOutcomesResponse_httpStatus = (GetOutcomesResponse -> Int)
-> (GetOutcomesResponse -> Int -> GetOutcomesResponse)
-> Lens GetOutcomesResponse GetOutcomesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOutcomesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetOutcomesResponse' :: GetOutcomesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetOutcomesResponse
s@GetOutcomesResponse' {} Int
a -> GetOutcomesResponse
s {$sel:httpStatus:GetOutcomesResponse' :: Int
httpStatus = Int
a} :: GetOutcomesResponse)
instance Prelude.NFData GetOutcomesResponse