{-# 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.CreateFindingAggregator
-- 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)
--
-- Used to enable finding aggregation. Must be called from the aggregation
-- Region.
--
-- For more details about cross-Region replication, see
-- <securityhub/latest/userguide/finding-aggregation.html Configuring finding aggregation>
-- in the /Security Hub User Guide/.
module Amazonka.SecurityHub.CreateFindingAggregator
  ( -- * Creating a Request
    CreateFindingAggregator (..),
    newCreateFindingAggregator,

    -- * Request Lenses
    createFindingAggregator_regions,
    createFindingAggregator_regionLinkingMode,

    -- * Destructuring the Response
    CreateFindingAggregatorResponse (..),
    newCreateFindingAggregatorResponse,

    -- * Response Lenses
    createFindingAggregatorResponse_regions,
    createFindingAggregatorResponse_findingAggregatorArn,
    createFindingAggregatorResponse_regionLinkingMode,
    createFindingAggregatorResponse_findingAggregationRegion,
    createFindingAggregatorResponse_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:/ 'newCreateFindingAggregator' smart constructor.
data CreateFindingAggregator = CreateFindingAggregator'
  { -- | 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.
    CreateFindingAggregator -> Maybe [Text]
regions :: Prelude.Maybe [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.
    CreateFindingAggregator -> Text
regionLinkingMode :: Prelude.Text
  }
  deriving (CreateFindingAggregator -> CreateFindingAggregator -> Bool
(CreateFindingAggregator -> CreateFindingAggregator -> Bool)
-> (CreateFindingAggregator -> CreateFindingAggregator -> Bool)
-> Eq CreateFindingAggregator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFindingAggregator -> CreateFindingAggregator -> Bool
$c/= :: CreateFindingAggregator -> CreateFindingAggregator -> Bool
== :: CreateFindingAggregator -> CreateFindingAggregator -> Bool
$c== :: CreateFindingAggregator -> CreateFindingAggregator -> Bool
Prelude.Eq, ReadPrec [CreateFindingAggregator]
ReadPrec CreateFindingAggregator
Int -> ReadS CreateFindingAggregator
ReadS [CreateFindingAggregator]
(Int -> ReadS CreateFindingAggregator)
-> ReadS [CreateFindingAggregator]
-> ReadPrec CreateFindingAggregator
-> ReadPrec [CreateFindingAggregator]
-> Read CreateFindingAggregator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFindingAggregator]
$creadListPrec :: ReadPrec [CreateFindingAggregator]
readPrec :: ReadPrec CreateFindingAggregator
$creadPrec :: ReadPrec CreateFindingAggregator
readList :: ReadS [CreateFindingAggregator]
$creadList :: ReadS [CreateFindingAggregator]
readsPrec :: Int -> ReadS CreateFindingAggregator
$creadsPrec :: Int -> ReadS CreateFindingAggregator
Prelude.Read, Int -> CreateFindingAggregator -> ShowS
[CreateFindingAggregator] -> ShowS
CreateFindingAggregator -> String
(Int -> CreateFindingAggregator -> ShowS)
-> (CreateFindingAggregator -> String)
-> ([CreateFindingAggregator] -> ShowS)
-> Show CreateFindingAggregator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFindingAggregator] -> ShowS
$cshowList :: [CreateFindingAggregator] -> ShowS
show :: CreateFindingAggregator -> String
$cshow :: CreateFindingAggregator -> String
showsPrec :: Int -> CreateFindingAggregator -> ShowS
$cshowsPrec :: Int -> CreateFindingAggregator -> ShowS
Prelude.Show, (forall x.
 CreateFindingAggregator -> Rep CreateFindingAggregator x)
-> (forall x.
    Rep CreateFindingAggregator x -> CreateFindingAggregator)
-> Generic CreateFindingAggregator
forall x. Rep CreateFindingAggregator x -> CreateFindingAggregator
forall x. CreateFindingAggregator -> Rep CreateFindingAggregator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFindingAggregator x -> CreateFindingAggregator
$cfrom :: forall x. CreateFindingAggregator -> Rep CreateFindingAggregator x
Prelude.Generic)

-- |
-- Create a value of 'CreateFindingAggregator' 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', 'createFindingAggregator_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.
--
-- 'regionLinkingMode', 'createFindingAggregator_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.
newCreateFindingAggregator ::
  -- | 'regionLinkingMode'
  Prelude.Text ->
  CreateFindingAggregator
