{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MacieV2.UpdateFindingsFilter
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the criteria and other settings for a findings filter.
module Amazonka.MacieV2.UpdateFindingsFilter
  ( -- * Creating a Request
    UpdateFindingsFilter (..),
    newUpdateFindingsFilter,

    -- * Request Lenses
    updateFindingsFilter_clientToken,
    updateFindingsFilter_findingCriteria,
    updateFindingsFilter_action,
    updateFindingsFilter_name,
    updateFindingsFilter_description,
    updateFindingsFilter_position,
    updateFindingsFilter_id,

    -- * Destructuring the Response
    UpdateFindingsFilterResponse (..),
    newUpdateFindingsFilterResponse,

    -- * Response Lenses
    updateFindingsFilterResponse_arn,
    updateFindingsFilterResponse_id,
    updateFindingsFilterResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateFindingsFilter' smart constructor.
data UpdateFindingsFilter = UpdateFindingsFilter'
  { -- | A unique, case-sensitive token that you provide to ensure the
    -- idempotency of the request.
    UpdateFindingsFilter -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The criteria to use to filter findings.
    UpdateFindingsFilter -> Maybe FindingCriteria
findingCriteria :: Prelude.Maybe FindingCriteria,
    -- | The action to perform on findings that meet the filter criteria
    -- (findingCriteria). Valid values are: ARCHIVE, suppress (automatically
    -- archive) the findings; and, NOOP, don\'t perform any action on the
    -- findings.
    UpdateFindingsFilter -> Maybe FindingsFilterAction
action :: Prelude.Maybe FindingsFilterAction,
    -- | A custom name for the filter. The name must contain at least 3
    -- characters and can contain as many as 64 characters.
    --
    -- We strongly recommend that you avoid including any sensitive data in the
    -- name of a filter. Other users might be able to see the filter\'s name,
    -- depending on the actions that they\'re allowed to perform in Amazon
    -- Macie.
    UpdateFindingsFilter -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A custom description of the filter. The description can contain as many
    -- as 512 characters.
    --
    -- We strongly recommend that you avoid including any sensitive data in the
    -- description of a filter. Other users might be able to see the filter\'s
    -- description, depending on the actions that they\'re allowed to perform
    -- in Amazon Macie.
    UpdateFindingsFilter -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The position of the filter in the list of saved filters on the Amazon
    -- Macie console. This value also determines the order in which the filter
    -- is applied to findings, relative to other filters that are also applied
    -- to the findings.
    UpdateFindingsFilter -> Maybe Int
position :: Prelude.Maybe Prelude.Int,
    -- | The unique identifier for the Amazon Macie resource or account that the
    -- request applies to.
    UpdateFindingsFilter -> Text
id :: Prelude.Text
  }
  deriving (UpdateFindingsFilter -> UpdateFindingsFilter -> Bool
(UpdateFindingsFilter -> UpdateFindingsFilter -> Bool)
-> (UpdateFindingsFilter -> UpdateFindingsFilter -> Bool)
-> Eq UpdateFindingsFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFindingsFilter -> UpdateFindingsFilter -> Bool
$c/= :: UpdateFindingsFilter -> UpdateFindingsFilter -> Bool
== :: UpdateFindingsFilter -> UpdateFindingsFilter -> Bool
$c== :: UpdateFindingsFilter -> UpdateFindingsFilter -> Bool
Prelude.Eq, ReadPrec [UpdateFindingsFilter]
ReadPrec UpdateFindingsFilter
Int -> ReadS UpdateFindingsFilter
ReadS [UpdateFindingsFilter]
(Int -> ReadS UpdateFindingsFilter)
-> ReadS [UpdateFindingsFilter]
-> ReadPrec UpdateFindingsFilter
-> ReadPrec [UpdateFindingsFilter]
-> Read UpdateFindingsFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFindingsFilter]
$creadListPrec :: ReadPrec [UpdateFindingsFilter]
readPrec :: ReadPrec UpdateFindingsFilter
$creadPrec :: ReadPrec UpdateFindingsFilter
readList :: ReadS [UpdateFindingsFilter]
$creadList :: ReadS [UpdateFindingsFilter]
readsPrec :: Int -> ReadS UpdateFindingsFilter
$creadsPrec :: Int -> ReadS UpdateFindingsFilter
Prelude.Read, Int -> UpdateFindingsFilter -> ShowS
[UpdateFindingsFilter] -> ShowS
UpdateFindingsFilter -> String
(Int -> UpdateFindingsFilter -> ShowS)
-> (UpdateFindingsFilter -> String)
-> ([UpdateFindingsFilter] -> ShowS)
-> Show UpdateFindingsFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFindingsFilter] -> ShowS
$cshowList :: [UpdateFindingsFilter] -> ShowS
show :: UpdateFindingsFilter -> String
$cshow :: UpdateFindingsFilter -> String
showsPrec :: Int -> UpdateFindingsFilter -> ShowS
$cshowsPrec :: Int -> UpdateFindingsFilter -> ShowS
Prelude.Show, (forall x. UpdateFindingsFilter -> Rep UpdateFindingsFilter x)
-> (forall x. Rep UpdateFindingsFilter x -> UpdateFindingsFilter)
-> Generic UpdateFindingsFilter
forall x. Rep UpdateFindingsFilter x -> UpdateFindingsFilter
forall x. UpdateFindingsFilter -> Rep UpdateFindingsFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFindingsFilter x -> UpdateFindingsFilter
$cfrom :: forall x. UpdateFindingsFilter -> Rep UpdateFindingsFilter x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFindingsFilter' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientToken', 'updateFindingsFilter_clientToken' - A unique, case-sensitive token that you provide to ensure the
-- idempotency of the request.
--
-- 'findingCriteria', 'updateFindingsFilter_findingCriteria' - The criteria to use to filter findings.
--
-- 'action', 'updateFindingsFilter_action' - The action to perform on findings that meet the filter criteria
-- (findingCriteria). Valid values are: ARCHIVE, suppress (automatically
-- archive) the findings; and, NOOP, don\'t perform any action on the
-- findings.
--
-- 'name', 'updateFindingsFilter_name' - A custom name for the filter. The name must contain at least 3
-- characters and can contain as many as 64 characters.
--
-- We strongly recommend that you avoid including any sensitive data in the
-- name of a filter. Other users might be able to see the filter\'s name,
-- depending on the actions that they\'re allowed to perform in Amazon
-- Macie.
--
-- 'description', 'updateFindingsFilter_description' - A custom description of the filter. The description can contain as many
-- as 512 characters.
--
-- We strongly recommend that you avoid including any sensitive data in the
-- description of a filter. Other users might be able to see the filter\'s
-- description, depending on the actions that they\'re allowed to perform
-- in Amazon Macie.
--
-- 'position', 'updateFindingsFilter_position' - The position of the filter in the list of saved filters on the Amazon
-- Macie console. This value also determines the order in which the filter
-- is applied to findings, relative to other filters that are also applied
-- to the findings.
--
-- 'id', 'updateFindingsFilter_id' - The unique identifier for the Amazon Macie resource or account that the
-- request applies to.
newUpdateFindingsFilter ::
  -- | 'id'
  Prelude.Text ->
  UpdateFindingsFilter
newUpdateFindingsFilter :: Text -> UpdateFindingsFilter
newUpdateFindingsFilter Text
pId_ =
  UpdateFindingsFilter' :: Maybe Text
-> Maybe FindingCriteria
-> Maybe FindingsFilterAction
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> UpdateFindingsFilter
UpdateFindingsFilter'
    { $sel:clientToken:UpdateFindingsFilter' :: Maybe Text
clientToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:findingCriteria:UpdateFindingsFilter' :: Maybe FindingCriteria
findingCriteria = Maybe FindingCriteria
forall a. Maybe a
Prelude.Nothing,
      $sel:action:UpdateFindingsFilter' :: Maybe FindingsFilterAction
action = Maybe FindingsFilterAction
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateFindingsFilter' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateFindingsFilter' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:position:UpdateFindingsFilter' :: Maybe Int
position = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:id:UpdateFindingsFilter' :: Text
id = Text
pId_
    }

-- | A unique, case-sensitive token that you provide to ensure the
-- idempotency of the request.
updateFindingsFilter_clientToken :: Lens.Lens' UpdateFindingsFilter (Prelude.Maybe Prelude.Text)
updateFindingsFilter_clientToken :: (Maybe Text -> f (Maybe Text))
-> UpdateFindingsFilter -> f UpdateFindingsFilter
updateFindingsFilter_clientToken = (UpdateFindingsFilter -> Maybe Text)
-> (UpdateFindingsFilter -> Maybe Text -> UpdateFindingsFilter)
-> Lens
     UpdateFindingsFilter UpdateFindingsFilter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilter' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateFindingsFilter
s@UpdateFindingsFilter' {} Maybe Text
a -> UpdateFindingsFilter
s {$sel:clientToken:UpdateFindingsFilter' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateFindingsFilter)

-- | The criteria to use to filter findings.
updateFindingsFilter_findingCriteria :: Lens.Lens' UpdateFindingsFilter (Prelude.Maybe FindingCriteria)
updateFindingsFilter_findingCriteria :: (Maybe FindingCriteria -> f (Maybe FindingCriteria))
-> UpdateFindingsFilter -> f UpdateFindingsFilter
updateFindingsFilter_findingCriteria = (UpdateFindingsFilter -> Maybe FindingCriteria)
-> (UpdateFindingsFilter
    -> Maybe FindingCriteria -> UpdateFindingsFilter)
-> Lens
     UpdateFindingsFilter
     UpdateFindingsFilter
     (Maybe FindingCriteria)
     (Maybe FindingCriteria)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilter' {Maybe FindingCriteria
findingCriteria :: Maybe FindingCriteria
$sel:findingCriteria:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe FindingCriteria
findingCriteria} -> Maybe FindingCriteria
findingCriteria) (\s :: UpdateFindingsFilter
s@UpdateFindingsFilter' {} Maybe FindingCriteria
a -> UpdateFindingsFilter
s {$sel:findingCriteria:UpdateFindingsFilter' :: Maybe FindingCriteria
findingCriteria = Maybe FindingCriteria
a} :: UpdateFindingsFilter)

