{-# 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.Config.GetAggregateConfigRuleComplianceSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the number of compliant and noncompliant rules for one or more
-- accounts and regions in an aggregator.
--
-- The results can return an empty result page, but if you have a
-- nextToken, the results are displayed on the next page.
module Amazonka.Config.GetAggregateConfigRuleComplianceSummary
  ( -- * Creating a Request
    GetAggregateConfigRuleComplianceSummary (..),
    newGetAggregateConfigRuleComplianceSummary,

    -- * Request Lenses
    getAggregateConfigRuleComplianceSummary_filters,
    getAggregateConfigRuleComplianceSummary_groupByKey,
    getAggregateConfigRuleComplianceSummary_limit,
    getAggregateConfigRuleComplianceSummary_nextToken,
    getAggregateConfigRuleComplianceSummary_configurationAggregatorName,

    -- * Destructuring the Response
    GetAggregateConfigRuleComplianceSummaryResponse (..),
    newGetAggregateConfigRuleComplianceSummaryResponse,

    -- * Response Lenses
    getAggregateConfigRuleComplianceSummaryResponse_aggregateComplianceCounts,
    getAggregateConfigRuleComplianceSummaryResponse_groupByKey,
    getAggregateConfigRuleComplianceSummaryResponse_nextToken,
    getAggregateConfigRuleComplianceSummaryResponse_httpStatus,
  )
where

import Amazonka.Config.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetAggregateConfigRuleComplianceSummary' smart constructor.
data GetAggregateConfigRuleComplianceSummary = GetAggregateConfigRuleComplianceSummary'
  { -- | Filters the results based on the ConfigRuleComplianceSummaryFilters
    -- object.
    GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryFilters
filters :: Prelude.Maybe ConfigRuleComplianceSummaryFilters,
    -- | Groups the result based on ACCOUNT_ID or AWS_REGION.
    GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey :: Prelude.Maybe ConfigRuleComplianceSummaryGroupKey,
    -- | The maximum number of evaluation results returned on each page. The
    -- default is 1000. You cannot specify a number greater than 1000. If you
    -- specify 0, Config uses the default.
    GetAggregateConfigRuleComplianceSummary -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The @nextToken@ string returned on a previous page that you use to get
    -- the next page of results in a paginated response.
    GetAggregateConfigRuleComplianceSummary -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the configuration aggregator.
    GetAggregateConfigRuleComplianceSummary -> Text
configurationAggregatorName :: Prelude.Text
  }
  deriving (GetAggregateConfigRuleComplianceSummary
-> GetAggregateConfigRuleComplianceSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAggregateConfigRuleComplianceSummary
-> GetAggregateConfigRuleComplianceSummary -> Bool
$c/= :: GetAggregateConfigRuleComplianceSummary
-> GetAggregateConfigRuleComplianceSummary -> Bool
== :: GetAggregateConfigRuleComplianceSummary
-> GetAggregateConfigRuleComplianceSummary -> Bool
$c== :: GetAggregateConfigRuleComplianceSummary
-> GetAggregateConfigRuleComplianceSummary -> Bool
Prelude.Eq, ReadPrec [GetAggregateConfigRuleComplianceSummary]
ReadPrec GetAggregateConfigRuleComplianceSummary
Int -> ReadS GetAggregateConfigRuleComplianceSummary
ReadS [GetAggregateConfigRuleComplianceSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAggregateConfigRuleComplianceSummary]
$creadListPrec :: ReadPrec [GetAggregateConfigRuleComplianceSummary]
readPrec :: ReadPrec GetAggregateConfigRuleComplianceSummary
$creadPrec :: ReadPrec GetAggregateConfigRuleComplianceSummary
readList :: ReadS [GetAggregateConfigRuleComplianceSummary]
$creadList :: ReadS [GetAggregateConfigRuleComplianceSummary]
readsPrec :: Int -> ReadS GetAggregateConfigRuleComplianceSummary
$creadsPrec :: Int -> ReadS GetAggregateConfigRuleComplianceSummary
Prelude.Read, Int -> GetAggregateConfigRuleComplianceSummary -> ShowS
[GetAggregateConfigRuleComplianceSummary] -> ShowS
GetAggregateConfigRuleComplianceSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAggregateConfigRuleComplianceSummary] -> ShowS
$cshowList :: [GetAggregateConfigRuleComplianceSummary] -> ShowS
show :: GetAggregateConfigRuleComplianceSummary -> String
$cshow :: GetAggregateConfigRuleComplianceSummary -> String
showsPrec :: Int -> GetAggregateConfigRuleComplianceSummary -> ShowS
$cshowsPrec :: Int -> GetAggregateConfigRuleComplianceSummary -> ShowS
Prelude.Show, forall x.
Rep GetAggregateConfigRuleComplianceSummary x
-> GetAggregateConfigRuleComplianceSummary
forall x.
GetAggregateConfigRuleComplianceSummary
-> Rep GetAggregateConfigRuleComplianceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAggregateConfigRuleComplianceSummary x
-> GetAggregateConfigRuleComplianceSummary
$cfrom :: forall x.
GetAggregateConfigRuleComplianceSummary
-> Rep GetAggregateConfigRuleComplianceSummary x
Prelude.Generic)

