{-# 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.UpdateFindingsFeedback
(
UpdateFindingsFeedback (..),
newUpdateFindingsFeedback,
updateFindingsFeedback_comments,
updateFindingsFeedback_detectorId,
updateFindingsFeedback_findingIds,
updateFindingsFeedback_feedback,
UpdateFindingsFeedbackResponse (..),
newUpdateFindingsFeedbackResponse,
updateFindingsFeedbackResponse_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 UpdateFindingsFeedback = UpdateFindingsFeedback'
{
:: Prelude.Maybe Prelude.Text,
UpdateFindingsFeedback -> Text
detectorId :: Prelude.Text,
UpdateFindingsFeedback -> [Text]
findingIds :: [Prelude.Text],
UpdateFindingsFeedback -> Feedback
feedback :: Feedback
}
deriving (UpdateFindingsFeedback -> UpdateFindingsFeedback -> Bool
(UpdateFindingsFeedback -> UpdateFindingsFeedback -> Bool)
-> (UpdateFindingsFeedback -> UpdateFindingsFeedback -> Bool)
-> Eq UpdateFindingsFeedback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFindingsFeedback -> UpdateFindingsFeedback -> Bool
$c/= :: UpdateFindingsFeedback -> UpdateFindingsFeedback -> Bool
== :: UpdateFindingsFeedback -> UpdateFindingsFeedback -> Bool
$c== :: UpdateFindingsFeedback -> UpdateFindingsFeedback -> Bool
Prelude.Eq, ReadPrec [UpdateFindingsFeedback]
ReadPrec UpdateFindingsFeedback
Int -> ReadS UpdateFindingsFeedback
ReadS [UpdateFindingsFeedback]
(Int -> ReadS UpdateFindingsFeedback)
-> ReadS [UpdateFindingsFeedback]
-> ReadPrec UpdateFindingsFeedback
-> ReadPrec [UpdateFindingsFeedback]
-> Read UpdateFindingsFeedback
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFindingsFeedback]
$creadListPrec :: ReadPrec [UpdateFindingsFeedback]
readPrec :: ReadPrec UpdateFindingsFeedback
$creadPrec :: ReadPrec UpdateFindingsFeedback
readList :: ReadS [UpdateFindingsFeedback]
$creadList :: ReadS [UpdateFindingsFeedback]
readsPrec :: Int -> ReadS UpdateFindingsFeedback
$creadsPrec :: Int -> ReadS UpdateFindingsFeedback
Prelude.Read, Int -> UpdateFindingsFeedback -> ShowS
[UpdateFindingsFeedback] -> ShowS
UpdateFindingsFeedback -> String
(Int -> UpdateFindingsFeedback -> ShowS)
-> (UpdateFindingsFeedback -> String)
-> ([UpdateFindingsFeedback] -> ShowS)
-> Show UpdateFindingsFeedback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFindingsFeedback] -> ShowS
$cshowList :: [UpdateFindingsFeedback] -> ShowS
show :: UpdateFindingsFeedback -> String
$cshow :: UpdateFindingsFeedback -> String
showsPrec :: Int -> UpdateFindingsFeedback -> ShowS
$cshowsPrec :: Int -> UpdateFindingsFeedback -> ShowS
Prelude.Show, (forall x. UpdateFindingsFeedback -> Rep UpdateFindingsFeedback x)
-> (forall x.
Rep UpdateFindingsFeedback x -> UpdateFindingsFeedback)
-> Generic UpdateFindingsFeedback
forall x. Rep UpdateFindingsFeedback x -> UpdateFindingsFeedback
forall x. UpdateFindingsFeedback -> Rep UpdateFindingsFeedback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFindingsFeedback x -> UpdateFindingsFeedback
$cfrom :: forall x. UpdateFindingsFeedback -> Rep UpdateFindingsFeedback x
Prelude.Generic)
newUpdateFindingsFeedback ::
Prelude.Text ->
Feedback ->
UpdateFindingsFeedback
newUpdateFindingsFeedback :: Text -> Feedback -> UpdateFindingsFeedback
newUpdateFindingsFeedback Text
pDetectorId_ Feedback
pFeedback_ =
UpdateFindingsFeedback' :: Maybe Text -> Text -> [Text] -> Feedback -> UpdateFindingsFeedback
UpdateFindingsFeedback'
{ $sel:comments:UpdateFindingsFeedback' :: Maybe Text
comments = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:detectorId:UpdateFindingsFeedback' :: Text
detectorId = Text
pDetectorId_,
$sel:findingIds:UpdateFindingsFeedback' :: [Text]
findingIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:feedback:UpdateFindingsFeedback' :: Feedback
feedback = Feedback
pFeedback_
}
updateFindingsFeedback_comments :: Lens.Lens' UpdateFindingsFeedback (Prelude.Maybe Prelude.Text)
= (UpdateFindingsFeedback -> Maybe Text)
-> (UpdateFindingsFeedback -> Maybe Text -> UpdateFindingsFeedback)
-> Lens
UpdateFindingsFeedback
UpdateFindingsFeedback
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFeedback' {Maybe Text
comments :: Maybe Text
$sel:comments:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Maybe Text
comments} -> Maybe Text
comments) (\s :: UpdateFindingsFeedback
s@UpdateFindingsFeedback' {} Maybe Text
a -> UpdateFindingsFeedback
s {$sel:comments:UpdateFindingsFeedback' :: Maybe Text
comments = Maybe Text
a} :: UpdateFindingsFeedback)
updateFindingsFeedback_detectorId :: Lens.Lens' UpdateFindingsFeedback Prelude.Text
updateFindingsFeedback_detectorId :: (Text -> f Text)
-> UpdateFindingsFeedback -> f UpdateFindingsFeedback
updateFindingsFeedback_detectorId = (UpdateFindingsFeedback -> Text)
-> (UpdateFindingsFeedback -> Text -> UpdateFindingsFeedback)
-> Lens UpdateFindingsFeedback UpdateFindingsFeedback Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFeedback' {Text
detectorId :: Text
$sel:detectorId:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Text
detectorId} -> Text
detectorId) (\s :: UpdateFindingsFeedback
s@UpdateFindingsFeedback' {} Text
a -> UpdateFindingsFeedback
s {$sel:detectorId:UpdateFindingsFeedback' :: Text
detectorId = Text
a} :: UpdateFindingsFeedback)
updateFindingsFeedback_findingIds :: Lens.Lens' UpdateFindingsFeedback [Prelude.Text]
updateFindingsFeedback_findingIds :: ([Text] -> f [Text])
-> UpdateFindingsFeedback -> f UpdateFindingsFeedback
updateFindingsFeedback_findingIds = (UpdateFindingsFeedback -> [Text])
-> (UpdateFindingsFeedback -> [Text] -> UpdateFindingsFeedback)
-> Lens UpdateFindingsFeedback UpdateFindingsFeedback [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFeedback' {[Text]
findingIds :: [Text]
$sel:findingIds:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> [Text]
findingIds} -> [Text]
findingIds) (\s :: UpdateFindingsFeedback
s@UpdateFindingsFeedback' {} [Text]
a -> UpdateFindingsFeedback
s {$sel:findingIds:UpdateFindingsFeedback' :: [Text]
findingIds = [Text]
a} :: UpdateFindingsFeedback) (([Text] -> f [Text])
-> UpdateFindingsFeedback -> f UpdateFindingsFeedback)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> UpdateFindingsFeedback
-> f UpdateFindingsFeedback
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
updateFindingsFeedback_feedback :: Lens.Lens' UpdateFindingsFeedback Feedback
updateFindingsFeedback_feedback :: (Feedback -> f Feedback)
-> UpdateFindingsFeedback -> f UpdateFindingsFeedback
updateFindingsFeedback_feedback = (UpdateFindingsFeedback -> Feedback)
-> (UpdateFindingsFeedback -> Feedback -> UpdateFindingsFeedback)
-> Lens
UpdateFindingsFeedback UpdateFindingsFeedback Feedback Feedback
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFeedback' {Feedback
feedback :: Feedback
$sel:feedback:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Feedback
feedback} -> Feedback
feedback) (\s :: UpdateFindingsFeedback
s@UpdateFindingsFeedback' {} Feedback
a -> UpdateFindingsFeedback
s {$sel:feedback:UpdateFindingsFeedback' :: Feedback
feedback = Feedback
a} :: UpdateFindingsFeedback)
instance Core.AWSRequest UpdateFindingsFeedback where
type
AWSResponse UpdateFindingsFeedback =
UpdateFindingsFeedbackResponse
request :: UpdateFindingsFeedback -> Request UpdateFindingsFeedback
request = Service -> UpdateFindingsFeedback -> Request UpdateFindingsFeedback
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateFindingsFeedback
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateFindingsFeedback)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateFindingsFeedback))
-> Logger
-> Service
-> Proxy UpdateFindingsFeedback
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateFindingsFeedback)))
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 -> UpdateFindingsFeedbackResponse
UpdateFindingsFeedbackResponse'
(Int -> UpdateFindingsFeedbackResponse)
-> Either String Int
-> Either String UpdateFindingsFeedbackResponse
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 UpdateFindingsFeedback
instance Prelude.NFData UpdateFindingsFeedback
instance Core.ToHeaders UpdateFindingsFeedback where
toHeaders :: UpdateFindingsFeedback -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateFindingsFeedback -> 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 UpdateFindingsFeedback where
toJSON :: UpdateFindingsFeedback -> Value
toJSON UpdateFindingsFeedback' {[Text]
Maybe Text
Text
Feedback
feedback :: Feedback
findingIds :: [Text]
detectorId :: Text
comments :: Maybe Text
$sel:feedback:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Feedback
$sel:findingIds:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> [Text]
$sel:detectorId:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Text
$sel:comments:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"comments" 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
comments,
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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"feedback" Text -> Feedback -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Feedback
feedback)
]
)
instance Core.ToPath UpdateFindingsFeedback where
toPath :: UpdateFindingsFeedback -> ByteString
toPath UpdateFindingsFeedback' {[Text]
Maybe Text
Text
Feedback
feedback :: Feedback
findingIds :: [Text]
detectorId :: Text
comments :: Maybe Text
$sel:feedback:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Feedback
$sel:findingIds:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> [Text]
$sel:detectorId:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Text
$sel:comments:UpdateFindingsFeedback' :: UpdateFindingsFeedback -> Maybe 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/feedback"
]
instance Core.ToQuery UpdateFindingsFeedback where
toQuery :: UpdateFindingsFeedback -> QueryString
toQuery = QueryString -> UpdateFindingsFeedback -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateFindingsFeedbackResponse = UpdateFindingsFeedbackResponse'
{
UpdateFindingsFeedbackResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateFindingsFeedbackResponse
-> UpdateFindingsFeedbackResponse -> Bool
(UpdateFindingsFeedbackResponse
-> UpdateFindingsFeedbackResponse -> Bool)
-> (UpdateFindingsFeedbackResponse
-> UpdateFindingsFeedbackResponse -> Bool)
-> Eq UpdateFindingsFeedbackResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFindingsFeedbackResponse
-> UpdateFindingsFeedbackResponse -> Bool
$c/= :: UpdateFindingsFeedbackResponse
-> UpdateFindingsFeedbackResponse -> Bool
== :: UpdateFindingsFeedbackResponse
-> UpdateFindingsFeedbackResponse -> Bool
$c== :: UpdateFindingsFeedbackResponse
-> UpdateFindingsFeedbackResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFindingsFeedbackResponse]
ReadPrec UpdateFindingsFeedbackResponse
Int -> ReadS UpdateFindingsFeedbackResponse
ReadS [UpdateFindingsFeedbackResponse]
(Int -> ReadS UpdateFindingsFeedbackResponse)
-> ReadS [UpdateFindingsFeedbackResponse]
-> ReadPrec UpdateFindingsFeedbackResponse
-> ReadPrec [UpdateFindingsFeedbackResponse]
-> Read UpdateFindingsFeedbackResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFindingsFeedbackResponse]
$creadListPrec :: ReadPrec [UpdateFindingsFeedbackResponse]
readPrec :: ReadPrec UpdateFindingsFeedbackResponse
$creadPrec :: ReadPrec UpdateFindingsFeedbackResponse
readList :: ReadS [UpdateFindingsFeedbackResponse]
$creadList :: ReadS [UpdateFindingsFeedbackResponse]
readsPrec :: Int -> ReadS UpdateFindingsFeedbackResponse
$creadsPrec :: Int -> ReadS UpdateFindingsFeedbackResponse
Prelude.Read, Int -> UpdateFindingsFeedbackResponse -> ShowS
[UpdateFindingsFeedbackResponse] -> ShowS
UpdateFindingsFeedbackResponse -> String
(Int -> UpdateFindingsFeedbackResponse -> ShowS)
-> (UpdateFindingsFeedbackResponse -> String)
-> ([UpdateFindingsFeedbackResponse] -> ShowS)
-> Show UpdateFindingsFeedbackResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFindingsFeedbackResponse] -> ShowS
$cshowList :: [UpdateFindingsFeedbackResponse] -> ShowS
show :: UpdateFindingsFeedbackResponse -> String
$cshow :: UpdateFindingsFeedbackResponse -> String
showsPrec :: Int -> UpdateFindingsFeedbackResponse -> ShowS
$cshowsPrec :: Int -> UpdateFindingsFeedbackResponse -> ShowS
Prelude.Show, (forall x.
UpdateFindingsFeedbackResponse
-> Rep UpdateFindingsFeedbackResponse x)
-> (forall x.
Rep UpdateFindingsFeedbackResponse x
-> UpdateFindingsFeedbackResponse)
-> Generic UpdateFindingsFeedbackResponse
forall x.
Rep UpdateFindingsFeedbackResponse x
-> UpdateFindingsFeedbackResponse
forall x.
UpdateFindingsFeedbackResponse
-> Rep UpdateFindingsFeedbackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFindingsFeedbackResponse x
-> UpdateFindingsFeedbackResponse
$cfrom :: forall x.
UpdateFindingsFeedbackResponse
-> Rep UpdateFindingsFeedbackResponse x
Prelude.Generic)
newUpdateFindingsFeedbackResponse ::
Prelude.Int ->
UpdateFindingsFeedbackResponse
newUpdateFindingsFeedbackResponse :: Int -> UpdateFindingsFeedbackResponse
newUpdateFindingsFeedbackResponse Int
pHttpStatus_ =
UpdateFindingsFeedbackResponse' :: Int -> UpdateFindingsFeedbackResponse
UpdateFindingsFeedbackResponse'
{ $sel:httpStatus:UpdateFindingsFeedbackResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateFindingsFeedbackResponse_httpStatus :: Lens.Lens' UpdateFindingsFeedbackResponse Prelude.Int
updateFindingsFeedbackResponse_httpStatus :: (Int -> f Int)
-> UpdateFindingsFeedbackResponse
-> f UpdateFindingsFeedbackResponse
updateFindingsFeedbackResponse_httpStatus = (UpdateFindingsFeedbackResponse -> Int)
-> (UpdateFindingsFeedbackResponse
-> Int -> UpdateFindingsFeedbackResponse)
-> Lens
UpdateFindingsFeedbackResponse
UpdateFindingsFeedbackResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFeedbackResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateFindingsFeedbackResponse' :: UpdateFindingsFeedbackResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateFindingsFeedbackResponse
s@UpdateFindingsFeedbackResponse' {} Int
a -> UpdateFindingsFeedbackResponse
s {$sel:httpStatus:UpdateFindingsFeedbackResponse' :: Int
httpStatus = Int
a} :: UpdateFindingsFeedbackResponse)
instance
Prelude.NFData
UpdateFindingsFeedbackResponse