-- | The action to perform on findings that meet the filter criteria
-- (findingCriteria). Valid values are: ARCHIVE, suppress (automatically
-- archive) the findings; and, NOOP, don\'t perform any action on the
-- findings.
updateFindingsFilter_action :: Lens.Lens' UpdateFindingsFilter (Prelude.Maybe FindingsFilterAction)
updateFindingsFilter_action :: (Maybe FindingsFilterAction -> f (Maybe FindingsFilterAction))
-> UpdateFindingsFilter -> f UpdateFindingsFilter
updateFindingsFilter_action = (UpdateFindingsFilter -> Maybe FindingsFilterAction)
-> (UpdateFindingsFilter
    -> Maybe FindingsFilterAction -> UpdateFindingsFilter)
-> Lens
     UpdateFindingsFilter
     UpdateFindingsFilter
     (Maybe FindingsFilterAction)
     (Maybe FindingsFilterAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilter' {Maybe FindingsFilterAction
action :: Maybe FindingsFilterAction
$sel:action:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe FindingsFilterAction
action} -> Maybe FindingsFilterAction
action) (\s :: UpdateFindingsFilter
s@UpdateFindingsFilter' {} Maybe FindingsFilterAction
a -> UpdateFindingsFilter
s {$sel:action:UpdateFindingsFilter' :: Maybe FindingsFilterAction
action = Maybe FindingsFilterAction
a} :: UpdateFindingsFilter)

-- | A custom name for the filter. The name must contain at least 3
-- characters and can contain as many as 64 characters.
--
-- We strongly recommend that you avoid including any sensitive data in the
-- name of a filter. Other users might be able to see the filter\'s name,
-- depending on the actions that they\'re allowed to perform in Amazon
-- Macie.
updateFindingsFilter_name :: Lens.Lens' UpdateFindingsFilter (Prelude.Maybe Prelude.Text)
updateFindingsFilter_name :: (Maybe Text -> f (Maybe Text))
-> UpdateFindingsFilter -> f UpdateFindingsFilter
updateFindingsFilter_name = (UpdateFindingsFilter -> Maybe Text)
-> (UpdateFindingsFilter -> Maybe Text -> UpdateFindingsFilter)
-> Lens
     UpdateFindingsFilter UpdateFindingsFilter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilter' {Maybe Text
name :: Maybe Text
$sel:name:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateFindingsFilter
s@UpdateFindingsFilter' {} Maybe Text
a -> UpdateFindingsFilter
s {$sel:name:UpdateFindingsFilter' :: Maybe Text
name = Maybe Text
a} :: UpdateFindingsFilter)

-- | A custom description of the filter. The description can contain as many
-- as 512 characters.
--
-- We strongly recommend that you avoid including any sensitive data in the
-- description of a filter. Other users might be able to see the filter\'s
-- description, depending on the actions that they\'re allowed to perform
-- in Amazon Macie.
updateFindingsFilter_description :: Lens.Lens' UpdateFindingsFilter (Prelude.Maybe Prelude.Text)
updateFindingsFilter_description :: (Maybe Text -> f (Maybe Text))
-> UpdateFindingsFilter -> f UpdateFindingsFilter
updateFindingsFilter_description = (UpdateFindingsFilter -> Maybe Text)
-> (UpdateFindingsFilter -> Maybe Text -> UpdateFindingsFilter)
-> Lens
     UpdateFindingsFilter UpdateFindingsFilter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilter' {Maybe Text