-- |
-- Create a value of 'GetAggregateConfigRuleComplianceSummary' 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:
--
-- 'filters', 'getAggregateConfigRuleComplianceSummary_filters' - Filters the results based on the ConfigRuleComplianceSummaryFilters
-- object.
--
-- 'groupByKey', 'getAggregateConfigRuleComplianceSummary_groupByKey' - Groups the result based on ACCOUNT_ID or AWS_REGION.
--
-- 'limit', 'getAggregateConfigRuleComplianceSummary_limit' - The maximum number of evaluation results returned on each page. The
-- default is 1000. You cannot specify a number greater than 1000. If you
-- specify 0, Config uses the default.
--
-- 'nextToken', 'getAggregateConfigRuleComplianceSummary_nextToken' - The @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
--
-- 'configurationAggregatorName', 'getAggregateConfigRuleComplianceSummary_configurationAggregatorName' - The name of the configuration aggregator.
newGetAggregateConfigRuleComplianceSummary ::
  -- | 'configurationAggregatorName'
  Prelude.Text ->
  GetAggregateConfigRuleComplianceSummary
newGetAggregateConfigRuleComplianceSummary :: Text -> GetAggregateConfigRuleComplianceSummary
newGetAggregateConfigRuleComplianceSummary
  Text
pConfigurationAggregatorName_ =
    GetAggregateConfigRuleComplianceSummary'
      { $sel:filters:GetAggregateConfigRuleComplianceSummary' :: Maybe ConfigRuleComplianceSummaryFilters
filters =
          forall a. Maybe a
Prelude.Nothing,
        $sel:groupByKey:GetAggregateConfigRuleComplianceSummary' :: Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey = forall a. Maybe a
Prelude.Nothing,
        $sel:limit:GetAggregateConfigRuleComplianceSummary' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetAggregateConfigRuleComplianceSummary' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:configurationAggregatorName:GetAggregateConfigRuleComplianceSummary' :: Text
configurationAggregatorName =
          Text
pConfigurationAggregatorName_
      }

-- | Filters the results based on the ConfigRuleComplianceSummaryFilters
-- object.
getAggregateConfigRuleComplianceSummary_filters :: Lens.Lens' GetAggregateConfigRuleComplianceSummary (Prelude.Maybe ConfigRuleComplianceSummaryFilters)
getAggregateConfigRuleComplianceSummary_filters :: Lens'
  GetAggregateConfigRuleComplianceSummary
  (Maybe ConfigRuleComplianceSummaryFilters)
getAggregateConfigRuleComplianceSummary_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAggregateConfigRuleComplianceSummary' {Maybe ConfigRuleComplianceSummaryFilters
filters :: Maybe ConfigRuleComplianceSummaryFilters
$sel:filters:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryFilters
filters} -> Maybe ConfigRuleComplianceSummaryFilters
filters) (\s :: GetAggregateConfigRuleComplianceSummary
s@GetAggregateConfigRuleComplianceSummary' {} Maybe ConfigRuleComplianceSummaryFilters
a -> GetAggregateConfigRuleComplianceSummary
s {$sel:filters:GetAggregateConfigRuleComplianceSummary' :: Maybe ConfigRuleComplianceSummaryFilters
filters = Maybe ConfigRuleComplianceSummaryFilters
a} :: GetAggregateConfigRuleComplianceSummary)

-- | Groups the result based on ACCOUNT_ID or AWS_REGION.
getAggregateConfigRuleComplianceSummary_groupByKey :: Lens.Lens' GetAggregateConfigRuleComplianceSummary (Prelude.Maybe ConfigRuleComplianceSummaryGroupKey)
getAggregateConfigRuleComplianceSummary_groupByKey :: Lens'
  GetAggregateConfigRuleComplianceSummary
  (Maybe ConfigRuleComplianceSummaryGroupKey)
getAggregateConfigRuleComplianceSummary_groupByKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAggregateConfigRuleComplianceSummary' {Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey :: Maybe ConfigRuleComplianceSummaryGroupKey
$sel:groupByKey:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey} -> Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey) (\s :: GetAggregateConfigRuleComplianceSummary
s@GetAggregateConfigRuleComplianceSummary' {} Maybe ConfigRuleComplianceSummaryGroupKey
a -> GetAggregateConfigRuleComplianceSummary
s {$sel:groupByKey:GetAggregateConfigRuleComplianceSummary' :: Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey = Maybe ConfigRuleComplianceSummaryGroupKey
a} :: GetAggregateConfigRuleComplianceSummary)

-- | The maximum number of evaluation results returned on each page. The
-- default is 1000. You cannot specify a number greater than 1000. If you
-- specify 0, Config uses the default.
getAggregateConfigRuleComplianceSummary_limit :: Lens.Lens' GetAggregateConfigRuleComplianceSummary (Prelude.Maybe Prelude.Natural)
getAggregateConfigRuleComplianceSummary_limit :: Lens' GetAggregateConfigRuleComplianceSummary (Maybe Natural)
getAggregateConfigRuleComplianceSummary_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAggregateConfigRuleComplianceSummary' {Maybe Natural
limit :: Maybe Natural
$sel:limit:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: GetAggregateConfigRuleComplianceSummary
s@GetAggregateConfigRuleComplianceSummary' {} Maybe Natural
a -> GetAggregateConfigRuleComplianceSummary
s {$sel:limit:GetAggregateConfigRuleComplianceSummary' :: Maybe Natural
limit = Maybe Natural
a} :: GetAggregateConfigRuleComplianceSummary)

-- | The @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
getAggregateConfigRuleComplianceSummary_nextToken :: Lens.Lens' GetAggregateConfigRuleComplianceSummary (Prelude.Maybe Prelude.Text)
getAggregateConfigRuleComplianceSummary_nextToken :: Lens' GetAggregateConfigRuleComplianceSummary (Maybe Text)
getAggregateConfigRuleComplianceSummary_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAggregateConfigRuleComplianceSummary' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAggregateConfigRuleComplianceSummary
s@GetAggregateConfigRuleComplianceSummary' {} Maybe Text
a -> GetAggregateConfigRuleComplianceSummary
s {$sel:nextToken:GetAggregateConfigRuleComplianceSummary' :: Maybe Text
nextToken = Maybe Text
a} :: GetAggregateConfigRuleComplianceSummary)

