{-# 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.GetEntityTypes
(
GetEntityTypes (..),
newGetEntityTypes,
getEntityTypes_nextToken,
getEntityTypes_name,
getEntityTypes_maxResults,
GetEntityTypesResponse (..),
newGetEntityTypesResponse,
getEntityTypesResponse_entityTypes,
getEntityTypesResponse_nextToken,
getEntityTypesResponse_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 GetEntityTypes = GetEntityTypes'
{
GetEntityTypes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetEntityTypes -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
GetEntityTypes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (GetEntityTypes -> GetEntityTypes -> Bool
(GetEntityTypes -> GetEntityTypes -> Bool)
-> (GetEntityTypes -> GetEntityTypes -> Bool) -> Eq GetEntityTypes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEntityTypes -> GetEntityTypes -> Bool
$c/= :: GetEntityTypes -> GetEntityTypes -> Bool
== :: GetEntityTypes -> GetEntityTypes -> Bool
$c== :: GetEntityTypes -> GetEntityTypes -> Bool
Prelude.Eq, ReadPrec [GetEntityTypes]
ReadPrec GetEntityTypes
Int -> ReadS GetEntityTypes
ReadS [GetEntityTypes]
(Int -> ReadS GetEntityTypes)
-> ReadS [GetEntityTypes]
-> ReadPrec GetEntityTypes
-> ReadPrec [GetEntityTypes]
-> Read GetEntityTypes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEntityTypes]
$creadListPrec :: ReadPrec [GetEntityTypes]
readPrec :: ReadPrec GetEntityTypes
$creadPrec :: ReadPrec GetEntityTypes
readList :: ReadS [GetEntityTypes]
$creadList :: ReadS [GetEntityTypes]
readsPrec :: Int -> ReadS GetEntityTypes
$creadsPrec :: Int -> ReadS GetEntityTypes
Prelude.Read, Int -> GetEntityTypes -> ShowS
[GetEntityTypes] -> ShowS
GetEntityTypes -> String
(Int -> GetEntityTypes -> ShowS)
-> (GetEntityTypes -> String)
-> ([GetEntityTypes] -> ShowS)
-> Show GetEntityTypes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEntityTypes] -> ShowS
$cshowList :: [GetEntityTypes] -> ShowS
show :: GetEntityTypes -> String
$cshow :: GetEntityTypes -> String
showsPrec :: Int -> GetEntityTypes -> ShowS
$cshowsPrec :: Int -> GetEntityTypes -> ShowS
Prelude.Show, (forall x. GetEntityTypes -> Rep GetEntityTypes x)
-> (forall x. Rep GetEntityTypes x -> GetEntityTypes)
-> Generic GetEntityTypes
forall x. Rep GetEntityTypes x -> GetEntityTypes
forall x. GetEntityTypes -> Rep GetEntityTypes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetEntityTypes x -> GetEntityTypes
$cfrom :: forall x. GetEntityTypes -> Rep GetEntityTypes x
Prelude.Generic)
newGetEntityTypes ::
GetEntityTypes
newGetEntityTypes :: GetEntityTypes
newGetEntityTypes =
GetEntityTypes' :: Maybe Text -> Maybe Text -> Maybe Natural -> GetEntityTypes
GetEntityTypes'
{ $sel:nextToken:GetEntityTypes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:GetEntityTypes' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetEntityTypes' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
getEntityTypes_nextToken :: Lens.Lens' GetEntityTypes (Prelude.Maybe Prelude.Text)
getEntityTypes_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetEntityTypes -> f GetEntityTypes
getEntityTypes_nextToken = (GetEntityTypes -> Maybe Text)
-> (GetEntityTypes -> Maybe Text -> GetEntityTypes)
-> Lens GetEntityTypes GetEntityTypes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEntityTypes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEntityTypes' :: GetEntityTypes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEntityTypes
s@GetEntityTypes' {} Maybe Text
a -> GetEntityTypes
s {$sel:nextToken:GetEntityTypes' :: Maybe Text
nextToken = Maybe Text
a} :: GetEntityTypes)
getEntityTypes_name :: Lens.Lens' GetEntityTypes (Prelude.Maybe Prelude.Text)
getEntityTypes_name :: (Maybe Text -> f (Maybe Text))
-> GetEntityTypes -> f GetEntityTypes
getEntityTypes_name = (GetEntityTypes -> Maybe Text)
-> (GetEntityTypes -> Maybe Text -> GetEntityTypes)
-> Lens GetEntityTypes GetEntityTypes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEntityTypes' {Maybe Text
name :: Maybe Text
$sel:name:GetEntityTypes' :: GetEntityTypes -> Maybe Text
name} -> Maybe Text
name) (\s :: GetEntityTypes
s@GetEntityTypes' {} Maybe Text
a -> GetEntityTypes
s {$sel:name:GetEntityTypes' :: Maybe Text
name = Maybe Text
a} :: GetEntityTypes)
getEntityTypes_maxResults :: Lens.Lens' GetEntityTypes (Prelude.Maybe Prelude.Natural)
getEntityTypes_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetEntityTypes -> f GetEntityTypes
getEntityTypes_maxResults = (GetEntityTypes -> Maybe Natural)
-> (GetEntityTypes -> Maybe Natural -> GetEntityTypes)
-> Lens
GetEntityTypes GetEntityTypes (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEntityTypes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetEntityTypes' :: GetEntityTypes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetEntityTypes
s@GetEntityTypes' {} Maybe Natural
a -> GetEntityTypes
s {$sel:maxResults:GetEntityTypes' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetEntityTypes)
instance Core.AWSRequest GetEntityTypes where
type
AWSResponse GetEntityTypes =
GetEntityTypesResponse
request :: GetEntityTypes -> Request GetEntityTypes
request = Service -> GetEntityTypes -> Request GetEntityTypes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetEntityTypes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetEntityTypes)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetEntityTypes))
-> Logger
-> Service
-> Proxy GetEntityTypes
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetEntityTypes)))
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 [EntityType] -> Maybe Text -> Int -> GetEntityTypesResponse
GetEntityTypesResponse'
(Maybe [EntityType] -> Maybe Text -> Int -> GetEntityTypesResponse)
-> Either String (Maybe [EntityType])
-> Either String (Maybe Text -> Int -> GetEntityTypesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [EntityType]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"entityTypes" Either String (Maybe (Maybe [EntityType]))
-> Maybe [EntityType] -> Either String (Maybe [EntityType])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EntityType]
forall a. Monoid a => a
Prelude.mempty)
Either String (Maybe Text -> Int -> GetEntityTypesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetEntityTypesResponse)
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 -> GetEntityTypesResponse)
-> Either String Int -> Either String GetEntityTypesResponse
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 GetEntityTypes
instance Prelude.NFData GetEntityTypes
instance Core.ToHeaders GetEntityTypes where
toHeaders :: GetEntityTypes -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetEntityTypes -> 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.GetEntityTypes" ::
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 GetEntityTypes where
toJSON :: GetEntityTypes -> Value
toJSON GetEntityTypes' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
name :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:GetEntityTypes' :: GetEntityTypes -> Maybe Natural
$sel:name:GetEntityTypes' :: GetEntityTypes -> Maybe Text
$sel:nextToken:GetEntityTypes' :: GetEntityTypes -> 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 GetEntityTypes where
toPath :: GetEntityTypes -> ByteString
toPath = ByteString -> GetEntityTypes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetEntityTypes where
toQuery :: GetEntityTypes -> QueryString
toQuery = QueryString -> GetEntityTypes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetEntityTypesResponse = GetEntityTypesResponse'
{
GetEntityTypesResponse -> Maybe [EntityType]
entityTypes :: Prelude.Maybe [EntityType],
GetEntityTypesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetEntityTypesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetEntityTypesResponse -> GetEntityTypesResponse -> Bool
(GetEntityTypesResponse -> GetEntityTypesResponse -> Bool)
-> (GetEntityTypesResponse -> GetEntityTypesResponse -> Bool)
-> Eq GetEntityTypesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEntityTypesResponse -> GetEntityTypesResponse -> Bool
$c/= :: GetEntityTypesResponse -> GetEntityTypesResponse -> Bool
== :: GetEntityTypesResponse -> GetEntityTypesResponse -> Bool
$c== :: GetEntityTypesResponse -> GetEntityTypesResponse -> Bool
Prelude.Eq, ReadPrec [GetEntityTypesResponse]
ReadPrec GetEntityTypesResponse
Int -> ReadS GetEntityTypesResponse
ReadS [GetEntityTypesResponse]
(Int -> ReadS GetEntityTypesResponse)
-> ReadS [GetEntityTypesResponse]
-> ReadPrec GetEntityTypesResponse
-> ReadPrec [GetEntityTypesResponse]
-> Read GetEntityTypesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEntityTypesResponse]
$creadListPrec :: ReadPrec [GetEntityTypesResponse]
readPrec :: ReadPrec GetEntityTypesResponse
$creadPrec :: ReadPrec GetEntityTypesResponse
readList :: ReadS [GetEntityTypesResponse]
$creadList :: ReadS [GetEntityTypesResponse]
readsPrec :: Int -> ReadS GetEntityTypesResponse
$creadsPrec :: Int -> ReadS GetEntityTypesResponse
Prelude.Read, Int -> GetEntityTypesResponse -> ShowS
[GetEntityTypesResponse] -> ShowS
GetEntityTypesResponse -> String
(Int -> GetEntityTypesResponse -> ShowS)
-> (GetEntityTypesResponse -> String)
-> ([GetEntityTypesResponse] -> ShowS)
-> Show GetEntityTypesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEntityTypesResponse] -> ShowS
$cshowList :: [GetEntityTypesResponse] -> ShowS
show :: GetEntityTypesResponse -> String
$cshow :: GetEntityTypesResponse -> String
showsPrec :: Int -> GetEntityTypesResponse -> ShowS
$cshowsPrec :: Int -> GetEntityTypesResponse -> ShowS
Prelude.Show, (forall x. GetEntityTypesResponse -> Rep GetEntityTypesResponse x)
-> (forall x.
Rep GetEntityTypesResponse x -> GetEntityTypesResponse)
-> Generic GetEntityTypesResponse
forall x. Rep GetEntityTypesResponse x -> GetEntityTypesResponse
forall x. GetEntityTypesResponse -> Rep GetEntityTypesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetEntityTypesResponse x -> GetEntityTypesResponse
$cfrom :: forall x. GetEntityTypesResponse -> Rep GetEntityTypesResponse x
Prelude.Generic)
newGetEntityTypesResponse ::
Prelude.Int ->
GetEntityTypesResponse
newGetEntityTypesResponse :: Int -> GetEntityTypesResponse
newGetEntityTypesResponse Int
pHttpStatus_ =
GetEntityTypesResponse' :: Maybe [EntityType] -> Maybe Text -> Int -> GetEntityTypesResponse
GetEntityTypesResponse'
{ $sel:entityTypes:GetEntityTypesResponse' :: Maybe [EntityType]
entityTypes =
Maybe [EntityType]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetEntityTypesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetEntityTypesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getEntityTypesResponse_entityTypes :: Lens.Lens' GetEntityTypesResponse (Prelude.Maybe [EntityType])
getEntityTypesResponse_entityTypes :: (Maybe [EntityType] -> f (Maybe [EntityType]))
-> GetEntityTypesResponse -> f GetEntityTypesResponse
getEntityTypesResponse_entityTypes = (GetEntityTypesResponse -> Maybe [EntityType])
-> (GetEntityTypesResponse
-> Maybe [EntityType] -> GetEntityTypesResponse)
-> Lens
GetEntityTypesResponse
GetEntityTypesResponse
(Maybe [EntityType])
(Maybe [EntityType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEntityTypesResponse' {Maybe [EntityType]
entityTypes :: Maybe [EntityType]
$sel:entityTypes:GetEntityTypesResponse' :: GetEntityTypesResponse -> Maybe [EntityType]
entityTypes} -> Maybe [EntityType]
entityTypes) (\s :: GetEntityTypesResponse
s@GetEntityTypesResponse' {} Maybe [EntityType]
a -> GetEntityTypesResponse
s {$sel:entityTypes:GetEntityTypesResponse' :: Maybe [EntityType]
entityTypes = Maybe [EntityType]
a} :: GetEntityTypesResponse) ((Maybe [EntityType] -> f (Maybe [EntityType]))
-> GetEntityTypesResponse -> f GetEntityTypesResponse)
-> ((Maybe [EntityType] -> f (Maybe [EntityType]))
-> Maybe [EntityType] -> f (Maybe [EntityType]))
-> (Maybe [EntityType] -> f (Maybe [EntityType]))
-> GetEntityTypesResponse
-> f GetEntityTypesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [EntityType] [EntityType] [EntityType] [EntityType]
-> Iso
(Maybe [EntityType])
(Maybe [EntityType])
(Maybe [EntityType])
(Maybe [EntityType])
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 [EntityType] [EntityType] [EntityType] [EntityType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEntityTypesResponse_nextToken :: Lens.Lens' GetEntityTypesResponse (Prelude.Maybe Prelude.Text)
getEntityTypesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetEntityTypesResponse -> f GetEntityTypesResponse
getEntityTypesResponse_nextToken = (GetEntityTypesResponse -> Maybe Text)
-> (GetEntityTypesResponse -> Maybe Text -> GetEntityTypesResponse)
-> Lens
GetEntityTypesResponse
GetEntityTypesResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEntityTypesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEntityTypesResponse' :: GetEntityTypesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEntityTypesResponse
s@GetEntityTypesResponse' {} Maybe Text
a -> GetEntityTypesResponse
s {$sel:nextToken:GetEntityTypesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetEntityTypesResponse)
getEntityTypesResponse_httpStatus :: Lens.Lens' GetEntityTypesResponse Prelude.Int
getEntityTypesResponse_httpStatus :: (Int -> f Int)
-> GetEntityTypesResponse -> f GetEntityTypesResponse
getEntityTypesResponse_httpStatus = (GetEntityTypesResponse -> Int)
-> (GetEntityTypesResponse -> Int -> GetEntityTypesResponse)
-> Lens GetEntityTypesResponse GetEntityTypesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEntityTypesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEntityTypesResponse' :: GetEntityTypesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEntityTypesResponse
s@GetEntityTypesResponse' {} Int
a -> GetEntityTypesResponse
s {$sel:httpStatus:GetEntityTypesResponse' :: Int
httpStatus = Int
a} :: GetEntityTypesResponse)
instance Prelude.NFData GetEntityTypesResponse