{-# 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.SecurityHub.UpdateFindingAggregator
-- 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 finding aggregation configuration. Used to update the Region
-- linking mode and the list of included or excluded Regions. You cannot
-- use @UpdateFindingAggregator@ to change the aggregation Region.
--
-- You must run @UpdateFindingAggregator@ from the current aggregation
-- Region.
module Amazonka.SecurityHub.UpdateFindingAggregator
  ( -- * Creating a Request
    UpdateFindingAggregator (..),
    newUpdateFindingAggregator,

    -- * Request Lenses
    updateFindingAggregator_regions,
    updateFindingAggregator_findingAggregatorArn,
    updateFindingAggregator_regionLinkingMode,

    -- * Destructuring the Response
    UpdateFindingAggregatorResponse (..),
    newUpdateFindingAggregatorResponse,

    -- * Response Lenses
    updateFindingAggregatorResponse_regions,
    updateFindingAggregatorResponse_findingAggregatorArn,
    updateFindingAggregatorResponse_regionLinkingMode,
    updateFindingAggregatorResponse_findingAggregationRegion,
    updateFindingAggregatorResponse_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

-- | /See:/ 'newUpdateFindingAggregator' smart constructor.
data UpdateFindingAggregator = UpdateFindingAggregator'
  { -- | If @RegionLinkingMode@ is @ALL_REGIONS_EXCEPT_SPECIFIED@, then this is a
    -- comma-separated list of Regions that do not aggregate findings to the
    -- aggregation Region.
    --
    -- If @RegionLinkingMode@ is @SPECIFIED_REGIONS@, then this is a
    -- comma-separated list of Regions that do aggregate findings to the
    -- aggregation Region.
    UpdateFindingAggregator -> Maybe [Text]
regions :: Prelude.Maybe [Prelude.Text],
    -- | The ARN of the finding aggregator. To obtain the ARN, use
    -- @ListFindingAggregators@.
    UpdateFindingAggregator -> Text
findingAggregatorArn :: Prelude.Text,
    -- | Indicates whether to aggregate findings from all of the available
    -- Regions in the current partition. Also determines whether to
    -- automatically aggregate findings from new Regions as Security Hub
    -- supports them and you opt into them.
    --
    -- The selected option also determines how to use the Regions provided in
    -- the Regions list.
    --
    -- The options are as follows:
    --
    -- -   @ALL_REGIONS@ - Indicates to aggregate findings from all of the
    --     Regions where Security Hub is enabled. When you choose this option,
    --     Security Hub also automatically aggregates findings from new Regions
    --     as Security Hub supports them and you opt into them.
    --
    -- -   @ALL_REGIONS_EXCEPT_SPECIFIED@ - Indicates to aggregate findings
    --     from all of the Regions where Security Hub is enabled, except for
    --     the Regions listed in the @Regions@ parameter. When you choose this
    --     option, Security Hub also automatically aggregates findings from new
    --     Regions as Security Hub supports them and you opt into them.
    --
    -- -   @SPECIFIED_REGIONS@ - Indicates to aggregate findings only from the
    --     Regions listed in the @Regions@ parameter. Security Hub does not
    --     automatically aggregate findings from new Regions.
    UpdateFindingAggregator -> Text
regionLinkingMode :: Prelude.Text
  }
  deriving (UpdateFindingAggregator -> UpdateFindingAggregator -> Bool
(UpdateFindingAggregator -> UpdateFindingAggregator -> Bool)
-> (UpdateFindingAggregator -> UpdateFindingAggregator -> Bool)
-> Eq UpdateFindingAggregator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFindingAggregator -> UpdateFindingAggregator -> Bool
$c/= :: UpdateFindingAggregator -> UpdateFindingAggregator -> Bool
== :: UpdateFindingAggregator -> UpdateFindingAggregator -> Bool
$c== :: UpdateFindingAggregator -> UpdateFindingAggregator -> Bool
Prelude.Eq, ReadPrec [UpdateFindingAggregator]
ReadPrec UpdateFindingAggregator
Int -> ReadS UpdateFindingAggregator
ReadS [UpdateFindingAggregator]
(Int -> ReadS UpdateFindingAggregator)
-> ReadS [UpdateFindingAggregator]
-> ReadPrec UpdateFindingAggregator
-> ReadPrec [UpdateFindingAggregator]
-> Read UpdateFindingAggregator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFindingAggregator]
$creadListPrec :: ReadPrec [UpdateFindingAggregator]
readPrec :: ReadPrec UpdateFindingAggregator
$creadPrec :: ReadPrec UpdateFindingAggregator
readList :: ReadS [UpdateFindingAggregator]
$creadList :: ReadS [UpdateFindingAggregator]
readsPrec :: Int -> ReadS UpdateFindingAggregator
$creadsPrec :: Int -> ReadS UpdateFindingAggregator
Prelude.Read, Int -> UpdateFindingAggregator -> ShowS
[UpdateFindingAggregator] -> ShowS
UpdateFindingAggregator -> String
(Int -> UpdateFindingAggregator -> ShowS)
-> (UpdateFindingAggregator -> String)
-> ([UpdateFindingAggregator] -> ShowS)
-> Show UpdateFindingAggregator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFindingAggregator] -> ShowS
$cshowList :: [UpdateFindingAggregator] -> ShowS
show :: UpdateFindingAggregator -> String
$cshow :: UpdateFindingAggregator -> String
showsPrec :: Int -> UpdateFindingAggregator -> ShowS
$cshowsPrec :: Int -> UpdateFindingAggregator -> ShowS
Prelude.Show, (forall x.
 UpdateFindingAggregator -> Rep UpdateFindingAggregator x)
-> (forall x.
    Rep UpdateFindingAggregator x -> UpdateFindingAggregator)
-> Generic UpdateFindingAggregator
forall x. Rep UpdateFindingAggregator x -> UpdateFindingAggregator
forall x. UpdateFindingAggregator -> Rep UpdateFindingAggregator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFindingAggregator x -> UpdateFindingAggregator
$cfrom :: forall x. UpdateFindingAggregator -> Rep UpdateFindingAggregator x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFindingAggregator' 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:
--
-- 'regions', 'updateFindingAggregator_regions' - If @RegionLinkingMode@ is @ALL_REGIONS_EXCEPT_SPECIFIED@, then this is a
-- comma-separated list of Regions that do not aggregate findings to the
-- aggregation Region.
--
-- If @RegionLinkingMode@ is @SPECIFIED_REGIONS@, then this is a
-- comma-separated list of Regions that do aggregate findings to the
-- aggregation Region.
--
-- 'findingAggregatorArn', 'updateFindingAggregator_findingAggregatorArn' - The ARN of the finding aggregator. To obtain the ARN, use
-- @ListFindingAggregators@.
--
-- 'regionLinkingMode', 'updateFindingAggregator_regionLinkingMode' - Indicates whether to aggregate findings from all of the available
-- Regions in the current partition. Also determines whether to
-- automatically aggregate findings from new Regions as Security Hub
-- supports them and you opt into them.
--
-- The selected option also determines how to use the Regions provided in
-- the Regions list.
--
-- The options are as follows:
--
-- -   @ALL_REGIONS@ - Indicates to aggregate findings from all of the
--     Regions where Security Hub is enabled. When you choose this option,
--     Security Hub also automatically aggregates findings from new Regions
--     as Security Hub supports them and you opt into them.
--
-- -   @ALL_REGIONS_EXCEPT_SPECIFIED@ - Indicates to aggregate findings
--     from all of the Regions where Security Hub is enabled, except for
--     the Regions listed in the @Regions@ parameter. When you choose this
--     option, Security Hub also automatically aggregates findings from new
--     Regions as Security Hub supports them and you opt into them.
--
-- -   @SPECIFIED_REGIONS@ - Indicates to aggregate findings only from the
--     Regions listed in the @Regions@ parameter. Security Hub does not
--     automatically aggregate findings from new Regions.
newUpdateFindingAggregator ::
  -- | 'findingAggregatorArn'
  Prelude.Text ->
  -- | 'regionLinkingMode'
  Prelude.Text ->
  UpdateFindingAggregator
newUpdateFindingAggregator :: Text -> Text -> UpdateFindingAggregator
newUpdateFindingAggregator
  Text
pFindingAggregatorArn_
  Text
pRegionLinkingMode_ =
    UpdateFindingAggregator' :: Maybe [Text] -> Text -> Text -> UpdateFindingAggregator
UpdateFindingAggregator'
      { $sel:regions:UpdateFindingAggregator' :: Maybe [Text]
regions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:findingAggregatorArn:UpdateFindingAggregator' :: Text
findingAggregatorArn = Text
pFindingAggregatorArn_,
        $sel:regionLinkingMode:UpdateFindingAggregator' :: Text
regionLinkingMode = Text
pRegionLinkingMode_
      }

-- | If @RegionLinkingMode@ is @ALL_REGIONS_EXCEPT_SPECIFIED@, then this is a
-- comma-separated list of Regions that do not aggregate findings to the
-- aggregation Region.
--
-- If @RegionLinkingMode@ is @SPECIFIED_REGIONS@, then this is a
-- comma-separated list of Regions that do aggregate findings to the
-- aggregation Region.
updateFindingAggregator_regions :: Lens.Lens' UpdateFindingAggregator (Prelude.Maybe [Prelude.Text])
updateFindingAggregator_regions :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateFindingAggregator -> f UpdateFindingAggregator
updateFindingAggregator_regions = (UpdateFindingAggregator -> Maybe [Text])
-> (UpdateFindingAggregator
    -> Maybe [Text] -> UpdateFindingAggregator)
-> Lens
     UpdateFindingAggregator
     UpdateFindingAggregator
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingAggregator' {Maybe [Text]
regions :: Maybe [Text]
$sel:regions:UpdateFindingAggregator' :: UpdateFindingAggregator -> Maybe [Text]
regions} -> Maybe [Text]
regions) (\s :: UpdateFindingAggregator
s@UpdateFindingAggregator' {} Maybe [Text]
a -> UpdateFindingAggregator
s {$sel:regions:UpdateFindingAggregator' :: Maybe [Text]
regions = Maybe [Text]
a} :: UpdateFindingAggregator) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateFindingAggregator -> f UpdateFindingAggregator)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateFindingAggregator
-> f UpdateFindingAggregator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the finding aggregator. To obtain the ARN, use
-- @ListFindingAggregators@.
updateFindingAggregator_findingAggregatorArn :: Lens.Lens' UpdateFindingAggregator Prelude.Text
updateFindingAggregator_findingAggregatorArn :: (Text -> f Text)
-> UpdateFindingAggregator -> f UpdateFindingAggregator
updateFindingAggregator_findingAggregatorArn = (UpdateFindingAggregator -> Text)
-> (UpdateFindingAggregator -> Text -> UpdateFindingAggregator)
-> Lens UpdateFindingAggregator UpdateFindingAggregator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingAggregator' {Text
findingAggregatorArn :: Text
$sel:findingAggregatorArn:UpdateFindingAggregator' :: UpdateFindingAggregator -> Text
findingAggregatorArn} -> Text
findingAggregatorArn) (\s :: UpdateFindingAggregator
s@UpdateFindingAggregator' {} Text
a -> UpdateFindingAggregator
s {$sel:findingAggregatorArn:UpdateFindingAggregator' :: Text
findingAggregatorArn = Text
a} :: UpdateFindingAggregator)

-- | Indicates whether to aggregate findings from all of the available
-- Regions in the current partition. Also determines whether to
-- automatically aggregate findings from new Regions as Security Hub
-- supports them and you opt into them.
--
-- The selected option also determines how to use the Regions provided in
-- the Regions list.
--
-- The options are as follows:
--
-- -   @ALL_REGIONS@ - Indicates to aggregate findings from all of the
--     Regions where Security Hub is enabled. When you choose this option,
--     Security Hub also automatically aggregates findings from new Regions
--     as Security Hub supports them and you opt into them.
--
-- -   @ALL_REGIONS_EXCEPT_SPECIFIED@ - Indicates to aggregate findings
--     from all of the Regions where Security Hub is enabled, except for
--     the Regions listed in the @Regions@ parameter. When you choose this
--     option, Security Hub also automatically aggregates findings from new
--     Regions as Security Hub supports them and you opt into them.
--
-- -   @SPECIFIED_REGIONS@ - Indicates to aggregate findings only from the
--     Regions listed in the @Regions@ parameter. Security Hub does not
--     automatically aggregate findings from new Regions.
updateFindingAggregator_regionLinkingMode :: Lens.Lens' UpdateFindingAggregator Prelude.Text
updateFindingAggregator_regionLinkingMode :: (Text -> f Text)
-> UpdateFindingAggregator -> f UpdateFindingAggregator
updateFindingAggregator_regionLinkingMode = (UpdateFindingAggregator -> Text)
-> (UpdateFindingAggregator -> Text -> UpdateFindingAggregator)
-> Lens UpdateFindingAggregator UpdateFindingAggregator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingAggregator' {Text
regionLinkingMode :: Text
$sel:regionLinkingMode:UpdateFindingAggregator' :: UpdateFindingAggregator -> Text
regionLinkingMode} -> Text
regionLinkingMode) (\s :: UpdateFindingAggregator
s@UpdateFindingAggregator' {} Text
a -> UpdateFindingAggregator
s {$sel:regionLinkingMode:UpdateFindingAggregator' :: Text
regionLinkingMode = Text
a} :: UpdateFindingAggregator)