-- | The name of the configuration aggregator.
getAggregateConfigRuleComplianceSummary_configurationAggregatorName :: Lens.Lens' GetAggregateConfigRuleComplianceSummary Prelude.Text
getAggregateConfigRuleComplianceSummary_configurationAggregatorName :: Lens' GetAggregateConfigRuleComplianceSummary Text
getAggregateConfigRuleComplianceSummary_configurationAggregatorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAggregateConfigRuleComplianceSummary' {Text
configurationAggregatorName :: Text
$sel:configurationAggregatorName:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Text
configurationAggregatorName} -> Text
configurationAggregatorName) (\s :: GetAggregateConfigRuleComplianceSummary
s@GetAggregateConfigRuleComplianceSummary' {} Text
a -> GetAggregateConfigRuleComplianceSummary
s {$sel:configurationAggregatorName:GetAggregateConfigRuleComplianceSummary' :: Text
configurationAggregatorName = Text
a} :: GetAggregateConfigRuleComplianceSummary)

instance
  Core.AWSRequest
    GetAggregateConfigRuleComplianceSummary
  where
  type
    AWSResponse
      GetAggregateConfigRuleComplianceSummary =
      GetAggregateConfigRuleComplianceSummaryResponse
  request :: (Service -> Service)
-> GetAggregateConfigRuleComplianceSummary
-> Request GetAggregateConfigRuleComplianceSummary
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetAggregateConfigRuleComplianceSummary
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetAggregateConfigRuleComplianceSummary)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [AggregateComplianceCount]
-> Maybe Text
-> Maybe Text
-> Int
-> GetAggregateConfigRuleComplianceSummaryResponse
GetAggregateConfigRuleComplianceSummaryResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AggregateComplianceCounts"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GroupByKey")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetAggregateConfigRuleComplianceSummary
  where
  hashWithSalt :: Int -> GetAggregateConfigRuleComplianceSummary -> Int
hashWithSalt
    Int
_salt
    GetAggregateConfigRuleComplianceSummary' {Maybe Natural
Maybe Text
Maybe ConfigRuleComplianceSummaryFilters
Maybe ConfigRuleComplianceSummaryGroupKey
Text
configurationAggregatorName :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
groupByKey :: Maybe ConfigRuleComplianceSummaryGroupKey
filters :: Maybe ConfigRuleComplianceSummaryFilters
$sel:configurationAggregatorName:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Text
$sel:nextToken:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Maybe Text
$sel:limit:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Maybe Natural
$sel:groupByKey:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryGroupKey
$sel:filters:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryFilters
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigRuleComplianceSummaryFilters
filters
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configurationAggregatorName

instance
  Prelude.NFData
    GetAggregateConfigRuleComplianceSummary
  where
  rnf :: GetAggregateConfigRuleComplianceSummary -> ()
rnf GetAggregateConfigRuleComplianceSummary' {Maybe Natural
Maybe Text
Maybe ConfigRuleComplianceSummaryFilters
Maybe ConfigRuleComplianceSummaryGroupKey
Text
configurationAggregatorName :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
groupByKey :: Maybe ConfigRuleComplianceSummaryGroupKey
filters :: Maybe ConfigRuleComplianceSummaryFilters
$sel:configurationAggregatorName:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Text
$sel:nextToken:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Maybe Text
$sel:limit:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Maybe Natural
$sel:groupByKey:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryGroupKey
$sel:filters:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryFilters
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigRuleComplianceSummaryFilters
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
configurationAggregatorName

instance
  Data.ToHeaders
    GetAggregateConfigRuleComplianceSummary
  where
  toHeaders :: GetAggregateConfigRuleComplianceSummary -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"StarlingDoveService.GetAggregateConfigRuleComplianceSummary" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    GetAggregateConfigRuleComplianceSummary
  where
  toJSON :: GetAggregateConfigRuleComplianceSummary -> Value
toJSON GetAggregateConfigRuleComplianceSummary' {Maybe Natural
Maybe Text
Maybe ConfigRuleComplianceSummaryFilters
Maybe ConfigRuleComplianceSummaryGroupKey
Text
configurationAggregatorName :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
groupByKey :: Maybe ConfigRuleComplianceSummaryGroupKey
filters :: Maybe ConfigRuleComplianceSummaryFilters
$sel:configurationAggregatorName:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Text
$sel:nextToken:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Maybe Text
$sel:limit:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary -> Maybe Natural
$sel:groupByKey:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryGroupKey
$sel:filters:GetAggregateConfigRuleComplianceSummary' :: GetAggregateConfigRuleComplianceSummary
-> Maybe ConfigRuleComplianceSummaryFilters
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConfigRuleComplianceSummaryFilters
filters,
            (Key
"GroupByKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConfigRuleComplianceSummaryGroupKey
groupByKey,
            (Key
"Limit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"ConfigurationAggregatorName"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
configurationAggregatorName
              )
          ]
      )

instance
  Data.ToPath
    GetAggregateConfigRuleComplianceSummary
  where
  toPath :: GetAggregateConfigRuleComplianceSummary -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetAggregateConfigRuleComplianceSummaryResponse' smart constructor.
data GetAggregateConfigRuleComplianceSummaryResponse = GetAggregateConfigRuleComplianceSummaryResponse'
  { -- | Returns a list of AggregateComplianceCounts object.
    GetAggregateConfigRuleComplianceSummaryResponse
-> Maybe [AggregateComplianceCount]
aggregateComplianceCounts :: Prelude.Maybe [AggregateComplianceCount],
    -- | Groups the result based on ACCOUNT_ID or AWS_REGION.
    GetAggregateConfigRuleComplianceSummaryResponse -> Maybe Text
groupByKey :: Prelude.Maybe Prelude.Text,
    -- | The @nextToken@ string returned on a previous page that you use to get
    -- the next page of results in a paginated response.
    GetAggregateConfigRuleComplianceSummaryResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetAggregateConfigRuleComplianceSummaryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetAggregateConfigRuleComplianceSummaryResponse
-> GetAggregateConfigRuleComplianceSummaryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAggregateConfigRuleComplianceSummaryResponse
-> GetAggregateConfigRuleComplianceSummaryResponse -> Bool
$c/= :: GetAggregateConfigRuleComplianceSummaryResponse
-> GetAggregateConfigRuleComplianceSummaryResponse -> Bool
== :: GetAggregateConfigRuleComplianceSummaryResponse
-> GetAggregateConfigRuleComplianceSummaryResponse -> Bool
$c== :: GetAggregateConfigRuleComplianceSummaryResponse
-> GetAggregateConfigRuleComplianceSummaryResponse -> Bool
Prelude.Eq, ReadPrec [GetAggregateConfigRuleComplianceSummaryResponse]
ReadPrec GetAggregateConfigRuleComplianceSummaryResponse
Int -> ReadS GetAggregateConfigRuleComplianceSummaryResponse
ReadS [GetAggregateConfigRuleComplianceSummaryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAggregateConfigRuleComplianceSummaryResponse]
$creadListPrec :: ReadPrec [GetAggregateConfigRuleComplianceSummaryResponse]
readPrec :: ReadPrec GetAggregateConfigRuleComplianceSummaryResponse
$creadPrec :: ReadPrec GetAggregateConfigRuleComplianceSummaryResponse
readList :: ReadS [GetAggregateConfigRuleComplianceSummaryResponse]
$creadList :: ReadS [GetAggregateConfigRuleComplianceSummaryResponse]
readsPrec :: Int -> ReadS GetAggregateConfigRuleComplianceSummaryResponse
$creadsPrec :: Int -> ReadS GetAggregateConfigRuleComplianceSummaryResponse
Prelude.Read, Int -> GetAggregateConfigRuleComplianceSummaryResponse -> ShowS
[GetAggregateConfigRuleComplianceSummaryResponse] -> ShowS
GetAggregateConfigRuleComplianceSummaryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAggregateConfigRuleComplianceSummaryResponse] -> ShowS
$cshowList :: [GetAggregateConfigRuleComplianceSummaryResponse] -> ShowS
show :: GetAggregateConfigRuleComplianceSummaryResponse -> String
$cshow :: GetAggregateConfigRuleComplianceSummaryResponse -> String
showsPrec :: Int -> GetAggregateConfigRuleComplianceSummaryResponse -> ShowS
$cshowsPrec :: Int -> GetAggregateConfigRuleComplianceSummaryResponse -> ShowS
Prelude.Show, forall x.
Rep GetAggregateConfigRuleComplianceSummaryResponse x
-> GetAggregateConfigRuleComplianceSummaryResponse
forall x.
GetAggregateConfigRuleComplianceSummaryResponse
-> Rep GetAggregateConfigRuleComplianceSummaryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAggregateConfigRuleComplianceSummaryResponse x
-> GetAggregateConfigRuleComplianceSummaryResponse
$cfrom :: forall x.
GetAggregateConfigRuleComplianceSummaryResponse
-> Rep GetAggregateConfigRuleComplianceSummaryResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAggregateConfigRuleComplianceSummaryResponse' 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:
--
-- 'aggregateComplianceCounts', 'getAggregateConfigRuleComplianceSummaryResponse_aggregateComplianceCounts' - Returns a list of AggregateComplianceCounts object.
--
-- 'groupByKey', 'getAggregateConfigRuleComplianceSummaryResponse_groupByKey' - Groups the result based on ACCOUNT_ID or AWS_REGION.
--
-- 'nextToken', 'getAggregateConfigRuleComplianceSummaryResponse_nextToken' - The @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
--
-- 'httpStatus', 'getAggregateConfigRuleComplianceSummaryResponse_httpStatus' - The response's http status code.
newGetAggregateConfigRuleComplianceSummaryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAggregateConfigRuleComplianceSummaryResponse
newGetAggregateConfigRuleComplianceSummaryResponse :: Int -> GetAggregateConfigRuleComplianceSummaryResponse
newGetAggregateConfigRuleComplianceSummaryResponse
  Int
