{-# 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.SSM.ListComplianceSummaries
-- 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 summary count of compliant and non-compliant resources for a
-- compliance type. For example, this call can return State Manager
-- associations, patches, or custom compliance types according to the
-- filter criteria that you specify.
--
-- This operation returns paginated results.
module Amazonka.SSM.ListComplianceSummaries
  ( -- * Creating a Request
    ListComplianceSummaries (..),
    newListComplianceSummaries,

    -- * Request Lenses
    listComplianceSummaries_filters,
    listComplianceSummaries_nextToken,
    listComplianceSummaries_maxResults,

    -- * Destructuring the Response
    ListComplianceSummariesResponse (..),
    newListComplianceSummariesResponse,

    -- * Response Lenses
    listComplianceSummariesResponse_nextToken,
    listComplianceSummariesResponse_complianceSummaryItems,
    listComplianceSummariesResponse_httpStatus,
  )
where

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
import Amazonka.SSM.Types

-- | /See:/ 'newListComplianceSummaries' smart constructor.
data ListComplianceSummaries = ListComplianceSummaries'
  { -- | One or more compliance or inventory filters. Use a filter to return a
    -- more specific list of results.
    ListComplianceSummaries -> Maybe [ComplianceStringFilter]
filters :: Prelude.Maybe [ComplianceStringFilter],
    -- | A token to start the list. Use this token to get the next set of
    -- results.
    ListComplianceSummaries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return for this call. Currently, you can
    -- specify null or 50. The call also returns a token that you can specify
    -- in a subsequent call to get the next set of results.
    ListComplianceSummaries -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListComplianceSummaries -> ListComplianceSummaries -> Bool
(ListComplianceSummaries -> ListComplianceSummaries -> Bool)
-> (ListComplianceSummaries -> ListComplianceSummaries -> Bool)
-> Eq ListComplianceSummaries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListComplianceSummaries -> ListComplianceSummaries -> Bool
$c/= :: ListComplianceSummaries -> ListComplianceSummaries -> Bool
== :: ListComplianceSummaries -> ListComplianceSummaries -> Bool
$c== :: ListComplianceSummaries -> ListComplianceSummaries -> Bool
Prelude.Eq, ReadPrec [ListComplianceSummaries]
ReadPrec ListComplianceSummaries
Int -> ReadS ListComplianceSummaries
ReadS [ListComplianceSummaries]
(Int -> ReadS ListComplianceSummaries)
-> ReadS [ListComplianceSummaries]
-> ReadPrec ListComplianceSummaries
-> ReadPrec [ListComplianceSummaries]
-> Read ListComplianceSummaries
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListComplianceSummaries]
$creadListPrec :: ReadPrec [ListComplianceSummaries]
readPrec :: ReadPrec ListComplianceSummaries
$creadPrec :: ReadPrec ListComplianceSummaries
readList :: ReadS [ListComplianceSummaries]
$creadList :: ReadS [ListComplianceSummaries]
readsPrec :: Int -> ReadS ListComplianceSummaries
$creadsPrec :: Int -> ReadS ListComplianceSummaries
Prelude.Read, Int -> ListComplianceSummaries -> ShowS
[ListComplianceSummaries] -> ShowS
ListComplianceSummaries -> String
(Int -> ListComplianceSummaries -> ShowS)
-> (ListComplianceSummaries -> String)
-> ([ListComplianceSummaries] -> ShowS)
-> Show ListComplianceSummaries
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListComplianceSummaries] -> ShowS
$cshowList :: [ListComplianceSummaries] -> ShowS
show :: ListComplianceSummaries -> String
$cshow :: ListComplianceSummaries -> String
showsPrec :: Int -> ListComplianceSummaries -> ShowS
$cshowsPrec :: Int -> ListComplianceSummaries -> ShowS
Prelude.Show, (forall x.
 ListComplianceSummaries -> Rep ListComplianceSummaries x)
-> (forall x.
    Rep ListComplianceSummaries x -> ListComplianceSummaries)
-> Generic ListComplianceSummaries
forall x. Rep ListComplianceSummaries x -> ListComplianceSummaries
forall x. ListComplianceSummaries -> Rep ListComplianceSummaries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListComplianceSummaries x -> ListComplianceSummaries
$cfrom :: forall x. ListComplianceSummaries -> Rep ListComplianceSummaries x
Prelude.Generic)

