{-# 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.Inspector.RemoveAttributesFromFindings
(
RemoveAttributesFromFindings (..),
newRemoveAttributesFromFindings,
removeAttributesFromFindings_findingArns,
removeAttributesFromFindings_attributeKeys,
RemoveAttributesFromFindingsResponse (..),
newRemoveAttributesFromFindingsResponse,
removeAttributesFromFindingsResponse_httpStatus,
removeAttributesFromFindingsResponse_failedItems,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RemoveAttributesFromFindings = RemoveAttributesFromFindings'
{
RemoveAttributesFromFindings -> NonEmpty Text
findingArns :: Prelude.NonEmpty Prelude.Text,
RemoveAttributesFromFindings -> [Text]
attributeKeys :: [Prelude.Text]
}
deriving (RemoveAttributesFromFindings
-> RemoveAttributesFromFindings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveAttributesFromFindings
-> RemoveAttributesFromFindings -> Bool
$c/= :: RemoveAttributesFromFindings
-> RemoveAttributesFromFindings -> Bool
== :: RemoveAttributesFromFindings
-> RemoveAttributesFromFindings -> Bool
$c== :: RemoveAttributesFromFindings
-> RemoveAttributesFromFindings -> Bool
Prelude.Eq, ReadPrec [RemoveAttributesFromFindings]
ReadPrec RemoveAttributesFromFindings
Int -> ReadS RemoveAttributesFromFindings
ReadS [RemoveAttributesFromFindings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveAttributesFromFindings]
$creadListPrec :: ReadPrec [RemoveAttributesFromFindings]
readPrec :: ReadPrec RemoveAttributesFromFindings
$creadPrec :: ReadPrec RemoveAttributesFromFindings
readList :: ReadS [RemoveAttributesFromFindings]
$creadList :: ReadS [RemoveAttributesFromFindings]
readsPrec :: Int -> ReadS RemoveAttributesFromFindings
$creadsPrec :: Int -> ReadS RemoveAttributesFromFindings
Prelude.Read, Int -> RemoveAttributesFromFindings -> ShowS
[RemoveAttributesFromFindings] -> ShowS
RemoveAttributesFromFindings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveAttributesFromFindings] -> ShowS
$cshowList :: [RemoveAttributesFromFindings] -> ShowS
show :: RemoveAttributesFromFindings -> String
$cshow :: RemoveAttributesFromFindings -> String
showsPrec :: Int -> RemoveAttributesFromFindings -> ShowS
$cshowsPrec :: Int -> RemoveAttributesFromFindings -> ShowS
Prelude.Show, forall x.
Rep RemoveAttributesFromFindings x -> RemoveAttributesFromFindings
forall x.
RemoveAttributesFromFindings -> Rep RemoveAttributesFromFindings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveAttributesFromFindings x -> RemoveAttributesFromFindings
$cfrom :: forall x.
RemoveAttributesFromFindings -> Rep RemoveAttributesFromFindings x
Prelude.Generic)
newRemoveAttributesFromFindings ::
Prelude.NonEmpty Prelude.Text ->
RemoveAttributesFromFindings
newRemoveAttributesFromFindings :: NonEmpty Text -> RemoveAttributesFromFindings
newRemoveAttributesFromFindings NonEmpty Text
pFindingArns_ =
RemoveAttributesFromFindings'
{ $sel:findingArns:RemoveAttributesFromFindings' :: NonEmpty Text
findingArns =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pFindingArns_,
$sel:attributeKeys:RemoveAttributesFromFindings' :: [Text]
attributeKeys = forall a. Monoid a => a
Prelude.mempty
}
removeAttributesFromFindings_findingArns :: Lens.Lens' RemoveAttributesFromFindings (Prelude.NonEmpty Prelude.Text)
removeAttributesFromFindings_findingArns :: Lens' RemoveAttributesFromFindings (NonEmpty Text)
removeAttributesFromFindings_findingArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveAttributesFromFindings' {NonEmpty Text
findingArns :: NonEmpty Text
$sel:findingArns:RemoveAttributesFromFindings' :: RemoveAttributesFromFindings -> NonEmpty Text
findingArns} -> NonEmpty Text
findingArns) (\s :: RemoveAttributesFromFindings
s@RemoveAttributesFromFindings' {} NonEmpty Text
a -> RemoveAttributesFromFindings
s {$sel:findingArns:RemoveAttributesFromFindings' :: NonEmpty Text
findingArns = NonEmpty Text
a} :: RemoveAttributesFromFindings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
removeAttributesFromFindings_attributeKeys :: Lens.Lens' RemoveAttributesFromFindings [Prelude.Text]
removeAttributesFromFindings_attributeKeys :: Lens' RemoveAttributesFromFindings [Text]
removeAttributesFromFindings_attributeKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveAttributesFromFindings' {[Text]
attributeKeys :: [Text]
$sel:attributeKeys:RemoveAttributesFromFindings' :: RemoveAttributesFromFindings -> [Text]
attributeKeys} -> [Text]
attributeKeys) (\s :: RemoveAttributesFromFindings
s@RemoveAttributesFromFindings' {} [Text]
a -> RemoveAttributesFromFindings
s {$sel:attributeKeys:RemoveAttributesFromFindings' :: [Text]
attributeKeys = [Text]
a} :: RemoveAttributesFromFindings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest RemoveAttributesFromFindings where
type
AWSResponse RemoveAttributesFromFindings =
RemoveAttributesFromFindingsResponse
request :: (Service -> Service)
-> RemoveAttributesFromFindings
-> Request RemoveAttributesFromFindings
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy RemoveAttributesFromFindings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveAttributesFromFindings)))
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 ->
Int
-> HashMap Text FailedItemDetails
-> RemoveAttributesFromFindingsResponse
RemoveAttributesFromFindingsResponse'
forall (f :: * -> *) a b. Functor 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))
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
"failedItems" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance
Prelude.Hashable
RemoveAttributesFromFindings
where
hashWithSalt :: Int -> RemoveAttributesFromFindings -> Int
hashWithSalt Int
_salt RemoveAttributesFromFindings' {[Text]
NonEmpty Text
attributeKeys :: [Text]
findingArns :: NonEmpty Text
$sel:attributeKeys:RemoveAttributesFromFindings' :: RemoveAttributesFromFindings -> [Text]
$sel:findingArns:RemoveAttributesFromFindings' :: RemoveAttributesFromFindings -> NonEmpty Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
findingArns
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
attributeKeys
instance Prelude.NFData RemoveAttributesFromFindings where
rnf :: RemoveAttributesFromFindings -> ()
rnf RemoveAttributesFromFindings' {[Text]
NonEmpty Text
attributeKeys :: [Text]
findingArns :: NonEmpty Text
$sel:attributeKeys:RemoveAttributesFromFindings' :: RemoveAttributesFromFindings -> [Text]
$sel:findingArns:RemoveAttributesFromFindings' :: RemoveAttributesFromFindings -> NonEmpty Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
findingArns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
attributeKeys
instance Data.ToHeaders RemoveAttributesFromFindings where
toHeaders :: RemoveAttributesFromFindings -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"InspectorService.RemoveAttributesFromFindings" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON RemoveAttributesFromFindings where
toJSON :: RemoveAttributesFromFindings -> Value
toJSON RemoveAttributesFromFindings' {[Text]
NonEmpty Text
attributeKeys :: [Text]
findingArns :: NonEmpty Text
$sel:attributeKeys:RemoveAttributesFromFindings' :: RemoveAttributesFromFindings -> [Text]
$sel:findingArns:RemoveAttributesFromFindings' :: RemoveAttributesFromFindings -> NonEmpty Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"findingArns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
findingArns),
forall a. a -> Maybe a
Prelude.Just
(Key
"attributeKeys" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
attributeKeys)
]
)
instance Data.ToPath RemoveAttributesFromFindings where
toPath :: RemoveAttributesFromFindings -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery RemoveAttributesFromFindings where
toQuery :: RemoveAttributesFromFindings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data RemoveAttributesFromFindingsResponse = RemoveAttributesFromFindingsResponse'
{
RemoveAttributesFromFindingsResponse -> Int
httpStatus :: Prelude.Int,
RemoveAttributesFromFindingsResponse
-> HashMap Text FailedItemDetails
failedItems :: Prelude.HashMap Prelude.Text FailedItemDetails
}
deriving (RemoveAttributesFromFindingsResponse
-> RemoveAttributesFromFindingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveAttributesFromFindingsResponse
-> RemoveAttributesFromFindingsResponse -> Bool
$c/= :: RemoveAttributesFromFindingsResponse
-> RemoveAttributesFromFindingsResponse -> Bool
== :: RemoveAttributesFromFindingsResponse
-> RemoveAttributesFromFindingsResponse -> Bool
$c== :: RemoveAttributesFromFindingsResponse
-> RemoveAttributesFromFindingsResponse -> Bool
Prelude.Eq, ReadPrec [RemoveAttributesFromFindingsResponse]
ReadPrec RemoveAttributesFromFindingsResponse
Int -> ReadS RemoveAttributesFromFindingsResponse
ReadS [RemoveAttributesFromFindingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveAttributesFromFindingsResponse]
$creadListPrec :: ReadPrec [RemoveAttributesFromFindingsResponse]
readPrec :: ReadPrec RemoveAttributesFromFindingsResponse
$creadPrec :: ReadPrec RemoveAttributesFromFindingsResponse
readList :: ReadS [RemoveAttributesFromFindingsResponse]
$creadList :: ReadS [RemoveAttributesFromFindingsResponse]
readsPrec :: Int -> ReadS RemoveAttributesFromFindingsResponse
$creadsPrec :: Int -> ReadS RemoveAttributesFromFindingsResponse
Prelude.Read, Int -> RemoveAttributesFromFindingsResponse -> ShowS
[RemoveAttributesFromFindingsResponse] -> ShowS
RemoveAttributesFromFindingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveAttributesFromFindingsResponse] -> ShowS
$cshowList :: [RemoveAttributesFromFindingsResponse] -> ShowS
show :: RemoveAttributesFromFindingsResponse -> String
$cshow :: RemoveAttributesFromFindingsResponse -> String
showsPrec :: Int -> RemoveAttributesFromFindingsResponse -> ShowS
$cshowsPrec :: Int -> RemoveAttributesFromFindingsResponse -> ShowS
Prelude.Show, forall x.
Rep RemoveAttributesFromFindingsResponse x
-> RemoveAttributesFromFindingsResponse
forall x.
RemoveAttributesFromFindingsResponse
-> Rep RemoveAttributesFromFindingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveAttributesFromFindingsResponse x
-> RemoveAttributesFromFindingsResponse
$cfrom :: forall x.
RemoveAttributesFromFindingsResponse
-> Rep RemoveAttributesFromFindingsResponse x
Prelude.Generic)
newRemoveAttributesFromFindingsResponse ::
Prelude.Int ->
RemoveAttributesFromFindingsResponse
newRemoveAttributesFromFindingsResponse :: Int -> RemoveAttributesFromFindingsResponse
newRemoveAttributesFromFindingsResponse Int
pHttpStatus_ =
RemoveAttributesFromFindingsResponse'
{ $sel:httpStatus:RemoveAttributesFromFindingsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:failedItems:RemoveAttributesFromFindingsResponse' :: HashMap Text FailedItemDetails
failedItems = forall a. Monoid a => a
Prelude.mempty
}
removeAttributesFromFindingsResponse_httpStatus :: Lens.Lens' RemoveAttributesFromFindingsResponse Prelude.Int
removeAttributesFromFindingsResponse_httpStatus :: Lens' RemoveAttributesFromFindingsResponse Int
removeAttributesFromFindingsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveAttributesFromFindingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:RemoveAttributesFromFindingsResponse' :: RemoveAttributesFromFindingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RemoveAttributesFromFindingsResponse
s@RemoveAttributesFromFindingsResponse' {} Int
a -> RemoveAttributesFromFindingsResponse
s {$sel:httpStatus:RemoveAttributesFromFindingsResponse' :: Int
httpStatus = Int
a} :: RemoveAttributesFromFindingsResponse)
removeAttributesFromFindingsResponse_failedItems :: Lens.Lens' RemoveAttributesFromFindingsResponse (Prelude.HashMap Prelude.Text FailedItemDetails)
removeAttributesFromFindingsResponse_failedItems :: Lens'
RemoveAttributesFromFindingsResponse
(HashMap Text FailedItemDetails)
removeAttributesFromFindingsResponse_failedItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveAttributesFromFindingsResponse' {HashMap Text FailedItemDetails
failedItems :: HashMap Text FailedItemDetails
$sel:failedItems:RemoveAttributesFromFindingsResponse' :: RemoveAttributesFromFindingsResponse
-> HashMap Text FailedItemDetails
failedItems} -> HashMap Text FailedItemDetails
failedItems) (\s :: RemoveAttributesFromFindingsResponse
s@RemoveAttributesFromFindingsResponse' {} HashMap Text FailedItemDetails
a -> RemoveAttributesFromFindingsResponse
s {$sel:failedItems:RemoveAttributesFromFindingsResponse' :: HashMap Text FailedItemDetails
failedItems = HashMap Text FailedItemDetails
a} :: RemoveAttributesFromFindingsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
RemoveAttributesFromFindingsResponse
where
rnf :: RemoveAttributesFromFindingsResponse -> ()
rnf RemoveAttributesFromFindingsResponse' {Int
HashMap Text FailedItemDetails
failedItems :: HashMap Text FailedItemDetails
httpStatus :: Int
$sel:failedItems:RemoveAttributesFromFindingsResponse' :: RemoveAttributesFromFindingsResponse
-> HashMap Text FailedItemDetails
$sel:httpStatus:RemoveAttributesFromFindingsResponse' :: RemoveAttributesFromFindingsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text FailedItemDetails
failedItems