{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.FindingAggregator
-- 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)
module Amazonka.SecurityHub.Types.FindingAggregator where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A finding aggregator. A finding aggregator contains the configuration
-- for finding aggregation.
--
-- /See:/ 'newFindingAggregator' smart constructor.
data FindingAggregator = FindingAggregator'
  { -- | The ARN of the finding aggregator. You use the finding aggregator ARN to
    -- retrieve details for, update, and delete the finding aggregator.
    FindingAggregator -> Maybe Text
findingAggregatorArn :: Prelude.Maybe Prelude.Text
  }
  deriving (FindingAggregator -> FindingAggregator -> Bool
(FindingAggregator -> FindingAggregator -> Bool)
-> (FindingAggregator -> FindingAggregator -> Bool)
-> Eq FindingAggregator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FindingAggregator -> FindingAggregator -> Bool
$c/= :: FindingAggregator -> FindingAggregator -> Bool
== :: FindingAggregator -> FindingAggregator -> Bool
$c== :: FindingAggregator -> FindingAggregator -> Bool
Prelude.Eq, ReadPrec [FindingAggregator]
ReadPrec FindingAggregator
Int -> ReadS FindingAggregator
ReadS [FindingAggregator]
(Int -> ReadS FindingAggregator)
-> ReadS [FindingAggregator]
-> ReadPrec FindingAggregator
-> ReadPrec [FindingAggregator]
-> Read FindingAggregator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FindingAggregator]
$creadListPrec :: ReadPrec [FindingAggregator]
readPrec :: ReadPrec FindingAggregator
$creadPrec :: ReadPrec FindingAggregator
readList :: ReadS [FindingAggregator]
$creadList :: ReadS [FindingAggregator]
readsPrec :: Int -> ReadS FindingAggregator
$creadsPrec :: Int -> ReadS FindingAggregator
Prelude.Read, Int -> FindingAggregator -> ShowS
[FindingAggregator] -> ShowS
FindingAggregator -> String
(Int -> FindingAggregator -> ShowS)
-> (FindingAggregator -> String)
-> ([FindingAggregator] -> ShowS)
-> Show FindingAggregator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FindingAggregator] -> ShowS
$cshowList :: [FindingAggregator] -> ShowS
show :: FindingAggregator -> String
$cshow :: FindingAggregator -> String
showsPrec :: Int -> FindingAggregator -> ShowS
$cshowsPrec :: Int -> FindingAggregator -> ShowS
Prelude.Show, (forall x. FindingAggregator -> Rep FindingAggregator x)
-> (forall x. Rep FindingAggregator x -> FindingAggregator)
-> Generic FindingAggregator
forall x. Rep FindingAggregator x -> FindingAggregator
forall x. FindingAggregator -> Rep FindingAggregator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FindingAggregator x -> FindingAggregator
$cfrom :: forall x. FindingAggregator -> Rep FindingAggregator x
Prelude.Generic)

-- |
-- Create a value of 'FindingAggregator' 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:
--
-- 'findingAggregatorArn', 'findingAggregator_findingAggregatorArn' - The ARN of the finding aggregator. You use the finding aggregator ARN to
-- retrieve details for, update, and delete the finding aggregator.
newFindingAggregator ::
  FindingAggregator
newFindingAggregator :: FindingAggregator
newFindingAggregator =
  FindingAggregator' :: Maybe Text -> FindingAggregator
FindingAggregator'
    { $sel:findingAggregatorArn:FindingAggregator' :: Maybe Text
findingAggregatorArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the finding aggregator. You use the finding aggregator ARN to
-- retrieve details for, update, and delete the finding aggregator.
findingAggregator_findingAggregatorArn :: Lens.Lens' FindingAggregator (Prelude.Maybe Prelude.Text)
findingAggregator_findingAggregatorArn :: (Maybe Text -> f (Maybe Text))
-> FindingAggregator -> f FindingAggregator
findingAggregator_findingAggregatorArn = (FindingAggregator -> Maybe Text)
-> (FindingAggregator -> Maybe Text -> FindingAggregator)
-> Lens
     FindingAggregator FindingAggregator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FindingAggregator' {Maybe Text
findingAggregatorArn :: Maybe Text
$sel:findingAggregatorArn:FindingAggregator' :: FindingAggregator -> Maybe Text
findingAggregatorArn} -> Maybe Text
findingAggregatorArn) (\s :: FindingAggregator
s@FindingAggregator' {} Maybe Text
a -> FindingAggregator
s {$sel:findingAggregatorArn:FindingAggregator' :: Maybe Text
findingAggregatorArn = Maybe Text
a} :: FindingAggregator)

instance Core.FromJSON FindingAggregator where
  parseJSON :: Value -> Parser FindingAggregator
parseJSON =
    String
-> (Object -> Parser FindingAggregator)
-> Value
-> Parser FindingAggregator
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FindingAggregator"
      ( \Object
x ->
          Maybe Text -> FindingAggregator
FindingAggregator'
            (Maybe Text -> FindingAggregator)
-> Parser (Maybe Text) -> Parser FindingAggregator
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FindingAggregatorArn")
      )

instance Prelude.Hashable FindingAggregator

instance Prelude.NFData FindingAggregator