-- |
-- Create a value of 'ListComplianceSummaries' 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', 'listComplianceSummaries_filters' - One or more compliance or inventory filters. Use a filter to return a
-- more specific list of results.
--
-- 'nextToken', 'listComplianceSummaries_nextToken' - A token to start the list. Use this token to get the next set of
-- results.
--
-- 'maxResults', 'listComplianceSummaries_maxResults' - The maximum number of items to return for this call. Currently, you can
-- specify null or 50. The call also returns a token that you can specify
-- in a subsequent call to get the next set of results.
newListComplianceSummaries ::
  ListComplianceSummaries
newListComplianceSummaries :: ListComplianceSummaries
newListComplianceSummaries =
  ListComplianceSummaries' :: Maybe [ComplianceStringFilter]
-> Maybe Text -> Maybe Natural -> ListComplianceSummaries
ListComplianceSummaries'
    { $sel:filters:ListComplianceSummaries' :: Maybe [ComplianceStringFilter]
filters = Maybe [ComplianceStringFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListComplianceSummaries' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListComplianceSummaries' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | One or more compliance or inventory filters. Use a filter to return a
-- more specific list of results.
listComplianceSummaries_filters :: Lens.Lens' ListComplianceSummaries (Prelude.Maybe [ComplianceStringFilter])
listComplianceSummaries_filters :: (Maybe [ComplianceStringFilter]
 -> f (Maybe [ComplianceStringFilter]))
-> ListComplianceSummaries -> f ListComplianceSummaries
listComplianceSummaries_filters = (ListComplianceSummaries -> Maybe [ComplianceStringFilter])
-> (ListComplianceSummaries
    -> Maybe [ComplianceStringFilter] -> ListComplianceSummaries)
-> Lens
     ListComplianceSummaries
     ListComplianceSummaries
     (Maybe [ComplianceStringFilter])
     (Maybe [ComplianceStringFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComplianceSummaries' {Maybe [ComplianceStringFilter]
filters :: Maybe [ComplianceStringFilter]
$sel:filters:ListComplianceSummaries' :: ListComplianceSummaries -> Maybe [ComplianceStringFilter]
filters} -> Maybe [ComplianceStringFilter]
filters) (\s :: ListComplianceSummaries
s@ListComplianceSummaries' {} Maybe [ComplianceStringFilter]
a -> ListComplianceSummaries
s {$sel:filters:ListComplianceSummaries' :: Maybe [ComplianceStringFilter]
filters = Maybe [ComplianceStringFilter]
a} :: ListComplianceSummaries) ((Maybe [ComplianceStringFilter]
  -> f (Maybe [ComplianceStringFilter]))
 -> ListComplianceSummaries -> f ListComplianceSummaries)
-> ((Maybe [ComplianceStringFilter]
     -> f (Maybe [ComplianceStringFilter]))
    -> Maybe [ComplianceStringFilter]
    -> f (Maybe [ComplianceStringFilter]))
-> (Maybe [ComplianceStringFilter]
    -> f (Maybe [ComplianceStringFilter]))
-> ListComplianceSummaries
-> f ListComplianceSummaries
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ComplianceStringFilter]
  [ComplianceStringFilter]
  [ComplianceStringFilter]
  [ComplianceStringFilter]
-> Iso
     (Maybe [ComplianceStringFilter])
     (Maybe [ComplianceStringFilter])
     (Maybe [ComplianceStringFilter])
     (Maybe [ComplianceStringFilter])
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
  [ComplianceStringFilter]
  [ComplianceStringFilter]
  [ComplianceStringFilter]
  [ComplianceStringFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token to start the list. Use this token to get the next set of
-- results.
listComplianceSummaries_nextToken :: Lens.Lens' ListComplianceSummaries (Prelude.Maybe Prelude.Text)
listComplianceSummaries_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListComplianceSummaries -> f ListComplianceSummaries
listComplianceSummaries_nextToken = (ListComplianceSummaries -> Maybe Text)
-> (ListComplianceSummaries
    -> Maybe Text -> ListComplianceSummaries)
-> Lens
     ListComplianceSummaries
     ListComplianceSummaries
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComplianceSummaries' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListComplianceSummaries' :: ListComplianceSummaries -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListComplianceSummaries
s@ListComplianceSummaries' {} Maybe Text
a -> ListComplianceSummaries
s {$sel:nextToken:ListComplianceSummaries' :: Maybe Text
nextToken = Maybe Text
a} :: ListComplianceSummaries)

-- | The maximum number of items to return for this call. Currently, you can
-- specify null or 50. The call also returns a token that you can specify
-- in a subsequent call to get the next set of results.
listComplianceSummaries_maxResults :: Lens.Lens' ListComplianceSummaries (Prelude.Maybe Prelude.Natural)
listComplianceSummaries_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListComplianceSummaries -> f ListComplianceSummaries
listComplianceSummaries_maxResults = (ListComplianceSummaries -> Maybe Natural)
-> (ListComplianceSummaries
    -> Maybe Natural -> ListComplianceSummaries)
-> Lens
     ListComplianceSummaries
     ListComplianceSummaries
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComplianceSummaries' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListComplianceSummaries' :: ListComplianceSummaries -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListComplianceSummaries
s@ListComplianceSummaries' {} Maybe Natural
a -> ListComplianceSummaries
s {$sel:maxResults:ListComplianceSummaries' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListComplianceSummaries)

instance Core.AWSPager ListComplianceSummaries where
  page :: ListComplianceSummaries
-> AWSResponse ListComplianceSummaries
-> Maybe ListComplianceSummaries
page ListComplianceSummaries
rq AWSResponse ListComplianceSummaries
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListComplianceSummaries
ListComplianceSummariesResponse
rs
            ListComplianceSummariesResponse
-> Getting (First Text) ListComplianceSummariesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListComplianceSummariesResponse
-> Const (First Text) ListComplianceSummariesResponse
Lens' ListComplianceSummariesResponse (Maybe Text)
listComplianceSummariesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListComplianceSummariesResponse
 -> Const (First Text) ListComplianceSummariesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListComplianceSummariesResponse 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 ListComplianceSummaries
forall a. Maybe a
Prelude.Nothing
    | Maybe [ComplianceSummaryItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListComplianceSummaries
ListComplianceSummariesResponse
rs
            ListComplianceSummariesResponse
-> Getting
     (First [ComplianceSummaryItem])
     ListComplianceSummariesResponse
     [ComplianceSummaryItem]
-> Maybe [ComplianceSummaryItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ComplianceSummaryItem]
 -> Const
      (First [ComplianceSummaryItem]) (Maybe [ComplianceSummaryItem]))
-> ListComplianceSummariesResponse
-> Const
     (First [ComplianceSummaryItem]) ListComplianceSummariesResponse
Lens'
  ListComplianceSummariesResponse (Maybe [ComplianceSummaryItem])
listComplianceSummariesResponse_complianceSummaryItems
              ((Maybe [ComplianceSummaryItem]
  -> Const
       (First [ComplianceSummaryItem]) (Maybe [ComplianceSummaryItem]))
 -> ListComplianceSummariesResponse
 -> Const
      (First [ComplianceSummaryItem]) ListComplianceSummariesResponse)
-> (([ComplianceSummaryItem]
     -> Const (First [ComplianceSummaryItem]) [ComplianceSummaryItem])
    -> Maybe [ComplianceSummaryItem]
    -> Const
         (First [ComplianceSummaryItem]) (Maybe [ComplianceSummaryItem]))
-> Getting
     (First [ComplianceSummaryItem])
     ListComplianceSummariesResponse
     [ComplianceSummaryItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ComplianceSummaryItem]
 -> Const (First [ComplianceSummaryItem]) [ComplianceSummaryItem])
-> Maybe [ComplianceSummaryItem]
-> Const
     (First [ComplianceSummaryItem]) (Maybe [ComplianceSummaryItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListComplianceSummaries
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListComplianceSummaries -> Maybe ListComplianceSummaries
forall a. a -> Maybe a
Prelude.Just (ListComplianceSummaries -> Maybe ListComplianceSummaries)
-> ListComplianceSummaries -> Maybe ListComplianceSummaries
forall a b. (a -> b) -> a -> b
Prelude.$
        ListComplianceSummaries
rq
          ListComplianceSummaries
-> (ListComplianceSummaries -> ListComplianceSummaries)
-> ListComplianceSummaries
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListComplianceSummaries -> Identity ListComplianceSummaries
Lens
  ListComplianceSummaries
  ListComplianceSummaries
  (Maybe Text)
  (Maybe Text)
listComplianceSummaries_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListComplianceSummaries -> Identity ListComplianceSummaries)
-> Maybe Text -> ListComplianceSummaries -> ListComplianceSummaries
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListComplianceSummaries
ListComplianceSummariesResponse
rs
          ListComplianceSummariesResponse
-> Getting (First Text) ListComplianceSummariesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListComplianceSummariesResponse
-> Const (First Text) ListComplianceSummariesResponse
Lens' ListComplianceSummariesResponse (Maybe Text)
listComplianceSummariesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListComplianceSummariesResponse
 -> Const (First Text) ListComplianceSummariesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListComplianceSummariesResponse 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 ListComplianceSummaries where
  type
    AWSResponse ListComplianceSummaries =
      ListComplianceSummariesResponse
  request :: ListComplianceSummaries -> Request ListComplianceSummaries
request = Service
-> ListComplianceSummaries -> Request ListComplianceSummaries
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListComplianceSummaries
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListComplianceSummaries)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListComplianceSummaries))
-> Logger
-> Service
-> Proxy ListComplianceSummaries
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListComplianceSummaries)))
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 Text
-> Maybe [ComplianceSummaryItem]
-> Int
-> ListComplianceSummariesResponse
ListComplianceSummariesResponse'
            (Maybe Text
 -> Maybe [ComplianceSummaryItem]
 -> Int
 -> ListComplianceSummariesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ComplianceSummaryItem]
      -> Int -> ListComplianceSummariesResponse)