pHttpStatus_ =
    GetAggregateConfigRuleComplianceSummaryResponse'
      { $sel:aggregateComplianceCounts:GetAggregateConfigRuleComplianceSummaryResponse' :: Maybe [AggregateComplianceCount]
aggregateComplianceCounts =
          forall a. Maybe a
Prelude.Nothing,
        $sel:groupByKey:GetAggregateConfigRuleComplianceSummaryResponse' :: Maybe Text
groupByKey =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetAggregateConfigRuleComplianceSummaryResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetAggregateConfigRuleComplianceSummaryResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Returns a list of AggregateComplianceCounts object.
getAggregateConfigRuleComplianceSummaryResponse_aggregateComplianceCounts :: Lens.Lens' GetAggregateConfigRuleComplianceSummaryResponse (Prelude.Maybe [AggregateComplianceCount])
getAggregateConfigRuleComplianceSummaryResponse_aggregateComplianceCounts :: Lens'
  GetAggregateConfigRuleComplianceSummaryResponse
  (Maybe [AggregateComplianceCount])
getAggregateConfigRuleComplianceSummaryResponse_aggregateComplianceCounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAggregateConfigRuleComplianceSummaryResponse' {Maybe [AggregateComplianceCount]
aggregateComplianceCounts :: Maybe [AggregateComplianceCount]
$sel:aggregateComplianceCounts:GetAggregateConfigRuleComplianceSummaryResponse' :: GetAggregateConfigRuleComplianceSummaryResponse
-> Maybe [AggregateComplianceCount]
aggregateComplianceCounts} -> Maybe [AggregateComplianceCount]
aggregateComplianceCounts) (\s :: GetAggregateConfigRuleComplianceSummaryResponse
s@GetAggregateConfigRuleComplianceSummaryResponse' {} Maybe [AggregateComplianceCount]
a -> GetAggregateConfigRuleComplianceSummaryResponse
s {$sel:aggregateComplianceCounts:GetAggregateConfigRuleComplianceSummaryResponse' :: Maybe [AggregateComplianceCount]
aggregateComplianceCounts = Maybe [AggregateComplianceCount]
a} :: GetAggregateConfigRuleComplianceSummaryResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Groups the result based on ACCOUNT_ID or AWS_REGION.
getAggregateConfigRuleComplianceSummaryResponse_groupByKey :: Lens.Lens' GetAggregateConfigRuleComplianceSummaryResponse (Prelude.Maybe Prelude.Text)
getAggregateConfigRuleComplianceSummaryResponse_groupByKey :: Lens' GetAggregateConfigRuleComplianceSummaryResponse (Maybe Text)
getAggregateConfigRuleComplianceSummaryResponse_groupByKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAggregateConfigRuleComplianceSummaryResponse' {Maybe Text
groupByKey :: Maybe Text
$sel:groupByKey:GetAggregateConfigRuleComplianceSummaryResponse' :: GetAggregateConfigRuleComplianceSummaryResponse -> Maybe Text
groupByKey} -> Maybe Text
groupByKey) (\s :: GetAggregateConfigRuleComplianceSummaryResponse
s@GetAggregateConfigRuleComplianceSummaryResponse' {} Maybe Text
a -> GetAggregateConfigRuleComplianceSummaryResponse
s {$sel:groupByKey:GetAggregateConfigRuleComplianceSummaryResponse' :: Maybe Text
groupByKey = Maybe Text
a} :: GetAggregateConfigRuleComplianceSummaryResponse)