instance Core.AWSRequest UpdateFindingAggregator where
  type
    AWSResponse UpdateFindingAggregator =
      UpdateFindingAggregatorResponse
  request :: UpdateFindingAggregator -> Request UpdateFindingAggregator
request = Service
-> UpdateFindingAggregator -> Request UpdateFindingAggregator
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateFindingAggregator
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFindingAggregator)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateFindingAggregator))
-> Logger
-> Service
-> Proxy UpdateFindingAggregator
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFindingAggregator)))
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
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateFindingAggregatorResponse
UpdateFindingAggregatorResponse'
            (Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> UpdateFindingAggregatorResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateFindingAggregatorResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Regions" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateFindingAggregatorResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> UpdateFindingAggregatorResponse)
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
"FindingAggregatorArn")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> UpdateFindingAggregatorResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> UpdateFindingAggregatorResponse)
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
"RegionLinkingMode")
            Either
  String (Maybe Text -> Int -> UpdateFindingAggregatorResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateFindingAggregatorResponse)
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
"FindingAggregationRegion")
            Either String (Int -> UpdateFindingAggregatorResponse)
-> Either String Int
-> Either String UpdateFindingAggregatorResponse
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 UpdateFindingAggregator

instance Prelude.NFData UpdateFindingAggregator

instance Core.ToHeaders UpdateFindingAggregator where
  toHeaders :: UpdateFindingAggregator -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateFindingAggregator -> 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 UpdateFindingAggregator where
  toJSON :: UpdateFindingAggregator -> Value
toJSON UpdateFindingAggregator' {Maybe [Text]
Text
regionLinkingMode :: Text
findingAggregatorArn :: Text
regions :: Maybe [Text]
$sel:regionLinkingMode:UpdateFindingAggregator' :: UpdateFindingAggregator -> Text
$sel:findingAggregatorArn:UpdateFindingAggregator' :: UpdateFindingAggregator -> Text
$sel:regions:UpdateFindingAggregator' :: UpdateFindingAggregator -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Regions" 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]
regions,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"FindingAggregatorArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
findingAggregatorArn
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"RegionLinkingMode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
regionLinkingMode)
          ]
      )

instance Core.ToPath UpdateFindingAggregator where
  toPath :: UpdateFindingAggregator -> ByteString
toPath = ByteString -> UpdateFindingAggregator -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/findingAggregator/update"

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

-- | /See:/ 'newUpdateFindingAggregatorResponse' smart constructor.
data UpdateFindingAggregatorResponse = UpdateFindingAggregatorResponse'
  { -- | The list of excluded Regions or included Regions.
    UpdateFindingAggregatorResponse -> Maybe [Text]
regions :: Prelude.Maybe [Prelude.Text],
    -- | The ARN of the finding aggregator.
    UpdateFindingAggregatorResponse -> Maybe Text
findingAggregatorArn :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether to link all Regions, all Regions except for a list of
    -- excluded Regions, or a list of included Regions.
    UpdateFindingAggregatorResponse -> Maybe Text
regionLinkingMode :: Prelude.Maybe Prelude.Text,
    -- | The aggregation Region.
    UpdateFindingAggregatorResponse -> Maybe Text
findingAggregationRegion :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateFindingAggregatorResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateFindingAggregatorResponse
-> UpdateFindingAggregatorResponse -> Bool
(UpdateFindingAggregatorResponse
 -> UpdateFindingAggregatorResponse -> Bool)
-> (UpdateFindingAggregatorResponse
    -> UpdateFindingAggregatorResponse -> Bool)
-> Eq UpdateFindingAggregatorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFindingAggregatorResponse
-> UpdateFindingAggregatorResponse -> Bool
$c/= :: UpdateFindingAggregatorResponse
-> UpdateFindingAggregatorResponse -> Bool
== :: UpdateFindingAggregatorResponse
-> UpdateFindingAggregatorResponse -> Bool
$c== :: UpdateFindingAggregatorResponse
-> UpdateFindingAggregatorResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFindingAggregatorResponse]
ReadPrec UpdateFindingAggregatorResponse
Int -> ReadS UpdateFindingAggregatorResponse
ReadS [UpdateFindingAggregatorResponse]
(Int -> ReadS UpdateFindingAggregatorResponse)
-> ReadS [UpdateFindingAggregatorResponse]
-> ReadPrec UpdateFindingAggregatorResponse
-> ReadPrec [UpdateFindingAggregatorResponse]
-> Read UpdateFindingAggregatorResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFindingAggregatorResponse]
$creadListPrec :: ReadPrec [UpdateFindingAggregatorResponse]
readPrec :: ReadPrec UpdateFindingAggregatorResponse
$creadPrec :: ReadPrec UpdateFindingAggregatorResponse
readList :: ReadS [UpdateFindingAggregatorResponse]
$creadList :: ReadS [UpdateFindingAggregatorResponse]
readsPrec :: Int -> ReadS UpdateFindingAggregatorResponse
$creadsPrec :: Int -> ReadS UpdateFindingAggregatorResponse
Prelude.Read, Int -> UpdateFindingAggregatorResponse -> ShowS
[UpdateFindingAggregatorResponse] -> ShowS
UpdateFindingAggregatorResponse -> String
(Int -> UpdateFindingAggregatorResponse -> ShowS)
-> (UpdateFindingAggregatorResponse -> String)
-> ([UpdateFindingAggregatorResponse] -> ShowS)
-> Show UpdateFindingAggregatorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFindingAggregatorResponse] -> ShowS
$cshowList :: [UpdateFindingAggregatorResponse] -> ShowS
show :: UpdateFindingAggregatorResponse -> String
$cshow :: UpdateFindingAggregatorResponse -> String
showsPrec :: Int -> UpdateFindingAggregatorResponse -> ShowS
$cshowsPrec :: Int -> UpdateFindingAggregatorResponse -> ShowS
Prelude.Show, (forall x.
 UpdateFindingAggregatorResponse
 -> Rep UpdateFindingAggregatorResponse x)
-> (forall x.
    Rep UpdateFindingAggregatorResponse x
    -> UpdateFindingAggregatorResponse)
-> Generic UpdateFindingAggregatorResponse
forall x.
Rep UpdateFindingAggregatorResponse x
-> UpdateFindingAggregatorResponse
forall x.
UpdateFindingAggregatorResponse
-> Rep UpdateFindingAggregatorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFindingAggregatorResponse x
-> UpdateFindingAggregatorResponse
$cfrom :: forall x.
UpdateFindingAggregatorResponse
-> Rep UpdateFindingAggregatorResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFindingAggregatorResponse' 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:
--
-- 'regions', 'updateFindingAggregatorResponse_regions' - The list of excluded Regions or included Regions.
--
-- 'findingAggregatorArn', 'updateFindingAggregatorResponse_findingAggregatorArn' - The ARN of the finding aggregator.
--
-- 'regionLinkingMode', 'updateFindingAggregatorResponse_regionLinkingMode' - Indicates whether to link all Regions, all Regions except for a list of
-- excluded Regions, or a list of included Regions.
--
-- 'findingAggregationRegion', 'updateFindingAggregatorResponse_findingAggregationRegion' - The aggregation Region.
--
-- 'httpStatus', 'updateFindingAggregatorResponse_httpStatus' - The response's http status code.
newUpdateFindingAggregatorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateFindingAggregatorResponse
newUpdateFindingAggregatorResponse :: Int -> UpdateFindingAggregatorResponse
newUpdateFindingAggregatorResponse Int
pHttpStatus_ =
  UpdateFindingAggregatorResponse' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateFindingAggregatorResponse
UpdateFindingAggregatorResponse'
    { $sel:regions:UpdateFindingAggregatorResponse' :: Maybe [Text]
regions =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:findingAggregatorArn:UpdateFindingAggregatorResponse' :: Maybe Text
findingAggregatorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:regionLinkingMode:UpdateFindingAggregatorResponse' :: Maybe Text
regionLinkingMode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:findingAggregationRegion:UpdateFindingAggregatorResponse' :: Maybe Text
findingAggregationRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateFindingAggregatorResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of excluded Regions or included Regions.
updateFindingAggregatorResponse_regions :: Lens.Lens' UpdateFindingAggregatorResponse (Prelude.Maybe [Prelude.Text])
updateFindingAggregatorResponse_regions :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateFindingAggregatorResponse
-> f UpdateFindingAggregatorResponse
updateFindingAggregatorResponse_regions = (UpdateFindingAggregatorResponse -> Maybe [Text])
-> (UpdateFindingAggregatorResponse
    -> Maybe [Text] -> UpdateFindingAggregatorResponse)
-> Lens
     UpdateFindingAggregatorResponse
     UpdateFindingAggregatorResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingAggregatorResponse' {Maybe [Text]
regions :: Maybe [Text]
$sel:regions:UpdateFindingAggregatorResponse' :: UpdateFindingAggregatorResponse -> Maybe [Text]
regions} -> Maybe [Text]
regions) (\s :: UpdateFindingAggregatorResponse
s@UpdateFindingAggregatorResponse' {} Maybe [Text]
a -> UpdateFindingAggregatorResponse
s {$sel:regions:UpdateFindingAggregatorResponse' :: Maybe [Text]
regions = Maybe [Text]
a} :: UpdateFindingAggregatorResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateFindingAggregatorResponse
 -> f UpdateFindingAggregatorResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateFindingAggregatorResponse
-> f UpdateFindingAggregatorResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the finding aggregator.
updateFindingAggregatorResponse_findingAggregatorArn :: Lens.Lens' UpdateFindingAggregatorResponse (Prelude.Maybe Prelude.Text)
updateFindingAggregatorResponse_findingAggregatorArn :: (Maybe Text -> f (Maybe Text))
-> UpdateFindingAggregatorResponse
-> f UpdateFindingAggregatorResponse
updateFindingAggregatorResponse_findingAggregatorArn = (UpdateFindingAggregatorResponse -> Maybe Text)
-> (UpdateFindingAggregatorResponse
    -> Maybe Text -> UpdateFindingAggregatorResponse)
-> Lens
     UpdateFindingAggregatorResponse
     UpdateFindingAggregatorResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingAggregatorResponse' {Maybe Text
findingAggregatorArn :: Maybe Text
$sel:findingAggregatorArn:UpdateFindingAggregatorResponse' :: UpdateFindingAggregatorResponse -> Maybe Text
findingAggregatorArn} -> Maybe Text
findingAggregatorArn) (\s :: UpdateFindingAggregatorResponse
s@UpdateFindingAggregatorResponse' {} Maybe Text
a -> UpdateFindingAggregatorResponse
s {$sel:findingAggregatorArn:UpdateFindingAggregatorResponse' :: Maybe Text
findingAggregatorArn = Maybe Text
a} :: UpdateFindingAggregatorResponse)

-- | Indicates whether to link all Regions, all Regions except for a list of
-- excluded Regions, or a list of included Regions.
updateFindingAggregatorResponse_regionLinkingMode :: Lens.Lens' UpdateFindingAggregatorResponse (Prelude.Maybe Prelude.Text)
updateFindingAggregatorResponse_regionLinkingMode :: (Maybe Text -> f (Maybe Text))
-> UpdateFindingAggregatorResponse
-> f UpdateFindingAggregatorResponse
updateFindingAggregatorResponse_regionLinkingMode = (UpdateFindingAggregatorResponse -> Maybe Text)
-> (UpdateFindingAggregatorResponse
    -> Maybe Text -> UpdateFindingAggregatorResponse)
-> Lens
     UpdateFindingAggregatorResponse
     UpdateFindingAggregatorResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingAggregatorResponse' {Maybe Text
regionLinkingMode :: Maybe Text
$sel:regionLinkingMode:UpdateFindingAggregatorResponse' :: UpdateFindingAggregatorResponse -> Maybe Text
regionLinkingMode} -> Maybe Text
regionLinkingMode) (\s :: UpdateFindingAggregatorResponse
s@UpdateFindingAggregatorResponse' {} Maybe Text
a -> UpdateFindingAggregatorResponse
s {$sel:regionLinkingMode:UpdateFindingAggregatorResponse' :: Maybe Text
regionLinkingMode = Maybe Text
a} :: UpdateFindingAggregatorResponse)

-- | The aggregation Region.
updateFindingAggregatorResponse_findingAggregationRegion :: Lens.Lens' UpdateFindingAggregatorResponse (Prelude.Maybe Prelude.Text)
updateFindingAggregatorResponse_findingAggregationRegion :: (Maybe Text -> f (Maybe Text))
-> UpdateFindingAggregatorResponse
-> f UpdateFindingAggregatorResponse
updateFindingAggregatorResponse_findingAggregationRegion = (UpdateFindingAggregatorResponse -> Maybe Text)
-> (UpdateFindingAggregatorResponse
    -> Maybe Text -> UpdateFindingAggregatorResponse)
-> Lens
     UpdateFindingAggregatorResponse
     UpdateFindingAggregatorResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFindingAggregatorResponse' {Maybe Text
findingAggregationRegion :: Maybe Text
$sel:findingAggregationRegion:UpdateFindingAggregatorResponse' :: UpdateFindingAggregatorResponse -> Maybe Text
findingAggregationRegion} -> Maybe Text
findingAggregationRegion) (\s :: UpdateFindingAggregatorResponse
s@UpdateFindingAggregatorResponse' {} Maybe Text
a -> UpdateFindingAggregatorResponse
s {$sel:findingAggregationRegion:UpdateFindingAggregatorResponse' :: Maybe Text
findingAggregationRegion = Maybe Text
a} :: UpdateFindingAggregatorResponse)

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

instance
  Prelude.NFData
    UpdateFindingAggregatorResponse