forall (f :: * -> *) a b. Functor 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
  (Maybe [ComplianceSummaryItem]
   -> Int -> ListComplianceSummariesResponse)
-> Either String (Maybe [ComplianceSummaryItem])
-> Either String (Int -> ListComplianceSummariesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ComplianceSummaryItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ComplianceSummaryItems"
                            Either String (Maybe (Maybe [ComplianceSummaryItem]))
-> Maybe [ComplianceSummaryItem]
-> Either String (Maybe [ComplianceSummaryItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ComplianceSummaryItem]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListComplianceSummariesResponse)
-> Either String Int
-> Either String ListComplianceSummariesResponse
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 ListComplianceSummaries

instance Prelude.NFData ListComplianceSummaries

instance Core.ToHeaders ListComplianceSummaries where
  toHeaders :: ListComplianceSummaries -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListComplianceSummaries -> 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
"AmazonSSM.ListComplianceSummaries" ::
                          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 ListComplianceSummaries where
  toJSON :: ListComplianceSummaries -> Value
toJSON ListComplianceSummaries' {Maybe Natural
Maybe [ComplianceStringFilter]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe [ComplianceStringFilter]
$sel:maxResults:ListComplianceSummaries' :: ListComplianceSummaries -> Maybe Natural
$sel:nextToken:ListComplianceSummaries' :: ListComplianceSummaries -> Maybe Text
$sel:filters:ListComplianceSummaries' :: ListComplianceSummaries -> Maybe [ComplianceStringFilter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> [ComplianceStringFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ComplianceStringFilter] -> Pair)
-> Maybe [ComplianceStringFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ComplianceStringFilter]
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
"MaxResults" 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
maxResults
          ]
      )

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

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

-- | /See:/ 'newListComplianceSummariesResponse' smart constructor.
data ListComplianceSummariesResponse = ListComplianceSummariesResponse'
  { -- | The token for the next set of items to return. Use this token to get the
    -- next set of results.
    ListComplianceSummariesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of compliant and non-compliant summary counts based on compliance
    -- types. For example, this call returns State Manager associations,
    -- patches, or custom compliance types according to the filter criteria
    -- that you specified.
    ListComplianceSummariesResponse -> Maybe [ComplianceSummaryItem]
complianceSummaryItems :: Prelude.Maybe [ComplianceSummaryItem],
    -- | The response's http status code.
    ListComplianceSummariesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListComplianceSummariesResponse
-> ListComplianceSummariesResponse -> Bool
(ListComplianceSummariesResponse
 -> ListComplianceSummariesResponse -> Bool)
-> (ListComplianceSummariesResponse
    -> ListComplianceSummariesResponse -> Bool)
-> Eq ListComplianceSummariesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListComplianceSummariesResponse
-> ListComplianceSummariesResponse -> Bool
$c/= :: ListComplianceSummariesResponse
-> ListComplianceSummariesResponse -> Bool
== :: ListComplianceSummariesResponse
-> ListComplianceSummariesResponse -> Bool
$c== :: ListComplianceSummariesResponse
-> ListComplianceSummariesResponse -> Bool
Prelude.Eq, ReadPrec [ListComplianceSummariesResponse]
ReadPrec ListComplianceSummariesResponse
Int -> ReadS ListComplianceSummariesResponse
ReadS [ListComplianceSummariesResponse]
(Int -> ReadS ListComplianceSummariesResponse)
-> ReadS [ListComplianceSummariesResponse]
-> ReadPrec ListComplianceSummariesResponse
-> ReadPrec [ListComplianceSummariesResponse]
-> Read ListComplianceSummariesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListComplianceSummariesResponse]
$creadListPrec :: ReadPrec [ListComplianceSummariesResponse]
readPrec :: ReadPrec ListComplianceSummariesResponse
$creadPrec :: ReadPrec ListComplianceSummariesResponse
readList :: ReadS [ListComplianceSummariesResponse]
$creadList :: ReadS [ListComplianceSummariesResponse]
readsPrec :: Int -> ReadS ListComplianceSummariesResponse
$creadsPrec :: Int -> ReadS ListComplianceSummariesResponse
Prelude.Read, Int -> ListComplianceSummariesResponse -> ShowS
[ListComplianceSummariesResponse] -> ShowS
ListComplianceSummariesResponse -> String
(Int -> ListComplianceSummariesResponse -> ShowS)
-> (ListComplianceSummariesResponse -> String)
-> ([ListComplianceSummariesResponse] -> ShowS)
-> Show ListComplianceSummariesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListComplianceSummariesResponse] -> ShowS
$cshowList :: [ListComplianceSummariesResponse] -> ShowS
show :: ListComplianceSummariesResponse -> String
$cshow :: ListComplianceSummariesResponse -> String
showsPrec :: Int -> ListComplianceSummariesResponse -> ShowS
$cshowsPrec :: Int -> ListComplianceSummariesResponse -> ShowS
Prelude.Show, (forall x.
 ListComplianceSummariesResponse
 -> Rep ListComplianceSummariesResponse x)
-> (forall x.
    Rep ListComplianceSummariesResponse x
    -> ListComplianceSummariesResponse)
-> Generic ListComplianceSummariesResponse
forall x.
Rep ListComplianceSummariesResponse x
-> ListComplianceSummariesResponse
forall x.
ListComplianceSummariesResponse
-> Rep ListComplianceSummariesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListComplianceSummariesResponse x
-> ListComplianceSummariesResponse
$cfrom :: forall x.
ListComplianceSummariesResponse
-> Rep ListComplianceSummariesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListComplianceSummariesResponse' 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:
--
-- 'nextToken', 'listComplianceSummariesResponse_nextToken' - The token for the next set of items to return. Use this token to get the
-- next set of results.
--
-- 'complianceSummaryItems', 'listComplianceSummariesResponse_complianceSummaryItems' - A list of compliant and non-compliant summary counts based on compliance
-- types. For example, this call returns State Manager associations,
-- patches, or custom compliance types according to the filter criteria
-- that you specified.
--
-- 'httpStatus', 'listComplianceSummariesResponse_httpStatus' - The response's http status code.
newListComplianceSummariesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListComplianceSummariesResponse
newListComplianceSummariesResponse :: Int -> ListComplianceSummariesResponse
newListComplianceSummariesResponse Int
pHttpStatus_ =
  ListComplianceSummariesResponse' :: Maybe Text