description :: Maybe Text
$sel:description:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateFindingsFilter
s@UpdateFindingsFilter' {} Maybe Text
a -> UpdateFindingsFilter
s {$sel:description:UpdateFindingsFilter' :: Maybe Text
description = Maybe Text
a} :: UpdateFindingsFilter)

-- | The position of the filter in the list of saved filters on the Amazon
-- Macie console. This value also determines the order in which the filter
-- is applied to findings, relative to other filters that are also applied
-- to the findings.
updateFindingsFilter_position :: Lens.Lens' UpdateFindingsFilter (Prelude.Maybe Prelude.Int)
updateFindingsFilter_position :: (Maybe Int -> f (Maybe Int))
-> UpdateFindingsFilter -> f UpdateFindingsFilter
updateFindingsFilter_position = (UpdateFindingsFilter -> Maybe Int)
-> (UpdateFindingsFilter -> Maybe Int -> UpdateFindingsFilter)
-> Lens
     UpdateFindingsFilter UpdateFindingsFilter (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilter' {Maybe Int
position :: Maybe Int
$sel:position:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Int
position} -> Maybe Int
position) (\s :: UpdateFindingsFilter
s@UpdateFindingsFilter' {} Maybe Int
a -> UpdateFindingsFilter
s {$sel:position:UpdateFindingsFilter' :: Maybe Int
position = Maybe Int
a} :: UpdateFindingsFilter)