newCreateFindingAggregator :: Text -> CreateFindingAggregator
newCreateFindingAggregator Text
pRegionLinkingMode_ =
  CreateFindingAggregator' :: Maybe [Text] -> Text -> CreateFindingAggregator
CreateFindingAggregator'
    { $sel:regions:CreateFindingAggregator' :: Maybe [Text]
regions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:regionLinkingMode:CreateFindingAggregator' :: 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.
createFindingAggregator_regions :: Lens.Lens' CreateFindingAggregator (Prelude.Maybe [Prelude.Text])
createFindingAggregator_regions :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateFindingAggregator -> f CreateFindingAggregator
createFindingAggregator_regions = (CreateFindingAggregator -> Maybe [Text])
-> (CreateFindingAggregator
    -> Maybe [Text] -> CreateFindingAggregator)
-> Lens
     CreateFindingAggregator
     CreateFindingAggregator
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFindingAggregator' {Maybe [Text]
regions :: Maybe [Text]
$sel:regions:CreateFindingAggregator' :: CreateFindingAggregator -> Maybe [Text]
regions} -> Maybe [Text]
regions) (\s :: CreateFindingAggregator
s@CreateFindingAggregator' {} Maybe [Text]
a -> CreateFindingAggregator
s {$sel:regions:CreateFindingAggregator' :: Maybe [Text]
regions = Maybe [Text]
a} :: CreateFindingAggregator) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateFindingAggregator -> f CreateFindingAggregator)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateFindingAggregator
-> f CreateFindingAggregator
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

-- | 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.
createFindingAggregator_regionLinkingMode :: Lens.Lens' CreateFindingAggregator Prelude.Text
createFindingAggregator_regionLinkingMode :: (Text -> f Text)
-> CreateFindingAggregator -> f CreateFindingAggregator
createFindingAggregator_regionLinkingMode = (CreateFindingAggregator -> Text)
-> (CreateFindingAggregator -> Text -> CreateFindingAggregator)
-> Lens CreateFindingAggregator CreateFindingAggregator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFindingAggregator' {Text
regionLinkingMode :: Text
$sel:regionLinkingMode:CreateFindingAggregator' :: CreateFindingAggregator -> Text
regionLinkingMode} -> Text
regionLinkingMode) (\s :: CreateFindingAggregator
s@CreateFindingAggregator' {} Text
a -> CreateFindingAggregator
s {$sel:regionLinkingMode:CreateFindingAggregator' :: Text
regionLinkingMode = Text
a} :: CreateFindingAggregator)

instance Core.AWSRequest CreateFindingAggregator where
  type
    AWSResponse CreateFindingAggregator =
      CreateFindingAggregatorResponse
  request :: CreateFindingAggregator -> Request CreateFindingAggregator
request = Service
-> CreateFindingAggregator -> Request CreateFindingAggregator
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateFindingAggregator
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateFindingAggregator)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateFindingAggregator))
-> Logger
-> Service
-> Proxy CreateFindingAggregator
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateFindingAggregator)))
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
-> CreateFindingAggregatorResponse
CreateFindingAggregatorResponse'
            (Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateFindingAggregatorResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateFindingAggregatorResponse)
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
   -> CreateFindingAggregatorResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> CreateFindingAggregatorResponse)
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 -> CreateFindingAggregatorResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateFindingAggregatorResponse)
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 -> CreateFindingAggregatorResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateFindingAggregatorResponse)
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 -> CreateFindingAggregatorResponse)
-> Either String Int
-> Either String CreateFindingAggregatorResponse
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 CreateFindingAggregator

instance Prelude.NFData CreateFindingAggregator

instance Core.ToHeaders CreateFindingAggregator where
  toHeaders :: CreateFindingAggregator -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateFindingAggregator -> 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 CreateFindingAggregator where
  toJSON :: CreateFindingAggregator -> Value
toJSON CreateFindingAggregator' {Maybe [Text]
Text
regionLinkingMode :: Text
regions :: Maybe [Text]
$sel:regionLinkingMode:CreateFindingAggregator' :: CreateFindingAggregator -> Text
$sel:regions:CreateFindingAggregator' :: CreateFindingAggregator -> 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
"RegionLinkingMode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
regionLinkingMode)
          ]
      )

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

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

-- | /See:/ 'newCreateFindingAggregatorResponse' smart constructor.
data CreateFindingAggregatorResponse = CreateFindingAggregatorResponse'
  { -- | The list of excluded Regions or included Regions.
    CreateFindingAggregatorResponse -> Maybe [Text]
regions :: Prelude.Maybe [Prelude.Text],
    -- | The ARN of the finding aggregator. You use the finding aggregator ARN to
    -- retrieve details for, update, and stop finding aggregation.
    CreateFindingAggregatorResponse -> 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.
    CreateFindingAggregatorResponse -> Maybe Text
regionLinkingMode :: Prelude.Maybe Prelude.Text,
    -- | The aggregation Region.
    CreateFindingAggregatorResponse -> Maybe Text
findingAggregationRegion :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateFindingAggregatorResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateFindingAggregatorResponse
-> CreateFindingAggregatorResponse -> Bool
(CreateFindingAggregatorResponse
 -> CreateFindingAggregatorResponse -> Bool)
-> (CreateFindingAggregatorResponse
    -> CreateFindingAggregatorResponse -> Bool)
-> Eq CreateFindingAggregatorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFindingAggregatorResponse
-> CreateFindingAggregatorResponse -> Bool
$c/= :: CreateFindingAggregatorResponse
-> CreateFindingAggregatorResponse -> Bool
== :: CreateFindingAggregatorResponse
-> CreateFindingAggregatorResponse -> Bool
$c== :: CreateFindingAggregatorResponse
-> CreateFindingAggregatorResponse -> Bool
Prelude.Eq, ReadPrec [CreateFindingAggregatorResponse]
ReadPrec CreateFindingAggregatorResponse
Int -> ReadS CreateFindingAggregatorResponse
ReadS [CreateFindingAggregatorResponse]
(Int -> ReadS CreateFindingAggregatorResponse)
-> ReadS [CreateFindingAggregatorResponse]
-> ReadPrec CreateFindingAggregatorResponse
-> ReadPrec [CreateFindingAggregatorResponse]
-> Read CreateFindingAggregatorResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFindingAggregatorResponse]
$creadListPrec :: ReadPrec [CreateFindingAggregatorResponse]
readPrec :: ReadPrec CreateFindingAggregatorResponse
$creadPrec :: ReadPrec CreateFindingAggregatorResponse
readList :: ReadS [CreateFindingAggregatorResponse]
$creadList :: ReadS [CreateFindingAggregatorResponse]
readsPrec :: Int -> ReadS CreateFindingAggregatorResponse
$creadsPrec :: Int -> ReadS CreateFindingAggregatorResponse
Prelude.Read, Int -> CreateFindingAggregatorResponse -> ShowS
[CreateFindingAggregatorResponse] -> ShowS
CreateFindingAggregatorResponse -> String
(Int -> CreateFindingAggregatorResponse -> ShowS)
-> (CreateFindingAggregatorResponse -> String)
-> ([CreateFindingAggregatorResponse] -> ShowS)
-> Show CreateFindingAggregatorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFindingAggregatorResponse] -> ShowS
$cshowList :: [CreateFindingAggregatorResponse] -> ShowS
show :: CreateFindingAggregatorResponse -> String
$cshow :: CreateFindingAggregatorResponse -> String
showsPrec :: Int -> CreateFindingAggregatorResponse -> ShowS
$cshowsPrec :: Int -> CreateFindingAggregatorResponse -> ShowS
Prelude.Show, (forall x.
 CreateFindingAggregatorResponse
 -> Rep CreateFindingAggregatorResponse x)
-> (forall x.
    Rep CreateFindingAggregatorResponse x
    -> CreateFindingAggregatorResponse)
