{-# 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-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)
--
-- 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_nextToken,
    describeAggregateComplianceByConformancePacks_limit,
    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.Lens as Lens
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 @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 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 name of the configuration aggregator.
    DescribeAggregateComplianceByConformancePacks -> Text
configurationAggregatorName :: Prelude.Text
  }
  deriving (DescribeAggregateComplianceByConformancePacks
-> DescribeAggregateComplianceByConformancePacks -> Bool
(DescribeAggregateComplianceByConformancePacks
 -> DescribeAggregateComplianceByConformancePacks -> Bool)
-> (DescribeAggregateComplianceByConformancePacks
    -> DescribeAggregateComplianceByConformancePacks -> Bool)
-> Eq DescribeAggregateComplianceByConformancePacks
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]
(Int -> ReadS DescribeAggregateComplianceByConformancePacks)
-> ReadS [DescribeAggregateComplianceByConformancePacks]
-> ReadPrec DescribeAggregateComplianceByConformancePacks
-> ReadPrec [DescribeAggregateComplianceByConformancePacks]
-> Read 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
(Int -> DescribeAggregateComplianceByConformancePacks -> ShowS)
-> (DescribeAggregateComplianceByConformancePacks -> String)
-> ([DescribeAggregateComplianceByConformancePacks] -> ShowS)
-> Show DescribeAggregateComplianceByConformancePacks
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.
 DescribeAggregateComplianceByConformancePacks
 -> Rep DescribeAggregateComplianceByConformancePacks x)
-> (forall x.
    Rep DescribeAggregateComplianceByConformancePacks x
    -> DescribeAggregateComplianceByConformancePacks)
-> Generic DescribeAggregateComplianceByConformancePacks
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.
--
-- '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.
--
-- '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.
--
-- 'configurationAggregatorName', 'describeAggregateComplianceByConformancePacks_configurationAggregatorName' - The name of the configuration aggregator.
newDescribeAggregateComplianceByConformancePacks ::
  -- | 'configurationAggregatorName'
  Prelude.Text ->
  DescribeAggregateComplianceByConformancePacks
newDescribeAggregateComplianceByConformancePacks :: Text -> DescribeAggregateComplianceByConformancePacks
newDescribeAggregateComplianceByConformancePacks
  Text
pConfigurationAggregatorName_ =
    DescribeAggregateComplianceByConformancePacks' :: Maybe AggregateConformancePackComplianceFilters
-> Maybe Text
-> Maybe Natural
-> Text
-> DescribeAggregateComplianceByConformancePacks
DescribeAggregateComplianceByConformancePacks'
      { $sel:filters:DescribeAggregateComplianceByConformancePacks' :: Maybe AggregateConformancePackComplianceFilters
filters =
          Maybe AggregateConformancePackComplianceFilters
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeAggregateComplianceByConformancePacks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:limit:DescribeAggregateComplianceByConformancePacks' :: Maybe Natural
limit = Maybe Natural
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 :: (Maybe AggregateConformancePackComplianceFilters
 -> f (Maybe AggregateConformancePackComplianceFilters))
-> DescribeAggregateComplianceByConformancePacks
-> f DescribeAggregateComplianceByConformancePacks
describeAggregateComplianceByConformancePacks_filters = (DescribeAggregateComplianceByConformancePacks
 -> Maybe AggregateConformancePackComplianceFilters)
-> (DescribeAggregateComplianceByConformancePacks
    -> Maybe AggregateConformancePackComplianceFilters
    -> DescribeAggregateComplianceByConformancePacks)
-> Lens
     DescribeAggregateComplianceByConformancePacks
     DescribeAggregateComplianceByConformancePacks
     (Maybe AggregateConformancePackComplianceFilters)
     (Maybe AggregateConformancePackComplianceFilters)
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 @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 :: (Maybe Text -> f (Maybe Text))
-> DescribeAggregateComplianceByConformancePacks
-> f DescribeAggregateComplianceByConformancePacks
describeAggregateComplianceByConformancePacks_nextToken = (DescribeAggregateComplianceByConformancePacks -> Maybe Text)
-> (DescribeAggregateComplianceByConformancePacks
    -> Maybe Text -> DescribeAggregateComplianceByConformancePacks)
-> Lens
     DescribeAggregateComplianceByConformancePacks
     DescribeAggregateComplianceByConformancePacks
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe Natural -> f (Maybe Natural))
-> DescribeAggregateComplianceByConformancePacks
-> f DescribeAggregateComplianceByConformancePacks
describeAggregateComplianceByConformancePacks_limit = (DescribeAggregateComplianceByConformancePacks -> Maybe Natural)
-> (DescribeAggregateComplianceByConformancePacks
    -> Maybe Natural -> DescribeAggregateComplianceByConformancePacks)