-- | The unique identifier for the Amazon Macie resource or account that the
-- request applies to.
updateFindingsFilter_id :: Lens.Lens' UpdateFindingsFilter Prelude.Text
updateFindingsFilter_id :: (Text -> f Text) -> UpdateFindingsFilter -> f UpdateFindingsFilter
updateFindingsFilter_id = (UpdateFindingsFilter -> Text)
-> (UpdateFindingsFilter -> Text -> UpdateFindingsFilter)
-> Lens UpdateFindingsFilter UpdateFindingsFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilter' {Text
id :: Text
$sel:id:UpdateFindingsFilter' :: UpdateFindingsFilter -> Text
id} -> Text
id) (\s :: UpdateFindingsFilter
s@UpdateFindingsFilter' {} Text
a -> UpdateFindingsFilter
s {$sel:id:UpdateFindingsFilter' :: Text
id = Text
a} :: UpdateFindingsFilter)

instance Core.AWSRequest UpdateFindingsFilter where
  type
    AWSResponse UpdateFindingsFilter =
      UpdateFindingsFilterResponse
  request :: UpdateFindingsFilter -> Request UpdateFindingsFilter
request = Service -> UpdateFindingsFilter -> Request UpdateFindingsFilter
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateFindingsFilter
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFindingsFilter)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateFindingsFilter))
-> Logger
-> Service
-> Proxy UpdateFindingsFilter
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFindingsFilter)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Text -> Int -> UpdateFindingsFilterResponse
UpdateFindingsFilterResponse'
            (Maybe Text -> Maybe Text -> Int -> UpdateFindingsFilterResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> UpdateFindingsFilterResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"arn")
            Either String (Maybe Text -> Int -> UpdateFindingsFilterResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateFindingsFilterResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"id")
            Either String (Int -> UpdateFindingsFilterResponse)
-> Either String Int -> Either String UpdateFindingsFilterResponse
forall (f :: * -> *) a b. Applicative f => 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 UpdateFindingsFilter

instance Prelude.NFData UpdateFindingsFilter

instance Core.ToHeaders UpdateFindingsFilter where
  toHeaders :: UpdateFindingsFilter -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateFindingsFilter -> 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 UpdateFindingsFilter where
  toJSON :: UpdateFindingsFilter -> Value
