{-# 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.SecurityHub.UpdateFindings
(
UpdateFindings (..),
newUpdateFindings,
updateFindings_recordState,
updateFindings_note,
updateFindings_filters,
UpdateFindingsResponse (..),
newUpdateFindingsResponse,
updateFindingsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SecurityHub.Types
data UpdateFindings = UpdateFindings'
{
UpdateFindings -> Maybe RecordState
recordState :: Prelude.Maybe RecordState,
UpdateFindings -> Maybe NoteUpdate
note :: Prelude.Maybe NoteUpdate,
UpdateFindings -> AwsSecurityFindingFilters
filters :: AwsSecurityFindingFilters
}
deriving (UpdateFindings -> UpdateFindings -> Bool
(UpdateFindings -> UpdateFindings -> Bool)
-> (UpdateFindings -> UpdateFindings -> Bool) -> Eq UpdateFindings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFindings -> UpdateFindings -> Bool
$c/= :: UpdateFindings -> UpdateFindings -> Bool
== :: UpdateFindings -> UpdateFindings -> Bool
$c== :: UpdateFindings -> UpdateFindings -> Bool
Prelude.Eq, ReadPrec [UpdateFindings]
ReadPrec UpdateFindings
Int -> ReadS UpdateFindings
ReadS [UpdateFindings]
(Int -> ReadS UpdateFindings)
-> ReadS [UpdateFindings]
-> ReadPrec UpdateFindings
-> ReadPrec [UpdateFindings]
-> Read UpdateFindings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFindings]
$creadListPrec :: ReadPrec [UpdateFindings]
readPrec :: ReadPrec UpdateFindings
$creadPrec :: ReadPrec UpdateFindings
readList :: ReadS [UpdateFindings]
$creadList :: ReadS [UpdateFindings]
readsPrec :: Int -> ReadS UpdateFindings
$creadsPrec :: Int -> ReadS UpdateFindings
Prelude.Read, Int -> UpdateFindings -> ShowS
[UpdateFindings] -> ShowS
UpdateFindings -> String
(Int -> UpdateFindings -> ShowS)
-> (UpdateFindings -> String)
-> ([UpdateFindings] -> ShowS)
-> Show UpdateFindings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFindings] -> ShowS
$cshowList :: [UpdateFindings] -> ShowS
show :: UpdateFindings -> String
$cshow :: UpdateFindings -> String
showsPrec :: Int -> UpdateFindings -> ShowS
$cshowsPrec :: Int -> UpdateFindings -> ShowS
Prelude.Show, (forall x. UpdateFindings -> Rep UpdateFindings x)
-> (forall x. Rep UpdateFindings x -> UpdateFindings)
-> Generic UpdateFindings
forall x. Rep UpdateFindings x -> UpdateFindings
forall x. UpdateFindings -> Rep UpdateFindings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFindings x -> UpdateFindings
$cfrom :: forall x. UpdateFindings -> Rep UpdateFindings x
Prelude.Generic)
newUpdateFindings ::
AwsSecurityFindingFilters ->
UpdateFindings
newUpdateFindings :: AwsSecurityFindingFilters -> UpdateFindings
newUpdateFindings AwsSecurityFindingFilters
pFilters_ =
UpdateFindings' :: Maybe RecordState
-> Maybe NoteUpdate -> AwsSecurityFindingFilters -> UpdateFindings
UpdateFindings'
{ $sel:recordState:UpdateFindings' :: Maybe RecordState
recordState = Maybe RecordState
forall a. Maybe a
Prelude.Nothing,
$sel:note:UpdateFindings' :: Maybe NoteUpdate
note = Maybe NoteUpdate
forall a. Maybe a
Prelude.Nothing,
$sel:filters:UpdateFindings' :: AwsSecurityFindingFilters
filters = AwsSecurityFindingFilters
pFilters_
}
updateFindings_recordState :: Lens.Lens' UpdateFindings (Prelude.Maybe RecordState)
updateFindings_recordState :: (Maybe RecordState -> f (Maybe RecordState))
-> UpdateFindings -> f UpdateFindings
updateFindings_recordState = (UpdateFindings -> Maybe RecordState)
-> (UpdateFindings -> Maybe RecordState -> UpdateFindings)
-> Lens
UpdateFindings
UpdateFindings
(Maybe RecordState)
(Maybe RecordState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindings' {Maybe RecordState
recordState :: Maybe RecordState
$sel:recordState:UpdateFindings' :: UpdateFindings -> Maybe RecordState
recordState} -> Maybe RecordState
recordState) (\s :: UpdateFindings
s@UpdateFindings' {} Maybe RecordState
a -> UpdateFindings
s {$sel:recordState:UpdateFindings' :: Maybe RecordState
recordState = Maybe RecordState
a} :: UpdateFindings)
updateFindings_note :: Lens.Lens' UpdateFindings (Prelude.Maybe NoteUpdate)
updateFindings_note :: (Maybe NoteUpdate -> f (Maybe NoteUpdate))
-> UpdateFindings -> f UpdateFindings
updateFindings_note = (UpdateFindings -> Maybe NoteUpdate)
-> (UpdateFindings -> Maybe NoteUpdate -> UpdateFindings)
-> Lens
UpdateFindings UpdateFindings (Maybe NoteUpdate) (Maybe NoteUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindings' {Maybe NoteUpdate
note :: Maybe NoteUpdate
$sel:note:UpdateFindings' :: UpdateFindings -> Maybe NoteUpdate
note} -> Maybe NoteUpdate
note) (\s :: UpdateFindings
s@UpdateFindings' {} Maybe NoteUpdate
a -> UpdateFindings
s {$sel:note:UpdateFindings' :: Maybe NoteUpdate
note = Maybe NoteUpdate
a} :: UpdateFindings)
updateFindings_filters :: Lens.Lens' UpdateFindings AwsSecurityFindingFilters
updateFindings_filters :: (AwsSecurityFindingFilters -> f AwsSecurityFindingFilters)
-> UpdateFindings -> f UpdateFindings
updateFindings_filters = (UpdateFindings -> AwsSecurityFindingFilters)
-> (UpdateFindings -> AwsSecurityFindingFilters -> UpdateFindings)
-> Lens
UpdateFindings
UpdateFindings
AwsSecurityFindingFilters
AwsSecurityFindingFilters
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindings' {AwsSecurityFindingFilters
filters :: AwsSecurityFindingFilters
$sel:filters:UpdateFindings' :: UpdateFindings -> AwsSecurityFindingFilters
filters} -> AwsSecurityFindingFilters
filters) (\s :: UpdateFindings
s@UpdateFindings' {} AwsSecurityFindingFilters
a -> UpdateFindings
s {$sel:filters:UpdateFindings' :: AwsSecurityFindingFilters
filters = AwsSecurityFindingFilters
a} :: UpdateFindings)
instance Core.AWSRequest UpdateFindings where
type
AWSResponse UpdateFindings =
UpdateFindingsResponse
request :: UpdateFindings -> Request UpdateFindings
request = Service -> UpdateFindings -> Request UpdateFindings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateFindings
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateFindings)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateFindings))
-> Logger
-> Service
-> Proxy UpdateFindings
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateFindings)))
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 -> UpdateFindingsResponse
UpdateFindingsResponse'
(Int -> UpdateFindingsResponse)
-> Either String Int -> Either String UpdateFindingsResponse
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 UpdateFindings
instance Prelude.NFData UpdateFindings
instance Core.ToHeaders UpdateFindings where
toHeaders :: UpdateFindings -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateFindings -> 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 UpdateFindings where
toJSON :: UpdateFindings -> Value
toJSON UpdateFindings' {Maybe NoteUpdate
Maybe RecordState
AwsSecurityFindingFilters
filters :: AwsSecurityFindingFilters
note :: Maybe NoteUpdate
recordState :: Maybe RecordState
$sel:filters:UpdateFindings' :: UpdateFindings -> AwsSecurityFindingFilters
$sel:note:UpdateFindings' :: UpdateFindings -> Maybe NoteUpdate
$sel:recordState:UpdateFindings' :: UpdateFindings -> Maybe RecordState
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RecordState" Text -> RecordState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RecordState -> Pair) -> Maybe RecordState -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecordState
recordState,
(Text
"Note" Text -> NoteUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NoteUpdate -> Pair) -> Maybe NoteUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NoteUpdate
note,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Filters" Text -> AwsSecurityFindingFilters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AwsSecurityFindingFilters
filters)
]
)
instance Core.ToPath UpdateFindings where
toPath :: UpdateFindings -> ByteString
toPath = ByteString -> UpdateFindings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/findings"
instance Core.ToQuery UpdateFindings where
toQuery :: UpdateFindings -> QueryString
toQuery = QueryString -> UpdateFindings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateFindingsResponse = UpdateFindingsResponse'
{
UpdateFindingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateFindingsResponse -> UpdateFindingsResponse -> Bool
(UpdateFindingsResponse -> UpdateFindingsResponse -> Bool)
-> (UpdateFindingsResponse -> UpdateFindingsResponse -> Bool)
-> Eq UpdateFindingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFindingsResponse -> UpdateFindingsResponse -> Bool
$c/= :: UpdateFindingsResponse -> UpdateFindingsResponse -> Bool
== :: UpdateFindingsResponse -> UpdateFindingsResponse -> Bool
$c== :: UpdateFindingsResponse -> UpdateFindingsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFindingsResponse]
ReadPrec UpdateFindingsResponse
Int -> ReadS UpdateFindingsResponse
ReadS [UpdateFindingsResponse]
(Int -> ReadS UpdateFindingsResponse)
-> ReadS [UpdateFindingsResponse]
-> ReadPrec UpdateFindingsResponse
-> ReadPrec [UpdateFindingsResponse]
-> Read UpdateFindingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFindingsResponse]
$creadListPrec :: ReadPrec [UpdateFindingsResponse]
readPrec :: ReadPrec UpdateFindingsResponse
$creadPrec :: ReadPrec UpdateFindingsResponse
readList :: ReadS [UpdateFindingsResponse]
$creadList :: ReadS [UpdateFindingsResponse]
readsPrec :: Int -> ReadS UpdateFindingsResponse
$creadsPrec :: Int -> ReadS UpdateFindingsResponse
Prelude.Read, Int -> UpdateFindingsResponse -> ShowS
[UpdateFindingsResponse] -> ShowS
UpdateFindingsResponse -> String
(Int -> UpdateFindingsResponse -> ShowS)
-> (UpdateFindingsResponse -> String)
-> ([UpdateFindingsResponse] -> ShowS)
-> Show UpdateFindingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFindingsResponse] -> ShowS
$cshowList :: [UpdateFindingsResponse] -> ShowS
show :: UpdateFindingsResponse -> String
$cshow :: UpdateFindingsResponse -> String
showsPrec :: Int -> UpdateFindingsResponse -> ShowS
$cshowsPrec :: Int -> UpdateFindingsResponse -> ShowS
Prelude.Show, (forall x. UpdateFindingsResponse -> Rep UpdateFindingsResponse x)
-> (forall x.
Rep UpdateFindingsResponse x -> UpdateFindingsResponse)
-> Generic UpdateFindingsResponse
forall x. Rep UpdateFindingsResponse x -> UpdateFindingsResponse
forall x. UpdateFindingsResponse -> Rep UpdateFindingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFindingsResponse x -> UpdateFindingsResponse
$cfrom :: forall x. UpdateFindingsResponse -> Rep UpdateFindingsResponse x
Prelude.Generic)
newUpdateFindingsResponse ::
Prelude.Int ->
UpdateFindingsResponse
newUpdateFindingsResponse :: Int -> UpdateFindingsResponse
newUpdateFindingsResponse Int
pHttpStatus_ =
UpdateFindingsResponse' :: Int -> UpdateFindingsResponse
UpdateFindingsResponse' {$sel:httpStatus:UpdateFindingsResponse' :: Int
httpStatus = Int
pHttpStatus_}
updateFindingsResponse_httpStatus :: Lens.Lens' UpdateFindingsResponse Prelude.Int
updateFindingsResponse_httpStatus :: (Int -> f Int)
-> UpdateFindingsResponse -> f UpdateFindingsResponse
updateFindingsResponse_httpStatus = (UpdateFindingsResponse -> Int)
-> (UpdateFindingsResponse -> Int -> UpdateFindingsResponse)
-> Lens UpdateFindingsResponse UpdateFindingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateFindingsResponse' :: UpdateFindingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateFindingsResponse
s@UpdateFindingsResponse' {} Int
a -> UpdateFindingsResponse
s {$sel:httpStatus:UpdateFindingsResponse' :: Int
httpStatus = Int
a} :: UpdateFindingsResponse)
instance Prelude.NFData UpdateFindingsResponse