-> Lens
     DescribeAggregateComplianceByConformancePacks
     DescribeAggregateComplianceByConformancePacks
     (Maybe Natural)
     (Maybe Natural)
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 name of the configuration aggregator.
describeAggregateComplianceByConformancePacks_configurationAggregatorName :: Lens.Lens' DescribeAggregateComplianceByConformancePacks Prelude.Text
describeAggregateComplianceByConformancePacks_configurationAggregatorName :: (Text -> f Text)
-> DescribeAggregateComplianceByConformancePacks
-> f DescribeAggregateComplianceByConformancePacks
describeAggregateComplianceByConformancePacks_configurationAggregatorName = (DescribeAggregateComplianceByConformancePacks -> Text)
-> (DescribeAggregateComplianceByConformancePacks
    -> Text -> DescribeAggregateComplianceByConformancePacks)
-> Lens
     DescribeAggregateComplianceByConformancePacks
     DescribeAggregateComplianceByConformancePacks
     Text
     Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAggregateComplianceByConformancePacks
DescribeAggregateComplianceByConformancePacksResponse
rs
            DescribeAggregateComplianceByConformancePacksResponse
-> Getting
     (First Text)
     DescribeAggregateComplianceByConformancePacksResponse
     Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeAggregateComplianceByConformancePacksResponse
-> Const
     (First Text) DescribeAggregateComplianceByConformancePacksResponse
Lens'
  DescribeAggregateComplianceByConformancePacksResponse (Maybe Text)
describeAggregateComplianceByConformancePacksResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeAggregateComplianceByConformancePacksResponse
 -> Const
      (First Text) DescribeAggregateComplianceByConformancePacksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text)
     DescribeAggregateComplianceByConformancePacksResponse
     Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeAggregateComplianceByConformancePacks
forall a. Maybe a
Prelude.Nothing
    | Maybe [AggregateComplianceByConformancePack] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeAggregateComplianceByConformancePacks
DescribeAggregateComplianceByConformancePacksResponse
rs
            DescribeAggregateComplianceByConformancePacksResponse
-> Getting
     (First [AggregateComplianceByConformancePack])
     DescribeAggregateComplianceByConformancePacksResponse
     [AggregateComplianceByConformancePack]
-> Maybe [AggregateComplianceByConformancePack]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [AggregateComplianceByConformancePack]
 -> Const
      (First [AggregateComplianceByConformancePack])
      (Maybe [AggregateComplianceByConformancePack]))
-> DescribeAggregateComplianceByConformancePacksResponse
-> Const
     (First [AggregateComplianceByConformancePack])
     DescribeAggregateComplianceByConformancePacksResponse
Lens'
  DescribeAggregateComplianceByConformancePacksResponse
  (Maybe [AggregateComplianceByConformancePack])
describeAggregateComplianceByConformancePacksResponse_aggregateComplianceByConformancePacks
              ((Maybe [AggregateComplianceByConformancePack]
  -> Const
       (First [AggregateComplianceByConformancePack])
       (Maybe [AggregateComplianceByConformancePack]))
 -> DescribeAggregateComplianceByConformancePacksResponse
 -> Const
      (First [AggregateComplianceByConformancePack])
      DescribeAggregateComplianceByConformancePacksResponse)
-> (([AggregateComplianceByConformancePack]
     -> Const
          (First [AggregateComplianceByConformancePack])
          [AggregateComplianceByConformancePack])
    -> Maybe [AggregateComplianceByConformancePack]
    -> Const
         (First [AggregateComplianceByConformancePack])
         (Maybe [AggregateComplianceByConformancePack]))
-> Getting
     (First [AggregateComplianceByConformancePack])
     DescribeAggregateComplianceByConformancePacksResponse
     [AggregateComplianceByConformancePack]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AggregateComplianceByConformancePack]
 -> Const
      (First [AggregateComplianceByConformancePack])
      [AggregateComplianceByConformancePack])
-> Maybe [AggregateComplianceByConformancePack]
-> Const
     (First [AggregateComplianceByConformancePack])
     (Maybe [AggregateComplianceByConformancePack])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeAggregateComplianceByConformancePacks
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeAggregateComplianceByConformancePacks
-> Maybe DescribeAggregateComplianceByConformancePacks
forall a. a -> Maybe a
Prelude.Just (DescribeAggregateComplianceByConformancePacks
 -> Maybe DescribeAggregateComplianceByConformancePacks)
-> DescribeAggregateComplianceByConformancePacks
-> Maybe DescribeAggregateComplianceByConformancePacks
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeAggregateComplianceByConformancePacks
rq
          DescribeAggregateComplianceByConformancePacks