-- | The @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
getAggregateConfigRuleComplianceSummaryResponse_nextToken :: Lens.Lens' GetAggregateConfigRuleComplianceSummaryResponse (Prelude.Maybe Prelude.Text)
getAggregateConfigRuleComplianceSummaryResponse_nextToken :: Lens' GetAggregateConfigRuleComplianceSummaryResponse (Maybe Text)
getAggregateConfigRuleComplianceSummaryResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAggregateConfigRuleComplianceSummaryResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetAggregateConfigRuleComplianceSummaryResponse' :: GetAggregateConfigRuleComplianceSummaryResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetAggregateConfigRuleComplianceSummaryResponse
s@GetAggregateConfigRuleComplianceSummaryResponse' {} Maybe Text
a -> GetAggregateConfigRuleComplianceSummaryResponse
s {$sel:nextToken:GetAggregateConfigRuleComplianceSummaryResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetAggregateConfigRuleComplianceSummaryResponse)

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

instance
  Prelude.NFData
    GetAggregateConfigRuleComplianceSummaryResponse
  where
  rnf :: GetAggregateConfigRuleComplianceSummaryResponse -> ()
rnf
    GetAggregateConfigRuleComplianceSummaryResponse' {Int
Maybe [AggregateComplianceCount]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
groupByKey :: Maybe Text
aggregateComplianceCounts :: Maybe [AggregateComplianceCount]
$sel:httpStatus:GetAggregateConfigRuleComplianceSummaryResponse' :: GetAggregateConfigRuleComplianceSummaryResponse -> Int
$sel:nextToken:GetAggregateConfigRuleComplianceSummaryResponse' :: GetAggregateConfigRuleComplianceSummaryResponse -> Maybe Text
$sel:groupByKey:GetAggregateConfigRuleComplianceSummaryResponse' :: GetAggregateConfigRuleComplianceSummaryResponse -> Maybe Text
$sel:aggregateComplianceCounts:GetAggregateConfigRuleComplianceSummaryResponse' :: GetAggregateConfigRuleComplianceSummaryResponse
-> Maybe [AggregateComplianceCount]
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe [AggregateComplianceCount]
aggregateComplianceCounts
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupByKey
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus