{-# 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.GetSensitiveDataOccurrences
(
GetSensitiveDataOccurrences (..),
newGetSensitiveDataOccurrences,
getSensitiveDataOccurrences_findingId,
GetSensitiveDataOccurrencesResponse (..),
newGetSensitiveDataOccurrencesResponse,
getSensitiveDataOccurrencesResponse_error,
getSensitiveDataOccurrencesResponse_sensitiveDataOccurrences,
getSensitiveDataOccurrencesResponse_status,
getSensitiveDataOccurrencesResponse_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 GetSensitiveDataOccurrences = GetSensitiveDataOccurrences'
{
GetSensitiveDataOccurrences -> Text
findingId :: Prelude.Text
}
deriving (GetSensitiveDataOccurrences -> GetSensitiveDataOccurrences -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSensitiveDataOccurrences -> GetSensitiveDataOccurrences -> Bool
$c/= :: GetSensitiveDataOccurrences -> GetSensitiveDataOccurrences -> Bool
== :: GetSensitiveDataOccurrences -> GetSensitiveDataOccurrences -> Bool
$c== :: GetSensitiveDataOccurrences -> GetSensitiveDataOccurrences -> Bool
Prelude.Eq, ReadPrec [GetSensitiveDataOccurrences]
ReadPrec GetSensitiveDataOccurrences
Int -> ReadS GetSensitiveDataOccurrences
ReadS [GetSensitiveDataOccurrences]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSensitiveDataOccurrences]
$creadListPrec :: ReadPrec [GetSensitiveDataOccurrences]
readPrec :: ReadPrec GetSensitiveDataOccurrences
$creadPrec :: ReadPrec GetSensitiveDataOccurrences
readList :: ReadS [GetSensitiveDataOccurrences]
$creadList :: ReadS [GetSensitiveDataOccurrences]
readsPrec :: Int -> ReadS GetSensitiveDataOccurrences
$creadsPrec :: Int -> ReadS GetSensitiveDataOccurrences
Prelude.Read, Int -> GetSensitiveDataOccurrences -> ShowS
[GetSensitiveDataOccurrences] -> ShowS
GetSensitiveDataOccurrences -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSensitiveDataOccurrences] -> ShowS
$cshowList :: [GetSensitiveDataOccurrences] -> ShowS
show :: GetSensitiveDataOccurrences -> String
$cshow :: GetSensitiveDataOccurrences -> String
showsPrec :: Int -> GetSensitiveDataOccurrences -> ShowS
$cshowsPrec :: Int -> GetSensitiveDataOccurrences -> ShowS
Prelude.Show, forall x.
Rep GetSensitiveDataOccurrences x -> GetSensitiveDataOccurrences
forall x.
GetSensitiveDataOccurrences -> Rep GetSensitiveDataOccurrences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSensitiveDataOccurrences x -> GetSensitiveDataOccurrences
$cfrom :: forall x.
GetSensitiveDataOccurrences -> Rep GetSensitiveDataOccurrences x
Prelude.Generic)
newGetSensitiveDataOccurrences ::
Prelude.Text ->
GetSensitiveDataOccurrences
newGetSensitiveDataOccurrences :: Text -> GetSensitiveDataOccurrences
newGetSensitiveDataOccurrences Text
pFindingId_ =
GetSensitiveDataOccurrences'
{ $sel:findingId:GetSensitiveDataOccurrences' :: Text
findingId =
Text
pFindingId_
}
getSensitiveDataOccurrences_findingId :: Lens.Lens' GetSensitiveDataOccurrences Prelude.Text
getSensitiveDataOccurrences_findingId :: Lens' GetSensitiveDataOccurrences Text
getSensitiveDataOccurrences_findingId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSensitiveDataOccurrences' {Text
findingId :: Text
$sel:findingId:GetSensitiveDataOccurrences' :: GetSensitiveDataOccurrences -> Text
findingId} -> Text
findingId) (\s :: GetSensitiveDataOccurrences
s@GetSensitiveDataOccurrences' {} Text
a -> GetSensitiveDataOccurrences
s {$sel:findingId:GetSensitiveDataOccurrences' :: Text
findingId = Text
a} :: GetSensitiveDataOccurrences)
instance Core.AWSRequest GetSensitiveDataOccurrences where
type
AWSResponse GetSensitiveDataOccurrences =
GetSensitiveDataOccurrencesResponse
request :: (Service -> Service)
-> GetSensitiveDataOccurrences
-> Request GetSensitiveDataOccurrences
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 GetSensitiveDataOccurrences
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSensitiveDataOccurrences)))
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 Text
-> Maybe (HashMap Text [DetectedDataDetails])
-> Maybe RevealRequestStatus
-> Int
-> GetSensitiveDataOccurrencesResponse
GetSensitiveDataOccurrencesResponse'
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
"error")
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
"sensitiveDataOccurrences"
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
"status")
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 GetSensitiveDataOccurrences where
hashWithSalt :: Int -> GetSensitiveDataOccurrences -> Int
hashWithSalt Int
_salt GetSensitiveDataOccurrences' {Text
findingId :: Text
$sel:findingId:GetSensitiveDataOccurrences' :: GetSensitiveDataOccurrences -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
findingId
instance Prelude.NFData GetSensitiveDataOccurrences where
rnf :: GetSensitiveDataOccurrences -> ()
rnf GetSensitiveDataOccurrences' {Text
findingId :: Text
$sel:findingId:GetSensitiveDataOccurrences' :: GetSensitiveDataOccurrences -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
findingId
instance Data.ToHeaders GetSensitiveDataOccurrences where
toHeaders :: GetSensitiveDataOccurrences -> 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 GetSensitiveDataOccurrences where
toPath :: GetSensitiveDataOccurrences -> ByteString
toPath GetSensitiveDataOccurrences' {Text
findingId :: Text
$sel:findingId:GetSensitiveDataOccurrences' :: GetSensitiveDataOccurrences -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/findings/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
findingId, ByteString
"/reveal"]
instance Data.ToQuery GetSensitiveDataOccurrences where
toQuery :: GetSensitiveDataOccurrences -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetSensitiveDataOccurrencesResponse = GetSensitiveDataOccurrencesResponse'
{
GetSensitiveDataOccurrencesResponse -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
GetSensitiveDataOccurrencesResponse
-> Maybe (HashMap Text [DetectedDataDetails])
sensitiveDataOccurrences :: Prelude.Maybe (Prelude.HashMap Prelude.Text [DetectedDataDetails]),
GetSensitiveDataOccurrencesResponse -> Maybe RevealRequestStatus
status :: Prelude.Maybe RevealRequestStatus,
GetSensitiveDataOccurrencesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetSensitiveDataOccurrencesResponse
-> GetSensitiveDataOccurrencesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSensitiveDataOccurrencesResponse
-> GetSensitiveDataOccurrencesResponse -> Bool
$c/= :: GetSensitiveDataOccurrencesResponse
-> GetSensitiveDataOccurrencesResponse -> Bool
== :: GetSensitiveDataOccurrencesResponse
-> GetSensitiveDataOccurrencesResponse -> Bool
$c== :: GetSensitiveDataOccurrencesResponse
-> GetSensitiveDataOccurrencesResponse -> Bool
Prelude.Eq, ReadPrec [GetSensitiveDataOccurrencesResponse]
ReadPrec GetSensitiveDataOccurrencesResponse
Int -> ReadS GetSensitiveDataOccurrencesResponse
ReadS [GetSensitiveDataOccurrencesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSensitiveDataOccurrencesResponse]
$creadListPrec :: ReadPrec [GetSensitiveDataOccurrencesResponse]
readPrec :: ReadPrec GetSensitiveDataOccurrencesResponse
$creadPrec :: ReadPrec GetSensitiveDataOccurrencesResponse
readList :: ReadS [GetSensitiveDataOccurrencesResponse]
$creadList :: ReadS [GetSensitiveDataOccurrencesResponse]
readsPrec :: Int -> ReadS GetSensitiveDataOccurrencesResponse
$creadsPrec :: Int -> ReadS GetSensitiveDataOccurrencesResponse
Prelude.Read, Int -> GetSensitiveDataOccurrencesResponse -> ShowS
[GetSensitiveDataOccurrencesResponse] -> ShowS
GetSensitiveDataOccurrencesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSensitiveDataOccurrencesResponse] -> ShowS
$cshowList :: [GetSensitiveDataOccurrencesResponse] -> ShowS
show :: GetSensitiveDataOccurrencesResponse -> String
$cshow :: GetSensitiveDataOccurrencesResponse -> String
showsPrec :: Int -> GetSensitiveDataOccurrencesResponse -> ShowS
$cshowsPrec :: Int -> GetSensitiveDataOccurrencesResponse -> ShowS
Prelude.Show, forall x.
Rep GetSensitiveDataOccurrencesResponse x
-> GetSensitiveDataOccurrencesResponse
forall x.
GetSensitiveDataOccurrencesResponse
-> Rep GetSensitiveDataOccurrencesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSensitiveDataOccurrencesResponse x
-> GetSensitiveDataOccurrencesResponse
$cfrom :: forall x.
GetSensitiveDataOccurrencesResponse
-> Rep GetSensitiveDataOccurrencesResponse x
Prelude.Generic)
newGetSensitiveDataOccurrencesResponse ::
Prelude.Int ->
GetSensitiveDataOccurrencesResponse
newGetSensitiveDataOccurrencesResponse :: Int -> GetSensitiveDataOccurrencesResponse
newGetSensitiveDataOccurrencesResponse Int
pHttpStatus_ =
GetSensitiveDataOccurrencesResponse'
{ $sel:error:GetSensitiveDataOccurrencesResponse' :: Maybe Text
error =
forall a. Maybe a
Prelude.Nothing,
$sel:sensitiveDataOccurrences:GetSensitiveDataOccurrencesResponse' :: Maybe (HashMap Text [DetectedDataDetails])
sensitiveDataOccurrences =
forall a. Maybe a
Prelude.Nothing,
$sel:status:GetSensitiveDataOccurrencesResponse' :: Maybe RevealRequestStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSensitiveDataOccurrencesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getSensitiveDataOccurrencesResponse_error :: Lens.Lens' GetSensitiveDataOccurrencesResponse (Prelude.Maybe Prelude.Text)
getSensitiveDataOccurrencesResponse_error :: Lens' GetSensitiveDataOccurrencesResponse (Maybe Text)
getSensitiveDataOccurrencesResponse_error = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSensitiveDataOccurrencesResponse' {Maybe Text
error :: Maybe Text
$sel:error:GetSensitiveDataOccurrencesResponse' :: GetSensitiveDataOccurrencesResponse -> Maybe Text
error} -> Maybe Text
error) (\s :: GetSensitiveDataOccurrencesResponse
s@GetSensitiveDataOccurrencesResponse' {} Maybe Text
a -> GetSensitiveDataOccurrencesResponse
s {$sel:error:GetSensitiveDataOccurrencesResponse' :: Maybe Text
error = Maybe Text
a} :: GetSensitiveDataOccurrencesResponse)
getSensitiveDataOccurrencesResponse_sensitiveDataOccurrences :: Lens.Lens' GetSensitiveDataOccurrencesResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text [DetectedDataDetails]))
getSensitiveDataOccurrencesResponse_sensitiveDataOccurrences :: Lens'
GetSensitiveDataOccurrencesResponse
(Maybe (HashMap Text [DetectedDataDetails]))
getSensitiveDataOccurrencesResponse_sensitiveDataOccurrences = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSensitiveDataOccurrencesResponse' {Maybe (HashMap Text [DetectedDataDetails])
sensitiveDataOccurrences :: Maybe (HashMap Text [DetectedDataDetails])
$sel:sensitiveDataOccurrences:GetSensitiveDataOccurrencesResponse' :: GetSensitiveDataOccurrencesResponse
-> Maybe (HashMap Text [DetectedDataDetails])
sensitiveDataOccurrences} -> Maybe (HashMap Text [DetectedDataDetails])
sensitiveDataOccurrences) (\s :: GetSensitiveDataOccurrencesResponse
s@GetSensitiveDataOccurrencesResponse' {} Maybe (HashMap Text [DetectedDataDetails])
a -> GetSensitiveDataOccurrencesResponse
s {$sel:sensitiveDataOccurrences:GetSensitiveDataOccurrencesResponse' :: Maybe (HashMap Text [DetectedDataDetails])
sensitiveDataOccurrences = Maybe (HashMap Text [DetectedDataDetails])
a} :: GetSensitiveDataOccurrencesResponse) 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
getSensitiveDataOccurrencesResponse_status :: Lens.Lens' GetSensitiveDataOccurrencesResponse (Prelude.Maybe RevealRequestStatus)
getSensitiveDataOccurrencesResponse_status :: Lens'
GetSensitiveDataOccurrencesResponse (Maybe RevealRequestStatus)
getSensitiveDataOccurrencesResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSensitiveDataOccurrencesResponse' {Maybe RevealRequestStatus
status :: Maybe RevealRequestStatus
$sel:status:GetSensitiveDataOccurrencesResponse' :: GetSensitiveDataOccurrencesResponse -> Maybe RevealRequestStatus
status} -> Maybe RevealRequestStatus
status) (\s :: GetSensitiveDataOccurrencesResponse
s@GetSensitiveDataOccurrencesResponse' {} Maybe RevealRequestStatus
a -> GetSensitiveDataOccurrencesResponse
s {$sel:status:GetSensitiveDataOccurrencesResponse' :: Maybe RevealRequestStatus
status = Maybe RevealRequestStatus
a} :: GetSensitiveDataOccurrencesResponse)
getSensitiveDataOccurrencesResponse_httpStatus :: Lens.Lens' GetSensitiveDataOccurrencesResponse Prelude.Int
getSensitiveDataOccurrencesResponse_httpStatus :: Lens' GetSensitiveDataOccurrencesResponse Int
getSensitiveDataOccurrencesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSensitiveDataOccurrencesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSensitiveDataOccurrencesResponse' :: GetSensitiveDataOccurrencesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSensitiveDataOccurrencesResponse
s@GetSensitiveDataOccurrencesResponse' {} Int
a -> GetSensitiveDataOccurrencesResponse
s {$sel:httpStatus:GetSensitiveDataOccurrencesResponse' :: Int
httpStatus = Int
a} :: GetSensitiveDataOccurrencesResponse)
instance
Prelude.NFData
GetSensitiveDataOccurrencesResponse
where
rnf :: GetSensitiveDataOccurrencesResponse -> ()
rnf GetSensitiveDataOccurrencesResponse' {Int
Maybe Text
Maybe (HashMap Text [DetectedDataDetails])
Maybe RevealRequestStatus
httpStatus :: Int
status :: Maybe RevealRequestStatus
sensitiveDataOccurrences :: Maybe (HashMap Text [DetectedDataDetails])
error :: Maybe Text
$sel:httpStatus:GetSensitiveDataOccurrencesResponse' :: GetSensitiveDataOccurrencesResponse -> Int
$sel:status:GetSensitiveDataOccurrencesResponse' :: GetSensitiveDataOccurrencesResponse -> Maybe RevealRequestStatus
$sel:sensitiveDataOccurrences:GetSensitiveDataOccurrencesResponse' :: GetSensitiveDataOccurrencesResponse
-> Maybe (HashMap Text [DetectedDataDetails])
$sel:error:GetSensitiveDataOccurrencesResponse' :: GetSensitiveDataOccurrencesResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
error
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text [DetectedDataDetails])
sensitiveDataOccurrences
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RevealRequestStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus