{-# 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.MacieV2.ListResourceProfileDetections
(
ListResourceProfileDetections (..),
newListResourceProfileDetections,
listResourceProfileDetections_maxResults,
listResourceProfileDetections_nextToken,
listResourceProfileDetections_resourceArn,
ListResourceProfileDetectionsResponse (..),
newListResourceProfileDetectionsResponse,
listResourceProfileDetectionsResponse_detections,
listResourceProfileDetectionsResponse_nextToken,
listResourceProfileDetectionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListResourceProfileDetections = ListResourceProfileDetections'
{
ListResourceProfileDetections -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListResourceProfileDetections -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListResourceProfileDetections -> Text
resourceArn :: Prelude.Text
}
deriving (ListResourceProfileDetections
-> ListResourceProfileDetections -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourceProfileDetections
-> ListResourceProfileDetections -> Bool
$c/= :: ListResourceProfileDetections
-> ListResourceProfileDetections -> Bool
== :: ListResourceProfileDetections
-> ListResourceProfileDetections -> Bool
$c== :: ListResourceProfileDetections
-> ListResourceProfileDetections -> Bool
Prelude.Eq, ReadPrec [ListResourceProfileDetections]
ReadPrec ListResourceProfileDetections
Int -> ReadS ListResourceProfileDetections
ReadS [ListResourceProfileDetections]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourceProfileDetections]
$creadListPrec :: ReadPrec [ListResourceProfileDetections]
readPrec :: ReadPrec ListResourceProfileDetections
$creadPrec :: ReadPrec ListResourceProfileDetections
readList :: ReadS [ListResourceProfileDetections]
$creadList :: ReadS [ListResourceProfileDetections]
readsPrec :: Int -> ReadS ListResourceProfileDetections
$creadsPrec :: Int -> ReadS ListResourceProfileDetections
Prelude.Read, Int -> ListResourceProfileDetections -> ShowS
[ListResourceProfileDetections] -> ShowS
ListResourceProfileDetections -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourceProfileDetections] -> ShowS
$cshowList :: [ListResourceProfileDetections] -> ShowS
show :: ListResourceProfileDetections -> String
$cshow :: ListResourceProfileDetections -> String
showsPrec :: Int -> ListResourceProfileDetections -> ShowS
$cshowsPrec :: Int -> ListResourceProfileDetections -> ShowS
Prelude.Show, forall x.
Rep ListResourceProfileDetections x
-> ListResourceProfileDetections
forall x.
ListResourceProfileDetections
-> Rep ListResourceProfileDetections x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListResourceProfileDetections x
-> ListResourceProfileDetections
$cfrom :: forall x.
ListResourceProfileDetections
-> Rep ListResourceProfileDetections x
Prelude.Generic)
newListResourceProfileDetections ::
Prelude.Text ->
ListResourceProfileDetections
newListResourceProfileDetections :: Text -> ListResourceProfileDetections
newListResourceProfileDetections Text
pResourceArn_ =
ListResourceProfileDetections'
{ $sel:maxResults:ListResourceProfileDetections' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListResourceProfileDetections' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:ListResourceProfileDetections' :: Text
resourceArn = Text
pResourceArn_
}
listResourceProfileDetections_maxResults :: Lens.Lens' ListResourceProfileDetections (Prelude.Maybe Prelude.Natural)
listResourceProfileDetections_maxResults :: Lens' ListResourceProfileDetections (Maybe Natural)
listResourceProfileDetections_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceProfileDetections' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListResourceProfileDetections' :: ListResourceProfileDetections -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListResourceProfileDetections
s@ListResourceProfileDetections' {} Maybe Natural
a -> ListResourceProfileDetections
s {$sel:maxResults:ListResourceProfileDetections' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListResourceProfileDetections)
listResourceProfileDetections_nextToken :: Lens.Lens' ListResourceProfileDetections (Prelude.Maybe Prelude.Text)
listResourceProfileDetections_nextToken :: Lens' ListResourceProfileDetections (Maybe Text)
listResourceProfileDetections_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceProfileDetections' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListResourceProfileDetections' :: ListResourceProfileDetections -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListResourceProfileDetections
s@ListResourceProfileDetections' {} Maybe Text
a -> ListResourceProfileDetections
s {$sel:nextToken:ListResourceProfileDetections' :: Maybe Text
nextToken = Maybe Text
a} :: ListResourceProfileDetections)
listResourceProfileDetections_resourceArn :: Lens.Lens' ListResourceProfileDetections Prelude.Text
listResourceProfileDetections_resourceArn :: Lens' ListResourceProfileDetections Text
listResourceProfileDetections_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceProfileDetections' {Text
resourceArn :: Text
$sel:resourceArn:ListResourceProfileDetections' :: ListResourceProfileDetections -> Text
resourceArn} -> Text
resourceArn) (\s :: ListResourceProfileDetections
s@ListResourceProfileDetections' {} Text
a -> ListResourceProfileDetections
s {$sel:resourceArn:ListResourceProfileDetections' :: Text
resourceArn = Text
a} :: ListResourceProfileDetections)
instance Core.AWSPager ListResourceProfileDetections where
page :: ListResourceProfileDetections
-> AWSResponse ListResourceProfileDetections
-> Maybe ListResourceProfileDetections
page ListResourceProfileDetections
rq AWSResponse ListResourceProfileDetections
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListResourceProfileDetections
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListResourceProfileDetectionsResponse (Maybe Text)
listResourceProfileDetectionsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListResourceProfileDetections
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListResourceProfileDetectionsResponse (Maybe [Detection])
listResourceProfileDetectionsResponse_detections
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListResourceProfileDetections
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListResourceProfileDetections (Maybe Text)
listResourceProfileDetections_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListResourceProfileDetections
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListResourceProfileDetectionsResponse (Maybe Text)
listResourceProfileDetectionsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance
Core.AWSRequest
ListResourceProfileDetections
where
type
AWSResponse ListResourceProfileDetections =
ListResourceProfileDetectionsResponse
request :: (Service -> Service)
-> ListResourceProfileDetections
-> Request ListResourceProfileDetections
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListResourceProfileDetections
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListResourceProfileDetections)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [Detection]
-> Maybe Text -> Int -> ListResourceProfileDetectionsResponse
ListResourceProfileDetectionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"detections" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
ListResourceProfileDetections
where
hashWithSalt :: Int -> ListResourceProfileDetections -> Int
hashWithSalt Int
_salt ListResourceProfileDetections' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListResourceProfileDetections' :: ListResourceProfileDetections -> Text
$sel:nextToken:ListResourceProfileDetections' :: ListResourceProfileDetections -> Maybe Text
$sel:maxResults:ListResourceProfileDetections' :: ListResourceProfileDetections -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
instance Prelude.NFData ListResourceProfileDetections where
rnf :: ListResourceProfileDetections -> ()
rnf ListResourceProfileDetections' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListResourceProfileDetections' :: ListResourceProfileDetections -> Text
$sel:nextToken:ListResourceProfileDetections' :: ListResourceProfileDetections -> Maybe Text
$sel:maxResults:ListResourceProfileDetections' :: ListResourceProfileDetections -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
instance Data.ToHeaders ListResourceProfileDetections where
toHeaders :: ListResourceProfileDetections -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListResourceProfileDetections where
toPath :: ListResourceProfileDetections -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const ByteString
"/resource-profiles/detections"
instance Data.ToQuery ListResourceProfileDetections where
toQuery :: ListResourceProfileDetections -> QueryString
toQuery ListResourceProfileDetections' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListResourceProfileDetections' :: ListResourceProfileDetections -> Text
$sel:nextToken:ListResourceProfileDetections' :: ListResourceProfileDetections -> Maybe Text
$sel:maxResults:ListResourceProfileDetections' :: ListResourceProfileDetections -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"resourceArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
resourceArn
]
data ListResourceProfileDetectionsResponse = ListResourceProfileDetectionsResponse'
{
ListResourceProfileDetectionsResponse -> Maybe [Detection]
detections :: Prelude.Maybe [Detection],
ListResourceProfileDetectionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListResourceProfileDetectionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListResourceProfileDetectionsResponse
-> ListResourceProfileDetectionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListResourceProfileDetectionsResponse
-> ListResourceProfileDetectionsResponse -> Bool
$c/= :: ListResourceProfileDetectionsResponse
-> ListResourceProfileDetectionsResponse -> Bool
== :: ListResourceProfileDetectionsResponse
-> ListResourceProfileDetectionsResponse -> Bool
$c== :: ListResourceProfileDetectionsResponse
-> ListResourceProfileDetectionsResponse -> Bool
Prelude.Eq, ReadPrec [ListResourceProfileDetectionsResponse]
ReadPrec ListResourceProfileDetectionsResponse
Int -> ReadS ListResourceProfileDetectionsResponse
ReadS [ListResourceProfileDetectionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListResourceProfileDetectionsResponse]
$creadListPrec :: ReadPrec [ListResourceProfileDetectionsResponse]
readPrec :: ReadPrec ListResourceProfileDetectionsResponse
$creadPrec :: ReadPrec ListResourceProfileDetectionsResponse
readList :: ReadS [ListResourceProfileDetectionsResponse]
$creadList :: ReadS [ListResourceProfileDetectionsResponse]
readsPrec :: Int -> ReadS ListResourceProfileDetectionsResponse
$creadsPrec :: Int -> ReadS ListResourceProfileDetectionsResponse
Prelude.Read, Int -> ListResourceProfileDetectionsResponse -> ShowS
[ListResourceProfileDetectionsResponse] -> ShowS
ListResourceProfileDetectionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListResourceProfileDetectionsResponse] -> ShowS
$cshowList :: [ListResourceProfileDetectionsResponse] -> ShowS
show :: ListResourceProfileDetectionsResponse -> String
$cshow :: ListResourceProfileDetectionsResponse -> String
showsPrec :: Int -> ListResourceProfileDetectionsResponse -> ShowS
$cshowsPrec :: Int -> ListResourceProfileDetectionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListResourceProfileDetectionsResponse x
-> ListResourceProfileDetectionsResponse
forall x.
ListResourceProfileDetectionsResponse
-> Rep ListResourceProfileDetectionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListResourceProfileDetectionsResponse x
-> ListResourceProfileDetectionsResponse
$cfrom :: forall x.
ListResourceProfileDetectionsResponse
-> Rep ListResourceProfileDetectionsResponse x
Prelude.Generic)
newListResourceProfileDetectionsResponse ::
Prelude.Int ->
ListResourceProfileDetectionsResponse
newListResourceProfileDetectionsResponse :: Int -> ListResourceProfileDetectionsResponse
newListResourceProfileDetectionsResponse Int
pHttpStatus_ =
ListResourceProfileDetectionsResponse'
{ $sel:detections:ListResourceProfileDetectionsResponse' :: Maybe [Detection]
detections =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListResourceProfileDetectionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListResourceProfileDetectionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listResourceProfileDetectionsResponse_detections :: Lens.Lens' ListResourceProfileDetectionsResponse (Prelude.Maybe [Detection])
listResourceProfileDetectionsResponse_detections :: Lens' ListResourceProfileDetectionsResponse (Maybe [Detection])
listResourceProfileDetectionsResponse_detections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceProfileDetectionsResponse' {Maybe [Detection]
detections :: Maybe [Detection]
$sel:detections:ListResourceProfileDetectionsResponse' :: ListResourceProfileDetectionsResponse -> Maybe [Detection]
detections} -> Maybe [Detection]
detections) (\s :: ListResourceProfileDetectionsResponse
s@ListResourceProfileDetectionsResponse' {} Maybe [Detection]
a -> ListResourceProfileDetectionsResponse
s {$sel:detections:ListResourceProfileDetectionsResponse' :: Maybe [Detection]
detections = Maybe [Detection]
a} :: ListResourceProfileDetectionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listResourceProfileDetectionsResponse_nextToken :: Lens.Lens' ListResourceProfileDetectionsResponse (Prelude.Maybe Prelude.Text)
listResourceProfileDetectionsResponse_nextToken :: Lens' ListResourceProfileDetectionsResponse (Maybe Text)
listResourceProfileDetectionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceProfileDetectionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListResourceProfileDetectionsResponse' :: ListResourceProfileDetectionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListResourceProfileDetectionsResponse
s@ListResourceProfileDetectionsResponse' {} Maybe Text
a -> ListResourceProfileDetectionsResponse
s {$sel:nextToken:ListResourceProfileDetectionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListResourceProfileDetectionsResponse)
listResourceProfileDetectionsResponse_httpStatus :: Lens.Lens' ListResourceProfileDetectionsResponse Prelude.Int
listResourceProfileDetectionsResponse_httpStatus :: Lens' ListResourceProfileDetectionsResponse Int
listResourceProfileDetectionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListResourceProfileDetectionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListResourceProfileDetectionsResponse' :: ListResourceProfileDetectionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListResourceProfileDetectionsResponse
s@ListResourceProfileDetectionsResponse' {} Int
a -> ListResourceProfileDetectionsResponse
s {$sel:httpStatus:ListResourceProfileDetectionsResponse' :: Int
httpStatus = Int
a} :: ListResourceProfileDetectionsResponse)
instance
Prelude.NFData
ListResourceProfileDetectionsResponse
where
rnf :: ListResourceProfileDetectionsResponse -> ()
rnf ListResourceProfileDetectionsResponse' {Int
Maybe [Detection]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
detections :: Maybe [Detection]
$sel:httpStatus:ListResourceProfileDetectionsResponse' :: ListResourceProfileDetectionsResponse -> Int
$sel:nextToken:ListResourceProfileDetectionsResponse' :: ListResourceProfileDetectionsResponse -> Maybe Text
$sel:detections:ListResourceProfileDetectionsResponse' :: ListResourceProfileDetectionsResponse -> Maybe [Detection]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Detection]
detections
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus