{-# 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.AggregateConformancePackComplianceCount
-- 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.AggregateConformancePackComplianceCount where

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

-- | The number of conformance packs that are compliant and noncompliant.
--
-- /See:/ 'newAggregateConformancePackComplianceCount' smart constructor.
data AggregateConformancePackComplianceCount = AggregateConformancePackComplianceCount'
  { -- | Number of compliant conformance packs.
    AggregateConformancePackComplianceCount -> Maybe Int
compliantConformancePackCount :: Prelude.Maybe Prelude.Int,
    -- | Number of noncompliant conformance packs.
    AggregateConformancePackComplianceCount -> Maybe Int
nonCompliantConformancePackCount :: Prelude.Maybe Prelude.Int
  }
  deriving (AggregateConformancePackComplianceCount
-> AggregateConformancePackComplianceCount -> Bool
(AggregateConformancePackComplianceCount
 -> AggregateConformancePackComplianceCount -> Bool)
-> (AggregateConformancePackComplianceCount
    -> AggregateConformancePackComplianceCount -> Bool)
-> Eq AggregateConformancePackComplianceCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AggregateConformancePackComplianceCount
-> AggregateConformancePackComplianceCount -> Bool
$c/= :: AggregateConformancePackComplianceCount
-> AggregateConformancePackComplianceCount -> Bool
== :: AggregateConformancePackComplianceCount
-> AggregateConformancePackComplianceCount -> Bool
$c== :: AggregateConformancePackComplianceCount
-> AggregateConformancePackComplianceCount -> Bool
Prelude.Eq, ReadPrec [AggregateConformancePackComplianceCount]
ReadPrec AggregateConformancePackComplianceCount
Int -> ReadS AggregateConformancePackComplianceCount
ReadS [AggregateConformancePackComplianceCount]
(Int -> ReadS AggregateConformancePackComplianceCount)
-> ReadS [AggregateConformancePackComplianceCount]
-> ReadPrec AggregateConformancePackComplianceCount
-> ReadPrec [AggregateConformancePackComplianceCount]
-> Read AggregateConformancePackComplianceCount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AggregateConformancePackComplianceCount]
$creadListPrec :: ReadPrec [AggregateConformancePackComplianceCount]
readPrec :: ReadPrec AggregateConformancePackComplianceCount
$creadPrec :: ReadPrec AggregateConformancePackComplianceCount
readList :: ReadS [AggregateConformancePackComplianceCount]
$creadList :: ReadS [AggregateConformancePackComplianceCount]
readsPrec :: Int -> ReadS AggregateConformancePackComplianceCount
$creadsPrec :: Int -> ReadS AggregateConformancePackComplianceCount
Prelude.Read, Int -> AggregateConformancePackComplianceCount -> ShowS
[AggregateConformancePackComplianceCount] -> ShowS
AggregateConformancePackComplianceCount -> String
(Int -> AggregateConformancePackComplianceCount -> ShowS)
-> (AggregateConformancePackComplianceCount -> String)
-> ([AggregateConformancePackComplianceCount] -> ShowS)
-> Show AggregateConformancePackComplianceCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AggregateConformancePackComplianceCount] -> ShowS
$cshowList :: [AggregateConformancePackComplianceCount] -> ShowS
show :: AggregateConformancePackComplianceCount -> String
$cshow :: AggregateConformancePackComplianceCount -> String
showsPrec :: Int -> AggregateConformancePackComplianceCount -> ShowS
$cshowsPrec :: Int -> AggregateConformancePackComplianceCount -> ShowS
Prelude.Show, (forall x.
 AggregateConformancePackComplianceCount
 -> Rep AggregateConformancePackComplianceCount x)
-> (forall x.
    Rep AggregateConformancePackComplianceCount x
    -> AggregateConformancePackComplianceCount)
-> Generic AggregateConformancePackComplianceCount
forall x.
Rep AggregateConformancePackComplianceCount x
-> AggregateConformancePackComplianceCount
forall x.
AggregateConformancePackComplianceCount
-> Rep AggregateConformancePackComplianceCount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AggregateConformancePackComplianceCount x
-> AggregateConformancePackComplianceCount
$cfrom :: forall x.
AggregateConformancePackComplianceCount
-> Rep AggregateConformancePackComplianceCount x
Prelude.Generic)

-- |
-- Create a value of 'AggregateConformancePackComplianceCount' 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:
--
-- 'compliantConformancePackCount', 'aggregateConformancePackComplianceCount_compliantConformancePackCount' - Number of compliant conformance packs.
--
-- 'nonCompliantConformancePackCount', 'aggregateConformancePackComplianceCount_nonCompliantConformancePackCount' - Number of noncompliant conformance packs.
newAggregateConformancePackComplianceCount ::
  AggregateConformancePackComplianceCount
newAggregateConformancePackComplianceCount :: AggregateConformancePackComplianceCount
newAggregateConformancePackComplianceCount =
  AggregateConformancePackComplianceCount' :: Maybe Int -> Maybe Int -> AggregateConformancePackComplianceCount
AggregateConformancePackComplianceCount'
    { $sel:compliantConformancePackCount:AggregateConformancePackComplianceCount' :: Maybe Int
compliantConformancePackCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:nonCompliantConformancePackCount:AggregateConformancePackComplianceCount' :: Maybe Int
nonCompliantConformancePackCount =
        Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Number of compliant conformance packs.
aggregateConformancePackComplianceCount_compliantConformancePackCount :: Lens.Lens' AggregateConformancePackComplianceCount (Prelude.Maybe Prelude.Int)
aggregateConformancePackComplianceCount_compliantConformancePackCount :: (Maybe Int -> f (Maybe Int))
-> AggregateConformancePackComplianceCount
-> f AggregateConformancePackComplianceCount
aggregateConformancePackComplianceCount_compliantConformancePackCount = (AggregateConformancePackComplianceCount -> Maybe Int)
-> (AggregateConformancePackComplianceCount
    -> Maybe Int -> AggregateConformancePackComplianceCount)
-> Lens
     AggregateConformancePackComplianceCount
     AggregateConformancePackComplianceCount
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AggregateConformancePackComplianceCount' {Maybe Int
compliantConformancePackCount :: Maybe Int
$sel:compliantConformancePackCount:AggregateConformancePackComplianceCount' :: AggregateConformancePackComplianceCount -> Maybe Int
compliantConformancePackCount} -> Maybe Int
compliantConformancePackCount) (\s :: AggregateConformancePackComplianceCount
s@AggregateConformancePackComplianceCount' {} Maybe Int
a -> AggregateConformancePackComplianceCount
s {$sel:compliantConformancePackCount:AggregateConformancePackComplianceCount' :: Maybe Int
compliantConformancePackCount = Maybe Int
a} :: AggregateConformancePackComplianceCount)

-- | Number of noncompliant conformance packs.
aggregateConformancePackComplianceCount_nonCompliantConformancePackCount :: Lens.Lens' AggregateConformancePackComplianceCount (Prelude.Maybe Prelude.Int)
aggregateConformancePackComplianceCount_nonCompliantConformancePackCount :: (Maybe Int -> f (Maybe Int))
-> AggregateConformancePackComplianceCount
-> f AggregateConformancePackComplianceCount
aggregateConformancePackComplianceCount_nonCompliantConformancePackCount = (AggregateConformancePackComplianceCount -> Maybe Int)
-> (AggregateConformancePackComplianceCount
    -> Maybe Int -> AggregateConformancePackComplianceCount)
-> Lens
     AggregateConformancePackComplianceCount
     AggregateConformancePackComplianceCount
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AggregateConformancePackComplianceCount' {Maybe Int
nonCompliantConformancePackCount :: Maybe Int
$sel:nonCompliantConformancePackCount:AggregateConformancePackComplianceCount' :: AggregateConformancePackComplianceCount -> Maybe Int
nonCompliantConformancePackCount} -> Maybe Int
nonCompliantConformancePackCount) (\s :: AggregateConformancePackComplianceCount
s@AggregateConformancePackComplianceCount' {} Maybe Int
a -> AggregateConformancePackComplianceCount
s {$sel:nonCompliantConformancePackCount:AggregateConformancePackComplianceCount' :: Maybe Int
nonCompliantConformancePackCount = Maybe Int
a} :: AggregateConformancePackComplianceCount)

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

instance
  Prelude.Hashable
    AggregateConformancePackComplianceCount

instance
  Prelude.NFData
    AggregateConformancePackComplianceCount