{-# 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.GuardDuty.UnarchiveFindings
(
UnarchiveFindings (..),
newUnarchiveFindings,
unarchiveFindings_detectorId,
unarchiveFindings_findingIds,
UnarchiveFindingsResponse (..),
newUnarchiveFindingsResponse,
unarchiveFindingsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.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 UnarchiveFindings = UnarchiveFindings'
{
UnarchiveFindings -> Text
detectorId :: Prelude.Text,
UnarchiveFindings -> [Text]
findingIds :: [Prelude.Text]
}
deriving (UnarchiveFindings -> UnarchiveFindings -> Bool
(UnarchiveFindings -> UnarchiveFindings -> Bool)
-> (UnarchiveFindings -> UnarchiveFindings -> Bool)
-> Eq UnarchiveFindings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnarchiveFindings -> UnarchiveFindings -> Bool
$c/= :: UnarchiveFindings -> UnarchiveFindings -> Bool
== :: UnarchiveFindings -> UnarchiveFindings -> Bool
$c== :: UnarchiveFindings -> UnarchiveFindings -> Bool
Prelude.Eq, ReadPrec [UnarchiveFindings]
ReadPrec UnarchiveFindings
Int -> ReadS UnarchiveFindings
ReadS [UnarchiveFindings]
(Int -> ReadS UnarchiveFindings)
-> ReadS [UnarchiveFindings]
-> ReadPrec UnarchiveFindings
-> ReadPrec [UnarchiveFindings]
-> Read UnarchiveFindings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnarchiveFindings]
$creadListPrec :: ReadPrec [UnarchiveFindings]
readPrec :: ReadPrec UnarchiveFindings
$creadPrec :: ReadPrec UnarchiveFindings
readList :: ReadS [UnarchiveFindings]
$creadList :: ReadS [UnarchiveFindings]
readsPrec :: Int -> ReadS UnarchiveFindings
$creadsPrec :: Int -> ReadS UnarchiveFindings
Prelude.Read, Int -> UnarchiveFindings -> ShowS
[UnarchiveFindings] -> ShowS
UnarchiveFindings -> String
(Int -> UnarchiveFindings -> ShowS)
-> (UnarchiveFindings -> String)
-> ([UnarchiveFindings] -> ShowS)
-> Show UnarchiveFindings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnarchiveFindings] -> ShowS
$cshowList :: [UnarchiveFindings] -> ShowS
show :: UnarchiveFindings -> String
$cshow :: UnarchiveFindings -> String
showsPrec :: Int -> UnarchiveFindings -> ShowS
$cshowsPrec :: Int -> UnarchiveFindings -> ShowS
Prelude.Show, (forall x. UnarchiveFindings -> Rep UnarchiveFindings x)
-> (forall x. Rep UnarchiveFindings x -> UnarchiveFindings)
-> Generic UnarchiveFindings
forall x. Rep UnarchiveFindings x -> UnarchiveFindings
forall x. UnarchiveFindings -> Rep UnarchiveFindings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnarchiveFindings x -> UnarchiveFindings
$cfrom :: forall x. UnarchiveFindings -> Rep UnarchiveFindings x
Prelude.Generic)
newUnarchiveFindings ::
Prelude.Text ->
UnarchiveFindings
newUnarchiveFindings :: Text -> UnarchiveFindings
newUnarchiveFindings Text
pDetectorId_ =
UnarchiveFindings' :: Text -> [Text] -> UnarchiveFindings
UnarchiveFindings'
{ $sel:detectorId:UnarchiveFindings' :: Text
detectorId = Text
pDetectorId_,
$sel:findingIds:UnarchiveFindings' :: [Text]
findingIds = [Text]
forall a. Monoid a => a
Prelude.mempty
}
unarchiveFindings_detectorId :: Lens.Lens' UnarchiveFindings Prelude.Text
unarchiveFindings_detectorId :: (Text -> f Text) -> UnarchiveFindings -> f UnarchiveFindings
unarchiveFindings_detectorId = (UnarchiveFindings -> Text)
-> (UnarchiveFindings -> Text -> UnarchiveFindings)
-> Lens UnarchiveFindings UnarchiveFindings Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnarchiveFindings' {Text
detectorId :: Text
$sel:detectorId:UnarchiveFindings' :: UnarchiveFindings -> Text
detectorId} -> Text
detectorId) (\s :: UnarchiveFindings
s@UnarchiveFindings' {} Text
a -> UnarchiveFindings
s {$sel:detectorId:UnarchiveFindings' :: Text
detectorId = Text
a} :: UnarchiveFindings)
unarchiveFindings_findingIds :: Lens.Lens' UnarchiveFindings [Prelude.Text]
unarchiveFindings_findingIds :: ([Text] -> f [Text]) -> UnarchiveFindings -> f UnarchiveFindings
unarchiveFindings_findingIds = (UnarchiveFindings -> [Text])
-> (UnarchiveFindings -> [Text] -> UnarchiveFindings)
-> Lens UnarchiveFindings UnarchiveFindings [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnarchiveFindings' {[Text]
findingIds :: [Text]
$sel:findingIds:UnarchiveFindings' :: UnarchiveFindings -> [Text]
findingIds} -> [Text]
findingIds) (\s :: UnarchiveFindings
s@UnarchiveFindings' {} [Text]
a -> UnarchiveFindings
s {$sel:findingIds:UnarchiveFindings' :: [Text]
findingIds = [Text]
a} :: UnarchiveFindings) (([Text] -> f [Text]) -> UnarchiveFindings -> f UnarchiveFindings)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> UnarchiveFindings
-> f UnarchiveFindings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UnarchiveFindings where
type
AWSResponse UnarchiveFindings =
UnarchiveFindingsResponse
request :: UnarchiveFindings -> Request UnarchiveFindings
request = Service -> UnarchiveFindings -> Request UnarchiveFindings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UnarchiveFindings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UnarchiveFindings)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UnarchiveFindings))
-> Logger
-> Service
-> Proxy UnarchiveFindings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UnarchiveFindings)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UnarchiveFindingsResponse
UnarchiveFindingsResponse'
(Int -> UnarchiveFindingsResponse)
-> Either String Int -> Either String UnarchiveFindingsResponse
forall (f :: * -> *) a b. Functor 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 UnarchiveFindings
instance Prelude.NFData UnarchiveFindings
instance Core.ToHeaders UnarchiveFindings where
toHeaders :: UnarchiveFindings -> ResponseHeaders
toHeaders =
ResponseHeaders -> UnarchiveFindings -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 UnarchiveFindings where
toJSON :: UnarchiveFindings -> Value
toJSON UnarchiveFindings' {[Text]
Text
findingIds :: [Text]
detectorId :: Text
$sel:findingIds:UnarchiveFindings' :: UnarchiveFindings -> [Text]
$sel:detectorId:UnarchiveFindings' :: UnarchiveFindings -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"findingIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
findingIds)]
)
instance Core.ToPath UnarchiveFindings where
toPath :: UnarchiveFindings -> ByteString
toPath UnarchiveFindings' {[Text]
Text
findingIds :: [Text]
detectorId :: Text
$sel:findingIds:UnarchiveFindings' :: UnarchiveFindings -> [Text]
$sel:detectorId:UnarchiveFindings' :: UnarchiveFindings -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/detector/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
detectorId,
ByteString
"/findings/unarchive"
]
instance Core.ToQuery UnarchiveFindings where
toQuery :: UnarchiveFindings -> QueryString
toQuery = QueryString -> UnarchiveFindings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UnarchiveFindingsResponse = UnarchiveFindingsResponse'
{
UnarchiveFindingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UnarchiveFindingsResponse -> UnarchiveFindingsResponse -> Bool
(UnarchiveFindingsResponse -> UnarchiveFindingsResponse -> Bool)
-> (UnarchiveFindingsResponse -> UnarchiveFindingsResponse -> Bool)
-> Eq UnarchiveFindingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnarchiveFindingsResponse -> UnarchiveFindingsResponse -> Bool
$c/= :: UnarchiveFindingsResponse -> UnarchiveFindingsResponse -> Bool
== :: UnarchiveFindingsResponse -> UnarchiveFindingsResponse -> Bool
$c== :: UnarchiveFindingsResponse -> UnarchiveFindingsResponse -> Bool
Prelude.Eq, ReadPrec [UnarchiveFindingsResponse]
ReadPrec UnarchiveFindingsResponse
Int -> ReadS UnarchiveFindingsResponse
ReadS [UnarchiveFindingsResponse]
(Int -> ReadS UnarchiveFindingsResponse)
-> ReadS [UnarchiveFindingsResponse]
-> ReadPrec UnarchiveFindingsResponse
-> ReadPrec [UnarchiveFindingsResponse]
-> Read UnarchiveFindingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnarchiveFindingsResponse]
$creadListPrec :: ReadPrec [UnarchiveFindingsResponse]
readPrec :: ReadPrec UnarchiveFindingsResponse
$creadPrec :: ReadPrec UnarchiveFindingsResponse
readList :: ReadS [UnarchiveFindingsResponse]
$creadList :: ReadS [UnarchiveFindingsResponse]
readsPrec :: Int -> ReadS UnarchiveFindingsResponse
$creadsPrec :: Int -> ReadS UnarchiveFindingsResponse
Prelude.Read, Int -> UnarchiveFindingsResponse -> ShowS
[UnarchiveFindingsResponse] -> ShowS
UnarchiveFindingsResponse -> String
(Int -> UnarchiveFindingsResponse -> ShowS)
-> (UnarchiveFindingsResponse -> String)
-> ([UnarchiveFindingsResponse] -> ShowS)
-> Show UnarchiveFindingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnarchiveFindingsResponse] -> ShowS
$cshowList :: [UnarchiveFindingsResponse] -> ShowS
show :: UnarchiveFindingsResponse -> String
$cshow :: UnarchiveFindingsResponse -> String
showsPrec :: Int -> UnarchiveFindingsResponse -> ShowS
$cshowsPrec :: Int -> UnarchiveFindingsResponse -> ShowS
Prelude.Show, (forall x.
UnarchiveFindingsResponse -> Rep UnarchiveFindingsResponse x)
-> (forall x.
Rep UnarchiveFindingsResponse x -> UnarchiveFindingsResponse)
-> Generic UnarchiveFindingsResponse
forall x.
Rep UnarchiveFindingsResponse x -> UnarchiveFindingsResponse
forall x.
UnarchiveFindingsResponse -> Rep UnarchiveFindingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UnarchiveFindingsResponse x -> UnarchiveFindingsResponse
$cfrom :: forall x.
UnarchiveFindingsResponse -> Rep UnarchiveFindingsResponse x
Prelude.Generic)
newUnarchiveFindingsResponse ::
Prelude.Int ->
UnarchiveFindingsResponse
newUnarchiveFindingsResponse :: Int -> UnarchiveFindingsResponse
newUnarchiveFindingsResponse Int
pHttpStatus_ =
UnarchiveFindingsResponse' :: Int -> UnarchiveFindingsResponse
UnarchiveFindingsResponse'
{ $sel:httpStatus:UnarchiveFindingsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
unarchiveFindingsResponse_httpStatus :: Lens.Lens' UnarchiveFindingsResponse Prelude.Int
unarchiveFindingsResponse_httpStatus :: (Int -> f Int)
-> UnarchiveFindingsResponse -> f UnarchiveFindingsResponse
unarchiveFindingsResponse_httpStatus = (UnarchiveFindingsResponse -> Int)
-> (UnarchiveFindingsResponse -> Int -> UnarchiveFindingsResponse)
-> Lens UnarchiveFindingsResponse UnarchiveFindingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnarchiveFindingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UnarchiveFindingsResponse' :: UnarchiveFindingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UnarchiveFindingsResponse
s@UnarchiveFindingsResponse' {} Int
a -> UnarchiveFindingsResponse
s {$sel:httpStatus:UnarchiveFindingsResponse' :: Int
httpStatus = Int
a} :: UnarchiveFindingsResponse)
instance Prelude.NFData UnarchiveFindingsResponse