-> (DescribeAggregateComplianceByConformancePacks
    -> DescribeAggregateComplianceByConformancePacks)
-> DescribeAggregateComplianceByConformancePacks
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeAggregateComplianceByConformancePacks
-> Identity DescribeAggregateComplianceByConformancePacks
Lens
  DescribeAggregateComplianceByConformancePacks
  DescribeAggregateComplianceByConformancePacks
  (Maybe Text)
  (Maybe Text)
describeAggregateComplianceByConformancePacks_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeAggregateComplianceByConformancePacks
 -> Identity DescribeAggregateComplianceByConformancePacks)
-> Maybe Text
-> DescribeAggregateComplianceByConformancePacks
-> DescribeAggregateComplianceByConformancePacks
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeAggregateComplianceByConformancePacks
DescribeAggregateComplianceByConformancePacksResponse
rs
            DescribeAggregateComplianceByConformancePacksResponse
-> Getting
     (First Text)
     DescribeAggregateComplianceByConformancePacksResponse
     Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeAggregateComplianceByConformancePacksResponse
-> Const
     (First Text) DescribeAggregateComplianceByConformancePacksResponse
Lens'
  DescribeAggregateComplianceByConformancePacksResponse (Maybe Text)
describeAggregateComplianceByConformancePacksResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeAggregateComplianceByConformancePacksResponse
 -> Const
      (First Text) DescribeAggregateComplianceByConformancePacksResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text)
     DescribeAggregateComplianceByConformancePacksResponse
     Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeAggregateComplianceByConformancePacks
  where
  type
    AWSResponse
      DescribeAggregateComplianceByConformancePacks =
      DescribeAggregateComplianceByConformancePacksResponse
  request :: DescribeAggregateComplianceByConformancePacks
-> Request DescribeAggregateComplianceByConformancePacks
request = Service
-> DescribeAggregateComplianceByConformancePacks
-> Request DescribeAggregateComplianceByConformancePacks
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeAggregateComplianceByConformancePacks
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeAggregateComplianceByConformancePacks)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse DescribeAggregateComplianceByConformancePacks))
-> Logger
-> Service
-> Proxy DescribeAggregateComplianceByConformancePacks
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeAggregateComplianceByConformancePacks)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Maybe [AggregateComplianceByConformancePack]
 -> Maybe Text
 -> Int
 -> DescribeAggregateComplianceByConformancePacksResponse)
-> Either String (Maybe [AggregateComplianceByConformancePack])
-> Either
     String
     (Maybe Text
      -> Int -> DescribeAggregateComplianceByConformancePacksResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either
     String (Maybe (Maybe [AggregateComplianceByConformancePack]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AggregateComplianceByConformancePacks"
                            Either
  String (Maybe (Maybe [AggregateComplianceByConformancePack]))
-> Maybe [AggregateComplianceByConformancePack]
-> Either String (Maybe [AggregateComplianceByConformancePack])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AggregateComplianceByConformancePack]
forall a. Monoid a => a
Prelude.mempty
                        )
              Either
  String
  (Maybe Text
   -> Int -> DescribeAggregateComplianceByConformancePacksResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> DescribeAggregateComplianceByConformancePacksResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
              Either
  String
  (Int -> DescribeAggregateComplianceByConformancePacksResponse)
-> Either String Int
-> Either
     String DescribeAggregateComplianceByConformancePacksResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DescribeAggregateComplianceByConformancePacks

instance
  Prelude.NFData
    DescribeAggregateComplianceByConformancePacks

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

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

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

instance
  Core.ToQuery
    DescribeAggregateComplianceByConformancePacks
  where
  toQuery :: DescribeAggregateComplianceByConformancePacks -> QueryString
toQuery = QueryString
-> DescribeAggregateComplianceByConformancePacks -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DescribeAggregateComplianceByConformancePacksResponse
 -> DescribeAggregateComplianceByConformancePacksResponse -> Bool)
-> (DescribeAggregateComplianceByConformancePacksResponse
    -> DescribeAggregateComplianceByConformancePacksResponse -> Bool)
-> Eq DescribeAggregateComplianceByConformancePacksResponse
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]
(Int
 -> ReadS DescribeAggregateComplianceByConformancePacksResponse)
-> ReadS [DescribeAggregateComplianceByConformancePacksResponse]
-> ReadPrec DescribeAggregateComplianceByConformancePacksResponse
-> ReadPrec [DescribeAggregateComplianceByConformancePacksResponse]
-> Read 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
(Int
 -> DescribeAggregateComplianceByConformancePacksResponse -> ShowS)