-> Maybe [ComplianceSummaryItem]
-> Int
-> ListComplianceSummariesResponse
ListComplianceSummariesResponse'
    { $sel:nextToken:ListComplianceSummariesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:complianceSummaryItems:ListComplianceSummariesResponse' :: Maybe [ComplianceSummaryItem]
complianceSummaryItems = Maybe [ComplianceSummaryItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListComplianceSummariesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of items to return. Use this token to get the
-- next set of results.
listComplianceSummariesResponse_nextToken :: Lens.Lens' ListComplianceSummariesResponse (Prelude.Maybe Prelude.Text)
listComplianceSummariesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListComplianceSummariesResponse
-> f ListComplianceSummariesResponse
listComplianceSummariesResponse_nextToken = (ListComplianceSummariesResponse -> Maybe Text)
-> (ListComplianceSummariesResponse
    -> Maybe Text -> ListComplianceSummariesResponse)
-> Lens' ListComplianceSummariesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComplianceSummariesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListComplianceSummariesResponse' :: ListComplianceSummariesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListComplianceSummariesResponse
s@ListComplianceSummariesResponse' {} Maybe Text
a -> ListComplianceSummariesResponse
s {$sel:nextToken:ListComplianceSummariesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListComplianceSummariesResponse)

-- | A list of compliant and non-compliant summary counts based on compliance
-- types. For example, this call returns State Manager associations,
-- patches, or custom compliance types according to the filter criteria
-- that you specified.
listComplianceSummariesResponse_complianceSummaryItems :: Lens.Lens' ListComplianceSummariesResponse (Prelude.Maybe [ComplianceSummaryItem])
listComplianceSummariesResponse_complianceSummaryItems :: (Maybe [ComplianceSummaryItem]
 -> f (Maybe [ComplianceSummaryItem]))
-> ListComplianceSummariesResponse
-> f ListComplianceSummariesResponse
listComplianceSummariesResponse_complianceSummaryItems = (ListComplianceSummariesResponse -> Maybe [ComplianceSummaryItem])
-> (ListComplianceSummariesResponse
    -> Maybe [ComplianceSummaryItem]
    -> ListComplianceSummariesResponse)
-> Lens'
     ListComplianceSummariesResponse (Maybe [ComplianceSummaryItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComplianceSummariesResponse' {Maybe [ComplianceSummaryItem]
complianceSummaryItems :: Maybe [ComplianceSummaryItem]
$sel:complianceSummaryItems:ListComplianceSummariesResponse' :: ListComplianceSummariesResponse -> Maybe [ComplianceSummaryItem]
complianceSummaryItems} -> Maybe [ComplianceSummaryItem]
complianceSummaryItems) (\s :: ListComplianceSummariesResponse
s@ListComplianceSummariesResponse' {} Maybe [ComplianceSummaryItem]
a -> ListComplianceSummariesResponse
s {$sel:complianceSummaryItems:ListComplianceSummariesResponse' :: Maybe [ComplianceSummaryItem]
complianceSummaryItems = Maybe [ComplianceSummaryItem]
a} :: ListComplianceSummariesResponse) ((Maybe [ComplianceSummaryItem]
  -> f (Maybe [ComplianceSummaryItem]))
 -> ListComplianceSummariesResponse
 -> f ListComplianceSummariesResponse)
-> ((Maybe [ComplianceSummaryItem]
     -> f (Maybe [ComplianceSummaryItem]))
    -> Maybe [ComplianceSummaryItem]
    -> f (Maybe [ComplianceSummaryItem]))
-> (Maybe [ComplianceSummaryItem]
    -> f (Maybe [ComplianceSummaryItem]))
-> ListComplianceSummariesResponse
-> f ListComplianceSummariesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ComplianceSummaryItem]
  [ComplianceSummaryItem]
  [ComplianceSummaryItem]
  [ComplianceSummaryItem]
-> Iso
     (Maybe [ComplianceSummaryItem])
     (Maybe [ComplianceSummaryItem])
     (Maybe [ComplianceSummaryItem])
     (Maybe [ComplianceSummaryItem])
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
  [ComplianceSummaryItem]
  [ComplianceSummaryItem]
  [ComplianceSummaryItem]
  [ComplianceSummaryItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListComplianceSummariesResponse