{-# 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.DescribeAggregateComplianceByConformancePacks
-- 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 a list of the conformance packs and their associated compliance
-- status with the count of compliant and noncompliant Config rules within
-- each conformance pack. Also returns the total rule count which includes
-- compliant rules, noncompliant rules, and rules that cannot be evaluated
-- due to insufficient data.
--
-- The results can return an empty result page, but if you have a
-- @nextToken@, the results are displayed on the next page.
--
-- This operation returns paginated results.
module Amazonka.Config.DescribeAggregateComplianceByConformancePacks
  ( -- * Creating a Request
    DescribeAggregateComplianceByConformancePacks (..),
    newDescribeAggregateComplianceByConformancePacks,

    -- * Request Lenses
    describeAggregateComplianceByConformancePacks_filters,
    describeAggregateComplianceByConformancePacks_limit,
    describeAggregateComplianceByConformancePacks_nextToken,
    describeAggregateComplianceByConformancePacks_configurationAggregatorName,

    -- * Destructuring the Response
    DescribeAggregateComplianceByConformancePacksResponse (..),
    newDescribeAggregateComplianceByConformancePacksResponse,

    -- * Response Lenses
    describeAggregateComplianceByConformancePacksResponse_aggregateComplianceByConformancePacks,
    describeAggregateComplianceByConformancePacksResponse_nextToken,
    describeAggregateComplianceByConformancePacksResponse_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:/ 'newDescribeAggregateComplianceByConformancePacks' smart constructor.
data DescribeAggregateComplianceByConformancePacks = DescribeAggregateComplianceByConformancePacks'
  { -- | Filters the result by @AggregateConformancePackComplianceFilters@
    -- object.
    DescribeAggregateComplianceByConformancePacks
-> Maybe AggregateConformancePackComplianceFilters
filters :: Prelude.Maybe AggregateConformancePackComplianceFilters,
    -- | The maximum number of conformance packs compliance details returned on
    -- each page. The default is maximum. If you specify 0, Config uses the
    -- default.
    DescribeAggregateComplianceByConformancePacks -> 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.
    DescribeAggregateComplianceByConformancePacks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the configuration aggregator.
    DescribeAggregateComplianceByConformancePacks -> Text
configurationAggregatorName :: Prelude.Text
  }
  deriving (DescribeAggregateComplianceByConformancePacks
-> DescribeAggregateComplianceByConformancePacks -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAggregateComplianceByConformancePacks
-> DescribeAggregateComplianceByConformancePacks -> Bool
$c/= :: DescribeAggregateComplianceByConformancePacks
-> DescribeAggregateComplianceByConformancePacks -> Bool
== :: DescribeAggregateComplianceByConformancePacks
-> DescribeAggregateComplianceByConformancePacks -> Bool
$c== :: DescribeAggregateComplianceByConformancePacks
-> DescribeAggregateComplianceByConformancePacks -> Bool
Prelude.Eq, ReadPrec [DescribeAggregateComplianceByConformancePacks]
ReadPrec DescribeAggregateComplianceByConformancePacks
Int -> ReadS DescribeAggregateComplianceByConformancePacks
ReadS [DescribeAggregateComplianceByConformancePacks]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAggregateComplianceByConformancePacks]
$creadListPrec :: ReadPrec [DescribeAggregateComplianceByConformancePacks]
readPrec :: ReadPrec DescribeAggregateComplianceByConformancePacks
$creadPrec :: ReadPrec DescribeAggregateComplianceByConformancePacks
readList :: ReadS [DescribeAggregateComplianceByConformancePacks]
$creadList :: ReadS [DescribeAggregateComplianceByConformancePacks]
readsPrec :: Int -> ReadS DescribeAggregateComplianceByConformancePacks
$creadsPrec :: Int -> ReadS DescribeAggregateComplianceByConformancePacks
Prelude.Read, Int -> DescribeAggregateComplianceByConformancePacks -> ShowS
[DescribeAggregateComplianceByConformancePacks] -> ShowS
DescribeAggregateComplianceByConformancePacks -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAggregateComplianceByConformancePacks] -> ShowS
$cshowList :: [DescribeAggregateComplianceByConformancePacks] -> ShowS
show :: DescribeAggregateComplianceByConformancePacks -> String
$cshow :: DescribeAggregateComplianceByConformancePacks -> String
showsPrec :: Int -> DescribeAggregateComplianceByConformancePacks -> ShowS
$cshowsPrec :: Int -> DescribeAggregateComplianceByConformancePacks -> ShowS
Prelude.Show, forall x.
Rep DescribeAggregateComplianceByConformancePacks x
-> DescribeAggregateComplianceByConformancePacks
forall x.
DescribeAggregateComplianceByConformancePacks
-> Rep DescribeAggregateComplianceByConformancePacks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAggregateComplianceByConformancePacks x
-> DescribeAggregateComplianceByConformancePacks
$cfrom :: forall x.
DescribeAggregateComplianceByConformancePacks
-> Rep DescribeAggregateComplianceByConformancePacks x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAggregateComplianceByConformancePacks' 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', 'describeAggregateComplianceByConformancePacks_filters' - Filters the result by @AggregateConformancePackComplianceFilters@
-- object.
--
-- 'limit', 'describeAggregateComplianceByConformancePacks_limit' - The maximum number of conformance packs compliance details returned on
-- each page. The default is maximum. If you specify 0, Config uses the
-- default.
--
-- 'nextToken', 'describeAggregateComplianceByConformancePacks_nextToken' - The @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
--
-- 'configurationAggregatorName', 'describeAggregateComplianceByConformancePacks_configurationAggregatorName' - The name of the configuration aggregator.
newDescribeAggregateComplianceByConformancePacks ::
  -- | 'configurationAggregatorName'
  Prelude.Text ->
  DescribeAggregateComplianceByConformancePacks
newDescribeAggregateComplianceByConformancePacks :: Text -> DescribeAggregateComplianceByConformancePacks
newDescribeAggregateComplianceByConformancePacks
  Text
pConfigurationAggregatorName_ =
    DescribeAggregateComplianceByConformancePacks'
      { $sel:filters:DescribeAggregateComplianceByConformancePacks' :: Maybe AggregateConformancePackComplianceFilters
filters =
          forall a. Maybe a
Prelude.Nothing,
        $sel:limit:DescribeAggregateComplianceByConformancePacks' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeAggregateComplianceByConformancePacks' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:configurationAggregatorName:DescribeAggregateComplianceByConformancePacks' :: Text
configurationAggregatorName =
          Text
pConfigurationAggregatorName_
      }

-- | Filters the result by @AggregateConformancePackComplianceFilters@
-- object.
describeAggregateComplianceByConformancePacks_filters :: Lens.Lens' DescribeAggregateComplianceByConformancePacks (Prelude.Maybe AggregateConformancePackComplianceFilters)
describeAggregateComplianceByConformancePacks_filters :: Lens'
  DescribeAggregateComplianceByConformancePacks
  (Maybe AggregateConformancePackComplianceFilters)
describeAggregateComplianceByConformancePacks_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAggregateComplianceByConformancePacks' {Maybe AggregateConformancePackComplianceFilters
filters :: Maybe AggregateConformancePackComplianceFilters
$sel:filters:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks
-> Maybe AggregateConformancePackComplianceFilters
filters} -> Maybe AggregateConformancePackComplianceFilters
filters) (\s :: DescribeAggregateComplianceByConformancePacks
s@DescribeAggregateComplianceByConformancePacks' {} Maybe AggregateConformancePackComplianceFilters
a -> DescribeAggregateComplianceByConformancePacks
s {$sel:filters:DescribeAggregateComplianceByConformancePacks' :: Maybe AggregateConformancePackComplianceFilters
filters = Maybe AggregateConformancePackComplianceFilters
a} :: DescribeAggregateComplianceByConformancePacks)