-> Generic CreateFindingAggregatorResponse
forall x.
Rep CreateFindingAggregatorResponse x
-> CreateFindingAggregatorResponse
forall x.
CreateFindingAggregatorResponse
-> Rep CreateFindingAggregatorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateFindingAggregatorResponse x
-> CreateFindingAggregatorResponse
$cfrom :: forall x.
CreateFindingAggregatorResponse
-> Rep CreateFindingAggregatorResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateFindingAggregatorResponse' 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', 'createFindingAggregatorResponse_regions' - The list of excluded Regions or included Regions.
--
-- 'findingAggregatorArn', 'createFindingAggregatorResponse_findingAggregatorArn' - The ARN of the finding aggregator. You use the finding aggregator ARN to
-- retrieve details for, update, and stop finding aggregation.
--
-- 'regionLinkingMode', 'createFindingAggregatorResponse_regionLinkingMode' - Indicates whether to link all Regions, all Regions except for a list of
-- excluded Regions, or a list of included Regions.
--
-- 'findingAggregationRegion', 'createFindingAggregatorResponse_findingAggregationRegion' - The aggregation Region.
--
-- 'httpStatus', 'createFindingAggregatorResponse_httpStatus' - The response's http status code.
newCreateFindingAggregatorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateFindingAggregatorResponse
newCreateFindingAggregatorResponse :: Int -> CreateFindingAggregatorResponse
newCreateFindingAggregatorResponse Int
pHttpStatus_ =
  CreateFindingAggregatorResponse' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateFindingAggregatorResponse
CreateFindingAggregatorResponse'
    { $sel:regions:CreateFindingAggregatorResponse' :: Maybe [Text]
regions =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:findingAggregatorArn:CreateFindingAggregatorResponse' :: Maybe Text
findingAggregatorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:regionLinkingMode:CreateFindingAggregatorResponse' :: Maybe Text
regionLinkingMode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:findingAggregationRegion:CreateFindingAggregatorResponse' :: Maybe Text
findingAggregationRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateFindingAggregatorResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of excluded Regions or included Regions.
createFindingAggregatorResponse_regions :: Lens.Lens' CreateFindingAggregatorResponse (Prelude.Maybe [Prelude.Text])
createFindingAggregatorResponse_regions :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateFindingAggregatorResponse
-> f CreateFindingAggregatorResponse
createFindingAggregatorResponse_regions = (CreateFindingAggregatorResponse -> Maybe [Text])
-> (CreateFindingAggregatorResponse
    -> Maybe [Text] -> CreateFindingAggregatorResponse)
-> Lens
     CreateFindingAggregatorResponse
     CreateFindingAggregatorResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFindingAggregatorResponse' {Maybe [Text]
regions :: Maybe [Text]
$sel:regions:CreateFindingAggregatorResponse' :: CreateFindingAggregatorResponse -> Maybe [Text]
regions} -> Maybe [Text]
regions) (\s :: CreateFindingAggregatorResponse
s@CreateFindingAggregatorResponse' {} Maybe [Text]
a -> CreateFindingAggregatorResponse
s {$sel:regions:CreateFindingAggregatorResponse' :: Maybe [Text]
regions = Maybe [Text]
a} :: CreateFindingAggregatorResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateFindingAggregatorResponse
 -> f CreateFindingAggregatorResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateFindingAggregatorResponse
-> f CreateFindingAggregatorResponse
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. You use the finding aggregator ARN to
-- retrieve details for, update, and stop finding aggregation.
createFindingAggregatorResponse_findingAggregatorArn :: Lens.Lens' CreateFindingAggregatorResponse (Prelude.Maybe Prelude.Text)
createFindingAggregatorResponse_findingAggregatorArn :: (Maybe Text -> f (Maybe Text))
-> CreateFindingAggregatorResponse
-> f CreateFindingAggregatorResponse
createFindingAggregatorResponse_findingAggregatorArn = (CreateFindingAggregatorResponse -> Maybe Text)
-> (CreateFindingAggregatorResponse
    -> Maybe Text -> CreateFindingAggregatorResponse)
-> Lens
     CreateFindingAggregatorResponse
     CreateFindingAggregatorResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFindingAggregatorResponse' {Maybe Text
findingAggregatorArn :: Maybe Text
$sel:findingAggregatorArn:CreateFindingAggregatorResponse' :: CreateFindingAggregatorResponse -> Maybe Text
findingAggregatorArn} -> Maybe Text
findingAggregatorArn) (\s :: CreateFindingAggregatorResponse
s@CreateFindingAggregatorResponse' {} Maybe Text
a -> CreateFindingAggregatorResponse
s {$sel:findingAggregatorArn:CreateFindingAggregatorResponse' :: Maybe Text
findingAggregatorArn = Maybe Text
a} :: CreateFindingAggregatorResponse)

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

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

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

instance
  Prelude.NFData
    CreateFindingAggregatorResponse