toJSON UpdateFindingsFilter' {Maybe Int
Maybe Text
Maybe FindingCriteria
Maybe FindingsFilterAction
Text
id :: Text
position :: Maybe Int
description :: Maybe Text
name :: Maybe Text
action :: Maybe FindingsFilterAction
findingCriteria :: Maybe FindingCriteria
clientToken :: Maybe Text
$sel:id:UpdateFindingsFilter' :: UpdateFindingsFilter -> Text
$sel:position:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Int
$sel:description:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
$sel:name:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
$sel:action:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe FindingsFilterAction
$sel:findingCriteria:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe FindingCriteria
$sel:clientToken:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" 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
clientToken,
            (Text
"findingCriteria" Text -> FindingCriteria -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (FindingCriteria -> Pair) -> Maybe FindingCriteria -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FindingCriteria
findingCriteria,
            (Text
"action" Text -> FindingsFilterAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FindingsFilterAction -> Pair)
-> Maybe FindingsFilterAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FindingsFilterAction
action,
            (Text
"name" 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
name,
            (Text
"description" 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
description,
            (Text
"position" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
position
          ]
      )

instance Core.ToPath UpdateFindingsFilter where
  toPath :: UpdateFindingsFilter -> ByteString
toPath UpdateFindingsFilter' {Maybe Int
Maybe Text
Maybe FindingCriteria
Maybe FindingsFilterAction
Text
id :: Text
position :: Maybe Int
description :: Maybe Text
name :: Maybe Text
action :: Maybe FindingsFilterAction
findingCriteria :: Maybe FindingCriteria
clientToken :: Maybe Text
$sel:id:UpdateFindingsFilter' :: UpdateFindingsFilter -> Text
$sel:position:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Int
$sel:description:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
$sel:name:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
$sel:action:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe FindingsFilterAction
$sel:findingCriteria:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe FindingCriteria
$sel:clientToken:UpdateFindingsFilter' :: UpdateFindingsFilter -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/findingsfilters/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]

instance Core.ToQuery UpdateFindingsFilter where
  toQuery :: UpdateFindingsFilter -> QueryString
toQuery = QueryString -> UpdateFindingsFilter -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateFindingsFilterResponse' smart constructor.
data UpdateFindingsFilterResponse = UpdateFindingsFilterResponse'
  { -- | The Amazon Resource Name (ARN) of the filter that was updated.
    UpdateFindingsFilterResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the filter that was updated.
    UpdateFindingsFilterResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateFindingsFilterResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateFindingsFilterResponse
-> UpdateFindingsFilterResponse -> Bool
(UpdateFindingsFilterResponse
 -> UpdateFindingsFilterResponse -> Bool)
-> (UpdateFindingsFilterResponse
    -> UpdateFindingsFilterResponse -> Bool)
-> Eq UpdateFindingsFilterResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFindingsFilterResponse
-> UpdateFindingsFilterResponse -> Bool
$c/= :: UpdateFindingsFilterResponse
-> UpdateFindingsFilterResponse -> Bool
== :: UpdateFindingsFilterResponse
-> UpdateFindingsFilterResponse -> Bool
$c== :: UpdateFindingsFilterResponse
-> UpdateFindingsFilterResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFindingsFilterResponse]
ReadPrec UpdateFindingsFilterResponse
Int -> ReadS UpdateFindingsFilterResponse
ReadS [UpdateFindingsFilterResponse]
(Int -> ReadS UpdateFindingsFilterResponse)
-> ReadS [UpdateFindingsFilterResponse]
-> ReadPrec UpdateFindingsFilterResponse
-> ReadPrec [UpdateFindingsFilterResponse]
-> Read UpdateFindingsFilterResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFindingsFilterResponse]
$creadListPrec :: ReadPrec [UpdateFindingsFilterResponse]
readPrec :: ReadPrec UpdateFindingsFilterResponse
$creadPrec :: ReadPrec UpdateFindingsFilterResponse
readList :: ReadS [UpdateFindingsFilterResponse]
$creadList :: ReadS [UpdateFindingsFilterResponse]
readsPrec :: Int -> ReadS UpdateFindingsFilterResponse
$creadsPrec :: Int -> ReadS UpdateFindingsFilterResponse
Prelude.Read, Int -> UpdateFindingsFilterResponse -> ShowS
[UpdateFindingsFilterResponse] -> ShowS
UpdateFindingsFilterResponse -> String
(Int -> UpdateFindingsFilterResponse -> ShowS)
-> (UpdateFindingsFilterResponse -> String)
-> ([UpdateFindingsFilterResponse] -> ShowS)
-> Show UpdateFindingsFilterResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFindingsFilterResponse] -> ShowS
$cshowList :: [UpdateFindingsFilterResponse] -> ShowS
show :: UpdateFindingsFilterResponse -> String
$cshow :: UpdateFindingsFilterResponse -> String
showsPrec :: Int -> UpdateFindingsFilterResponse -> ShowS
$cshowsPrec :: Int -> UpdateFindingsFilterResponse -> ShowS
Prelude.Show, (forall x.
 UpdateFindingsFilterResponse -> Rep UpdateFindingsFilterResponse x)
-> (forall x.
    Rep UpdateFindingsFilterResponse x -> UpdateFindingsFilterResponse)
-> Generic UpdateFindingsFilterResponse
forall x.
Rep UpdateFindingsFilterResponse x -> UpdateFindingsFilterResponse
forall x.
UpdateFindingsFilterResponse -> Rep UpdateFindingsFilterResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFindingsFilterResponse x -> UpdateFindingsFilterResponse
$cfrom :: forall x.
UpdateFindingsFilterResponse -> Rep UpdateFindingsFilterResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFindingsFilterResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'arn', 'updateFindingsFilterResponse_arn' - The Amazon Resource Name (ARN) of the filter that was updated.
--
-- 'id', 'updateFindingsFilterResponse_id' - The unique identifier for the filter that was updated.
--
-- 'httpStatus', 'updateFindingsFilterResponse_httpStatus' - The response's http status code.
newUpdateFindingsFilterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateFindingsFilterResponse
newUpdateFindingsFilterResponse :: Int -> UpdateFindingsFilterResponse
newUpdateFindingsFilterResponse Int
pHttpStatus_ =
  UpdateFindingsFilterResponse' :: Maybe Text -> Maybe Text -> Int -> UpdateFindingsFilterResponse
UpdateFindingsFilterResponse'
    { $sel:arn:UpdateFindingsFilterResponse' :: Maybe Text
arn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:UpdateFindingsFilterResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateFindingsFilterResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the filter that was updated.
updateFindingsFilterResponse_arn :: Lens.Lens' UpdateFindingsFilterResponse (Prelude.Maybe Prelude.Text)
updateFindingsFilterResponse_arn :: (Maybe Text -> f (Maybe Text))
-> UpdateFindingsFilterResponse -> f UpdateFindingsFilterResponse
updateFindingsFilterResponse_arn = (UpdateFindingsFilterResponse -> Maybe Text)
-> (UpdateFindingsFilterResponse
    -> Maybe Text -> UpdateFindingsFilterResponse)
-> Lens
     UpdateFindingsFilterResponse
     UpdateFindingsFilterResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilterResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateFindingsFilterResponse' :: UpdateFindingsFilterResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateFindingsFilterResponse
s@UpdateFindingsFilterResponse' {} Maybe Text
a -> UpdateFindingsFilterResponse
s {$sel:arn:UpdateFindingsFilterResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateFindingsFilterResponse)

-- | The unique identifier for the filter that was updated.
updateFindingsFilterResponse_id :: Lens.Lens' UpdateFindingsFilterResponse (Prelude.Maybe Prelude.Text)
updateFindingsFilterResponse_id :: (Maybe Text -> f (Maybe Text))
-> UpdateFindingsFilterResponse -> f UpdateFindingsFilterResponse
updateFindingsFilterResponse_id = (UpdateFindingsFilterResponse -> Maybe Text)
-> (UpdateFindingsFilterResponse
    -> Maybe Text -> UpdateFindingsFilterResponse)
-> Lens
     UpdateFindingsFilterResponse
     UpdateFindingsFilterResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilterResponse' {Maybe Text
id :: Maybe Text
$sel:id:UpdateFindingsFilterResponse' :: UpdateFindingsFilterResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: UpdateFindingsFilterResponse
s@UpdateFindingsFilterResponse' {} Maybe Text
a -> UpdateFindingsFilterResponse
s {$sel:id:UpdateFindingsFilterResponse' :: Maybe Text
id = Maybe Text
a} :: UpdateFindingsFilterResponse)

-- | The response's http status code.
updateFindingsFilterResponse_httpStatus :: Lens.Lens' UpdateFindingsFilterResponse Prelude.Int
updateFindingsFilterResponse_httpStatus :: (Int -> f Int)
-> UpdateFindingsFilterResponse -> f UpdateFindingsFilterResponse
updateFindingsFilterResponse_httpStatus = (UpdateFindingsFilterResponse -> Int)
-> (UpdateFindingsFilterResponse
    -> Int -> UpdateFindingsFilterResponse)
-> Lens
     UpdateFindingsFilterResponse UpdateFindingsFilterResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingsFilterResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateFindingsFilterResponse' :: UpdateFindingsFilterResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateFindingsFilterResponse
s@UpdateFindingsFilterResponse' {} Int
a -> UpdateFindingsFilterResponse
s {$sel:httpStatus:UpdateFindingsFilterResponse' :: Int
httpStatus = Int
a} :: UpdateFindingsFilterResponse)

instance Prelude.NFData UpdateFindingsFilterResponse