{-# 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.Config.Types.AggregateConformancePackComplianceSummary
-- 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.Config.Types.AggregateConformancePackComplianceSummary where

import Amazonka.Config.Types.AggregateConformancePackComplianceCount
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of compliance based on either account ID or region.
--
-- /See:/ 'newAggregateConformancePackComplianceSummary' smart constructor.
data AggregateConformancePackComplianceSummary = AggregateConformancePackComplianceSummary'
  { -- | Groups the result based on Amazon Web Services account ID or Amazon Web
    -- Services Region.
    AggregateConformancePackComplianceSummary -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | Returns an @AggregateConformancePackComplianceCount@ object.
    AggregateConformancePackComplianceSummary
-> Maybe AggregateConformancePackComplianceCount
complianceSummary :: Prelude.Maybe AggregateConformancePackComplianceCount
  }
  deriving (AggregateConformancePackComplianceSummary
-> AggregateConformancePackComplianceSummary -> Bool
(AggregateConformancePackComplianceSummary
 -> AggregateConformancePackComplianceSummary -> Bool)
-> (AggregateConformancePackComplianceSummary
    -> AggregateConformancePackComplianceSummary -> Bool)
-> Eq AggregateConformancePackComplianceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AggregateConformancePackComplianceSummary
-> AggregateConformancePackComplianceSummary -> Bool
$c/= :: AggregateConformancePackComplianceSummary
-> AggregateConformancePackComplianceSummary -> Bool
== :: AggregateConformancePackComplianceSummary
-> AggregateConformancePackComplianceSummary -> Bool
$c== :: AggregateConformancePackComplianceSummary
-> AggregateConformancePackComplianceSummary -> Bool
Prelude.Eq, ReadPrec [AggregateConformancePackComplianceSummary]
ReadPrec AggregateConformancePackComplianceSummary
Int -> ReadS AggregateConformancePackComplianceSummary
ReadS [AggregateConformancePackComplianceSummary]
(Int -> ReadS AggregateConformancePackComplianceSummary)
-> ReadS [AggregateConformancePackComplianceSummary]
-> ReadPrec AggregateConformancePackComplianceSummary
-> ReadPrec [AggregateConformancePackComplianceSummary]
-> Read AggregateConformancePackComplianceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AggregateConformancePackComplianceSummary]
$creadListPrec :: ReadPrec [AggregateConformancePackComplianceSummary]
readPrec :: ReadPrec AggregateConformancePackComplianceSummary
$creadPrec :: ReadPrec AggregateConformancePackComplianceSummary
readList :: ReadS [AggregateConformancePackComplianceSummary]
$creadList :: ReadS [AggregateConformancePackComplianceSummary]
readsPrec :: Int -> ReadS AggregateConformancePackComplianceSummary
$creadsPrec :: Int -> ReadS AggregateConformancePackComplianceSummary
Prelude.Read, Int -> AggregateConformancePackComplianceSummary -> ShowS
[AggregateConformancePackComplianceSummary] -> ShowS
AggregateConformancePackComplianceSummary -> String
(Int -> AggregateConformancePackComplianceSummary -> ShowS)
-> (AggregateConformancePackComplianceSummary -> String)
-> ([AggregateConformancePackComplianceSummary] -> ShowS)
-> Show AggregateConformancePackComplianceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AggregateConformancePackComplianceSummary] -> ShowS
$cshowList :: [AggregateConformancePackComplianceSummary] -> ShowS
show :: AggregateConformancePackComplianceSummary -> String
$cshow :: AggregateConformancePackComplianceSummary -> String
showsPrec :: Int -> AggregateConformancePackComplianceSummary -> ShowS
$cshowsPrec :: Int -> AggregateConformancePackComplianceSummary -> ShowS
Prelude.Show, (forall x.
 AggregateConformancePackComplianceSummary
 -> Rep AggregateConformancePackComplianceSummary x)
-> (forall x.
    Rep AggregateConformancePackComplianceSummary x
    -> AggregateConformancePackComplianceSummary)
-> Generic AggregateConformancePackComplianceSummary
forall x.
Rep AggregateConformancePackComplianceSummary x
-> AggregateConformancePackComplianceSummary
forall x.
AggregateConformancePackComplianceSummary
-> Rep AggregateConformancePackComplianceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AggregateConformancePackComplianceSummary x
-> AggregateConformancePackComplianceSummary
$cfrom :: forall x.
AggregateConformancePackComplianceSummary
-> Rep AggregateConformancePackComplianceSummary x
Prelude.Generic)

-- |
-- Create a value of 'AggregateConformancePackComplianceSummary' 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:
--
-- 'groupName', 'aggregateConformancePackComplianceSummary_groupName' - Groups the result based on Amazon Web Services account ID or Amazon Web
-- Services Region.
--
-- 'complianceSummary', 'aggregateConformancePackComplianceSummary_complianceSummary' - Returns an @AggregateConformancePackComplianceCount@ object.
newAggregateConformancePackComplianceSummary ::
  AggregateConformancePackComplianceSummary
newAggregateConformancePackComplianceSummary :: AggregateConformancePackComplianceSummary
newAggregateConformancePackComplianceSummary =
  AggregateConformancePackComplianceSummary' :: Maybe Text
-> Maybe AggregateConformancePackComplianceCount
-> AggregateConformancePackComplianceSummary
AggregateConformancePackComplianceSummary'
    { $sel:groupName:AggregateConformancePackComplianceSummary' :: Maybe Text
groupName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:complianceSummary:AggregateConformancePackComplianceSummary' :: Maybe AggregateConformancePackComplianceCount
complianceSummary =
        Maybe AggregateConformancePackComplianceCount
forall a. Maybe a
Prelude.Nothing
    }

-- | Groups the result based on Amazon Web Services account ID or Amazon Web
-- Services Region.
aggregateConformancePackComplianceSummary_groupName :: Lens.Lens' AggregateConformancePackComplianceSummary (Prelude.Maybe Prelude.Text)
aggregateConformancePackComplianceSummary_groupName :: (Maybe Text -> f (Maybe Text))
-> AggregateConformancePackComplianceSummary
-> f AggregateConformancePackComplianceSummary
aggregateConformancePackComplianceSummary_groupName = (AggregateConformancePackComplianceSummary -> Maybe Text)
-> (AggregateConformancePackComplianceSummary
    -> Maybe Text -> AggregateConformancePackComplianceSummary)
-> Lens
     AggregateConformancePackComplianceSummary
     AggregateConformancePackComplianceSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AggregateConformancePackComplianceSummary' {Maybe Text
groupName :: Maybe Text
$sel:groupName:AggregateConformancePackComplianceSummary' :: AggregateConformancePackComplianceSummary -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: AggregateConformancePackComplianceSummary
s@AggregateConformancePackComplianceSummary' {} Maybe Text
a -> AggregateConformancePackComplianceSummary
s {$sel:groupName:AggregateConformancePackComplianceSummary' :: Maybe Text
groupName = Maybe Text
a} :: AggregateConformancePackComplianceSummary)

-- | Returns an @AggregateConformancePackComplianceCount@ object.
aggregateConformancePackComplianceSummary_complianceSummary :: Lens.Lens' AggregateConformancePackComplianceSummary (Prelude.Maybe AggregateConformancePackComplianceCount)
aggregateConformancePackComplianceSummary_complianceSummary :: (Maybe AggregateConformancePackComplianceCount
 -> f (Maybe AggregateConformancePackComplianceCount))
-> AggregateConformancePackComplianceSummary
-> f AggregateConformancePackComplianceSummary
aggregateConformancePackComplianceSummary_complianceSummary = (AggregateConformancePackComplianceSummary
 -> Maybe AggregateConformancePackComplianceCount)
-> (AggregateConformancePackComplianceSummary
    -> Maybe AggregateConformancePackComplianceCount
    -> AggregateConformancePackComplianceSummary)
-> Lens
     AggregateConformancePackComplianceSummary
     AggregateConformancePackComplianceSummary
     (Maybe AggregateConformancePackComplianceCount)
     (Maybe AggregateConformancePackComplianceCount)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AggregateConformancePackComplianceSummary' {Maybe AggregateConformancePackComplianceCount
complianceSummary :: Maybe AggregateConformancePackComplianceCount
$sel:complianceSummary:AggregateConformancePackComplianceSummary' :: AggregateConformancePackComplianceSummary
-> Maybe AggregateConformancePackComplianceCount
complianceSummary} -> Maybe AggregateConformancePackComplianceCount
complianceSummary) (\s :: AggregateConformancePackComplianceSummary
s@AggregateConformancePackComplianceSummary' {} Maybe AggregateConformancePackComplianceCount
a -> AggregateConformancePackComplianceSummary
s {$sel:complianceSummary:AggregateConformancePackComplianceSummary' :: Maybe AggregateConformancePackComplianceCount
complianceSummary = Maybe AggregateConformancePackComplianceCount
a} :: AggregateConformancePackComplianceSummary)

instance
  Core.FromJSON
    AggregateConformancePackComplianceSummary
  where
  parseJSON :: Value -> Parser AggregateConformancePackComplianceSummary
parseJSON =
    String
-> (Object -> Parser AggregateConformancePackComplianceSummary)
-> Value
-> Parser AggregateConformancePackComplianceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AggregateConformancePackComplianceSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe AggregateConformancePackComplianceCount
-> AggregateConformancePackComplianceSummary
AggregateConformancePackComplianceSummary'
            (Maybe Text
 -> Maybe AggregateConformancePackComplianceCount
 -> AggregateConformancePackComplianceSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe AggregateConformancePackComplianceCount
      -> AggregateConformancePackComplianceSummary)
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
"GroupName")
              Parser
  (Maybe AggregateConformancePackComplianceCount
   -> AggregateConformancePackComplianceSummary)
-> Parser (Maybe AggregateConformancePackComplianceCount)
-> Parser AggregateConformancePackComplianceSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe AggregateConformancePackComplianceCount)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ComplianceSummary")
      )

instance
  Prelude.Hashable
    AggregateConformancePackComplianceSummary

instance
  Prelude.NFData
    AggregateConformancePackComplianceSummary