-- | The maximum number of conformance packs compliance details returned on
-- each page. The default is maximum. If you specify 0, Config uses the
-- default.
describeAggregateComplianceByConformancePacks_limit :: Lens.Lens' DescribeAggregateComplianceByConformancePacks (Prelude.Maybe Prelude.Natural)
describeAggregateComplianceByConformancePacks_limit :: Lens' DescribeAggregateComplianceByConformancePacks (Maybe Natural)
describeAggregateComplianceByConformancePacks_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAggregateComplianceByConformancePacks' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeAggregateComplianceByConformancePacks
s@DescribeAggregateComplianceByConformancePacks' {} Maybe Natural
a -> DescribeAggregateComplianceByConformancePacks
s {$sel:limit:DescribeAggregateComplianceByConformancePacks' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeAggregateComplianceByConformancePacks)

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

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

instance
  Core.AWSPager
    DescribeAggregateComplianceByConformancePacks
  where
  page :: DescribeAggregateComplianceByConformancePacks
-> AWSResponse DescribeAggregateComplianceByConformancePacks
-> Maybe DescribeAggregateComplianceByConformancePacks
page DescribeAggregateComplianceByConformancePacks
rq AWSResponse DescribeAggregateComplianceByConformancePacks
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAggregateComplianceByConformancePacks
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeAggregateComplianceByConformancePacksResponse (Maybe Text)
describeAggregateComplianceByConformancePacksResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAggregateComplianceByConformancePacks
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeAggregateComplianceByConformancePacksResponse
  (Maybe [AggregateComplianceByConformancePack])
describeAggregateComplianceByConformancePacksResponse_aggregateComplianceByConformancePacks
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeAggregateComplianceByConformancePacks
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeAggregateComplianceByConformancePacks (Maybe Text)
describeAggregateComplianceByConformancePacks_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeAggregateComplianceByConformancePacks
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeAggregateComplianceByConformancePacksResponse (Maybe Text)
describeAggregateComplianceByConformancePacksResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeAggregateComplianceByConformancePacks
  where
  type
    AWSResponse
      DescribeAggregateComplianceByConformancePacks =
      DescribeAggregateComplianceByConformancePacksResponse
  request :: (Service -> Service)
-> DescribeAggregateComplianceByConformancePacks
-> Request DescribeAggregateComplianceByConformancePacks
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 DescribeAggregateComplianceByConformancePacks
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeAggregateComplianceByConformancePacks)))
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 [AggregateComplianceByConformancePack]
-> Maybe Text
-> Int
-> DescribeAggregateComplianceByConformancePacksResponse
DescribeAggregateComplianceByConformancePacksResponse'
            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
"AggregateComplianceByConformancePacks"
                            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
"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
    DescribeAggregateComplianceByConformancePacks
  where
  hashWithSalt :: Int -> DescribeAggregateComplianceByConformancePacks -> Int
hashWithSalt
    Int
_salt
    DescribeAggregateComplianceByConformancePacks' {Maybe Natural
Maybe Text
Maybe AggregateConformancePackComplianceFilters
Text
configurationAggregatorName :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
filters :: Maybe AggregateConformancePackComplianceFilters
$sel:configurationAggregatorName:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Text
$sel:nextToken:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Maybe Text
$sel:limit:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Maybe Natural
$sel:filters:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks
-> Maybe AggregateConformancePackComplianceFilters
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AggregateConformancePackComplianceFilters
filters
        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
    DescribeAggregateComplianceByConformancePacks
  where
  rnf :: DescribeAggregateComplianceByConformancePacks -> ()
rnf
    DescribeAggregateComplianceByConformancePacks' {Maybe Natural
Maybe Text
Maybe AggregateConformancePackComplianceFilters
Text
configurationAggregatorName :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
filters :: Maybe AggregateConformancePackComplianceFilters
$sel:configurationAggregatorName:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Text
$sel:nextToken:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Maybe Text
$sel:limit:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Maybe Natural
$sel:filters:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks
-> Maybe AggregateConformancePackComplianceFilters
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe AggregateConformancePackComplianceFilters
filters
        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
    DescribeAggregateComplianceByConformancePacks
  where
  toHeaders :: DescribeAggregateComplianceByConformancePacks -> 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.DescribeAggregateComplianceByConformancePacks" ::
                          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
    DescribeAggregateComplianceByConformancePacks
  where
  toJSON :: DescribeAggregateComplianceByConformancePacks -> Value
toJSON
    DescribeAggregateComplianceByConformancePacks' {Maybe Natural
Maybe Text
Maybe AggregateConformancePackComplianceFilters
Text
configurationAggregatorName :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
filters :: Maybe AggregateConformancePackComplianceFilters
$sel:configurationAggregatorName:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Text
$sel:nextToken:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Maybe Text
$sel:limit:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks -> Maybe Natural
$sel:filters:DescribeAggregateComplianceByConformancePacks' :: DescribeAggregateComplianceByConformancePacks
-> Maybe AggregateConformancePackComplianceFilters
..} =
      [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 AggregateConformancePackComplianceFilters
filters,
              (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
    DescribeAggregateComplianceByConformancePacks
  where
  toPath :: DescribeAggregateComplianceByConformancePacks -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'DescribeAggregateComplianceByConformancePacksResponse' 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:
--
-- 'aggregateComplianceByConformancePacks', 'describeAggregateComplianceByConformancePacksResponse_aggregateComplianceByConformancePacks' - Returns the @AggregateComplianceByConformancePack@ object.
--
-- 'nextToken', 'describeAggregateComplianceByConformancePacksResponse_nextToken' - The @nextToken@ string returned on a previous page that you use to get
-- the next page of results in a paginated response.
--
-- 'httpStatus', 'describeAggregateComplianceByConformancePacksResponse_httpStatus' - The response's http status code.
newDescribeAggregateComplianceByConformancePacksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAggregateComplianceByConformancePacksResponse
newDescribeAggregateComplianceByConformancePacksResponse :: Int -> DescribeAggregateComplianceByConformancePacksResponse
newDescribeAggregateComplianceByConformancePacksResponse
  Int
pHttpStatus_ =
    DescribeAggregateComplianceByConformancePacksResponse'
      { $sel:aggregateComplianceByConformancePacks:DescribeAggregateComplianceByConformancePacksResponse' :: Maybe [AggregateComplianceByConformancePack]
aggregateComplianceByConformancePacks =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeAggregateComplianceByConformancePacksResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeAggregateComplianceByConformancePacksResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Returns the @AggregateComplianceByConformancePack@ object.
describeAggregateComplianceByConformancePacksResponse_aggregateComplianceByConformancePacks :: Lens.Lens' DescribeAggregateComplianceByConformancePacksResponse (Prelude.Maybe [AggregateComplianceByConformancePack])
describeAggregateComplianceByConformancePacksResponse_aggregateComplianceByConformancePacks :: Lens'
  DescribeAggregateComplianceByConformancePacksResponse
  (Maybe [AggregateComplianceByConformancePack])
describeAggregateComplianceByConformancePacksResponse_aggregateComplianceByConformancePacks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAggregateComplianceByConformancePacksResponse' {Maybe [AggregateComplianceByConformancePack]
aggregateComplianceByConformancePacks :: Maybe [AggregateComplianceByConformancePack]
$sel:aggregateComplianceByConformancePacks:DescribeAggregateComplianceByConformancePacksResponse' :: DescribeAggregateComplianceByConformancePacksResponse
-> Maybe [AggregateComplianceByConformancePack]
aggregateComplianceByConformancePacks} -> Maybe [AggregateComplianceByConformancePack]
aggregateComplianceByConformancePacks) (\s :: DescribeAggregateComplianceByConformancePacksResponse
s@DescribeAggregateComplianceByConformancePacksResponse' {} Maybe [AggregateComplianceByConformancePack]
a -> DescribeAggregateComplianceByConformancePacksResponse
s {$sel:aggregateComplianceByConformancePacks:DescribeAggregateComplianceByConformancePacksResponse' :: Maybe [AggregateComplianceByConformancePack]
aggregateComplianceByConformancePacks = Maybe [AggregateComplianceByConformancePack]
a} :: DescribeAggregateComplianceByConformancePacksResponse) 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

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

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

instance
  Prelude.NFData
    DescribeAggregateComplianceByConformancePacksResponse
  where
  rnf :: DescribeAggregateComplianceByConformancePacksResponse -> ()
rnf
    DescribeAggregateComplianceByConformancePacksResponse' {Int
Maybe [AggregateComplianceByConformancePack]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
aggregateComplianceByConformancePacks :: Maybe [AggregateComplianceByConformancePack]
$sel:httpStatus:DescribeAggregateComplianceByConformancePacksResponse' :: DescribeAggregateComplianceByConformancePacksResponse -> Int
$sel:nextToken:DescribeAggregateComplianceByConformancePacksResponse' :: DescribeAggregateComplianceByConformancePacksResponse -> Maybe Text
$sel:aggregateComplianceByConformancePacks:DescribeAggregateComplianceByConformancePacksResponse' :: DescribeAggregateComplianceByConformancePacksResponse
-> Maybe [AggregateComplianceByConformancePack]
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe [AggregateComplianceByConformancePack]
aggregateComplianceByConformancePacks
        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