-> (DescribeAggregateComplianceByConformancePacksResponse
    -> String)
-> ([DescribeAggregateComplianceByConformancePacksResponse]
    -> ShowS)
-> Show DescribeAggregateComplianceByConformancePacksResponse
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.
 DescribeAggregateComplianceByConformancePacksResponse
 -> Rep DescribeAggregateComplianceByConformancePacksResponse x)
-> (forall x.
    Rep DescribeAggregateComplianceByConformancePacksResponse x
    -> DescribeAggregateComplianceByConformancePacksResponse)
-> Generic DescribeAggregateComplianceByConformancePacksResponse
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' :: Maybe [AggregateComplianceByConformancePack]
-> Maybe Text
-> Int
-> DescribeAggregateComplianceByConformancePacksResponse
DescribeAggregateComplianceByConformancePacksResponse'
      { $sel:aggregateComplianceByConformancePacks:DescribeAggregateComplianceByConformancePacksResponse' :: Maybe [AggregateComplianceByConformancePack]
aggregateComplianceByConformancePacks =
          Maybe [AggregateComplianceByConformancePack]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeAggregateComplianceByConformancePacksResponse' :: Maybe Text
nextToken =
          Maybe Text
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 :: (Maybe [AggregateComplianceByConformancePack]
 -> f (Maybe [AggregateComplianceByConformancePack]))
-> DescribeAggregateComplianceByConformancePacksResponse
-> f DescribeAggregateComplianceByConformancePacksResponse
describeAggregateComplianceByConformancePacksResponse_aggregateComplianceByConformancePacks = (DescribeAggregateComplianceByConformancePacksResponse
 -> Maybe [AggregateComplianceByConformancePack])
-> (DescribeAggregateComplianceByConformancePacksResponse
    -> Maybe [AggregateComplianceByConformancePack]
    -> DescribeAggregateComplianceByConformancePacksResponse)
-> Lens'
     DescribeAggregateComplianceByConformancePacksResponse
     (Maybe [AggregateComplianceByConformancePack])
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) ((Maybe [AggregateComplianceByConformancePack]
  -> f (Maybe [AggregateComplianceByConformancePack]))
 -> DescribeAggregateComplianceByConformancePacksResponse
 -> f DescribeAggregateComplianceByConformancePacksResponse)
-> ((Maybe [AggregateComplianceByConformancePack]
     -> f (Maybe [AggregateComplianceByConformancePack]))
    -> Maybe [AggregateComplianceByConformancePack]
    -> f (Maybe [AggregateComplianceByConformancePack]))
-> (Maybe [AggregateComplianceByConformancePack]
    -> f (Maybe [AggregateComplianceByConformancePack]))
-> DescribeAggregateComplianceByConformancePacksResponse
-> f DescribeAggregateComplianceByConformancePacksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AggregateComplianceByConformancePack]
  [AggregateComplianceByConformancePack]
  [AggregateComplianceByConformancePack]
  [AggregateComplianceByConformancePack]
-> Iso
     (Maybe [AggregateComplianceByConformancePack])
     (Maybe [AggregateComplianceByConformancePack])
     (Maybe [AggregateComplianceByConformancePack])
     (Maybe [AggregateComplianceByConformancePack])
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 AnIso
  [AggregateComplianceByConformancePack]
  [AggregateComplianceByConformancePack]
  [AggregateComplianceByConformancePack]
  [AggregateComplianceByConformancePack]
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 :: (Maybe Text -> f (Maybe Text))
-> DescribeAggregateComplianceByConformancePacksResponse
-> f DescribeAggregateComplianceByConformancePacksResponse
describeAggregateComplianceByConformancePacksResponse_nextToken = (DescribeAggregateComplianceByConformancePacksResponse
 -> Maybe Text)
-> (DescribeAggregateComplianceByConformancePacksResponse
    -> Maybe Text
    -> DescribeAggregateComplianceByConformancePacksResponse)
-> Lens'
     DescribeAggregateComplianceByConformancePacksResponse (Maybe Text)
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 :: (Int -> f Int)
-> DescribeAggregateComplianceByConformancePacksResponse
-> f DescribeAggregateComplianceByConformancePacksResponse
describeAggregateComplianceByConformancePacksResponse_httpStatus = (DescribeAggregateComplianceByConformancePacksResponse -> Int)
-> (DescribeAggregateComplianceByConformancePacksResponse
    -> Int -> DescribeAggregateComplianceByConformancePacksResponse)
-> Lens
     DescribeAggregateComplianceByConformancePacksResponse
     DescribeAggregateComplianceByConformancePacksResponse
     Int
     Int
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