{-# 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.IoT.ListAuditSuppressions
-- 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)
--
-- Lists your Device Defender audit listings.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions ListAuditSuppressions>
-- action.
--
-- This operation returns paginated results.
module Amazonka.IoT.ListAuditSuppressions
  ( -- * Creating a Request
    ListAuditSuppressions (..),
    newListAuditSuppressions,

    -- * Request Lenses
    listAuditSuppressions_checkName,
    listAuditSuppressions_nextToken,
    listAuditSuppressions_ascendingOrder,
    listAuditSuppressions_maxResults,
    listAuditSuppressions_resourceIdentifier,

    -- * Destructuring the Response
    ListAuditSuppressionsResponse (..),
    newListAuditSuppressionsResponse,

    -- * Response Lenses
    listAuditSuppressionsResponse_nextToken,
    listAuditSuppressionsResponse_suppressions,
    listAuditSuppressionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
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:/ 'newListAuditSuppressions' smart constructor.
data ListAuditSuppressions = ListAuditSuppressions'
  { ListAuditSuppressions -> Maybe Text
checkName :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results.
    ListAuditSuppressions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Determines whether suppressions are listed in ascending order by
    -- expiration date or not. If parameter isn\'t provided,
    -- @ascendingOrder=true@.
    ListAuditSuppressions -> Maybe Bool
ascendingOrder :: Prelude.Maybe Prelude.Bool,
    -- | The maximum number of results to return at one time. The default is 25.
    ListAuditSuppressions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    ListAuditSuppressions -> Maybe ResourceIdentifier
resourceIdentifier :: Prelude.Maybe ResourceIdentifier
  }
  deriving (ListAuditSuppressions -> ListAuditSuppressions -> Bool
(ListAuditSuppressions -> ListAuditSuppressions -> Bool)
-> (ListAuditSuppressions -> ListAuditSuppressions -> Bool)
-> Eq ListAuditSuppressions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAuditSuppressions -> ListAuditSuppressions -> Bool
$c/= :: ListAuditSuppressions -> ListAuditSuppressions -> Bool
== :: ListAuditSuppressions -> ListAuditSuppressions -> Bool
$c== :: ListAuditSuppressions -> ListAuditSuppressions -> Bool
Prelude.Eq, ReadPrec [ListAuditSuppressions]
ReadPrec ListAuditSuppressions
Int -> ReadS ListAuditSuppressions
ReadS [ListAuditSuppressions]
(Int -> ReadS ListAuditSuppressions)
-> ReadS [ListAuditSuppressions]
-> ReadPrec ListAuditSuppressions
-> ReadPrec [ListAuditSuppressions]
-> Read ListAuditSuppressions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAuditSuppressions]
$creadListPrec :: ReadPrec [ListAuditSuppressions]
readPrec :: ReadPrec ListAuditSuppressions
$creadPrec :: ReadPrec ListAuditSuppressions
readList :: ReadS [ListAuditSuppressions]
$creadList :: ReadS [ListAuditSuppressions]
readsPrec :: Int -> ReadS ListAuditSuppressions
$creadsPrec :: Int -> ReadS ListAuditSuppressions
Prelude.Read, Int -> ListAuditSuppressions -> ShowS
[ListAuditSuppressions] -> ShowS
ListAuditSuppressions -> String
(Int -> ListAuditSuppressions -> ShowS)
-> (ListAuditSuppressions -> String)
-> ([ListAuditSuppressions] -> ShowS)
-> Show ListAuditSuppressions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAuditSuppressions] -> ShowS
$cshowList :: [ListAuditSuppressions] -> ShowS
show :: ListAuditSuppressions -> String
$cshow :: ListAuditSuppressions -> String
showsPrec :: Int -> ListAuditSuppressions -> ShowS
$cshowsPrec :: Int -> ListAuditSuppressions -> ShowS
Prelude.Show, (forall x. ListAuditSuppressions -> Rep ListAuditSuppressions x)
-> (forall x. Rep ListAuditSuppressions x -> ListAuditSuppressions)
-> Generic ListAuditSuppressions
forall x. Rep ListAuditSuppressions x -> ListAuditSuppressions
forall x. ListAuditSuppressions -> Rep ListAuditSuppressions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAuditSuppressions x -> ListAuditSuppressions
$cfrom :: forall x. ListAuditSuppressions -> Rep ListAuditSuppressions x
Prelude.Generic)

-- |
-- Create a value of 'ListAuditSuppressions' 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:
--
-- 'checkName', 'listAuditSuppressions_checkName' - Undocumented member.
--
-- 'nextToken', 'listAuditSuppressions_nextToken' - The token for the next set of results.
--
-- 'ascendingOrder', 'listAuditSuppressions_ascendingOrder' - Determines whether suppressions are listed in ascending order by
-- expiration date or not. If parameter isn\'t provided,
-- @ascendingOrder=true@.
--
-- 'maxResults', 'listAuditSuppressions_maxResults' - The maximum number of results to return at one time. The default is 25.
--
-- 'resourceIdentifier', 'listAuditSuppressions_resourceIdentifier' - Undocumented member.
newListAuditSuppressions ::
  ListAuditSuppressions
newListAuditSuppressions :: ListAuditSuppressions
newListAuditSuppressions =
  ListAuditSuppressions' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Natural
-> Maybe ResourceIdentifier
-> ListAuditSuppressions
ListAuditSuppressions'
    { $sel:checkName:ListAuditSuppressions' :: Maybe Text
checkName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAuditSuppressions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ascendingOrder:ListAuditSuppressions' :: Maybe Bool
ascendingOrder = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAuditSuppressions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceIdentifier:ListAuditSuppressions' :: Maybe ResourceIdentifier
resourceIdentifier = Maybe ResourceIdentifier
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
listAuditSuppressions_checkName :: Lens.Lens' ListAuditSuppressions (Prelude.Maybe Prelude.Text)
listAuditSuppressions_checkName :: (Maybe Text -> f (Maybe Text))
-> ListAuditSuppressions -> f ListAuditSuppressions
listAuditSuppressions_checkName = (ListAuditSuppressions -> Maybe Text)
-> (ListAuditSuppressions -> Maybe Text -> ListAuditSuppressions)
-> Lens
     ListAuditSuppressions
     ListAuditSuppressions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuditSuppressions' {Maybe Text
checkName :: Maybe Text
$sel:checkName:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe Text
checkName} -> Maybe Text
checkName) (\s :: ListAuditSuppressions
s@ListAuditSuppressions' {} Maybe Text
a -> ListAuditSuppressions
s {$sel:checkName:ListAuditSuppressions' :: Maybe Text
checkName = Maybe Text
a} :: ListAuditSuppressions)

-- | The token for the next set of results.
listAuditSuppressions_nextToken :: Lens.Lens' ListAuditSuppressions (Prelude.Maybe Prelude.Text)
listAuditSuppressions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAuditSuppressions -> f ListAuditSuppressions
listAuditSuppressions_nextToken = (ListAuditSuppressions -> Maybe Text)
-> (ListAuditSuppressions -> Maybe Text -> ListAuditSuppressions)
-> Lens
     ListAuditSuppressions
     ListAuditSuppressions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuditSuppressions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAuditSuppressions
s@ListAuditSuppressions' {} Maybe Text
a -> ListAuditSuppressions
s {$sel:nextToken:ListAuditSuppressions' :: Maybe Text
nextToken = Maybe Text
a} :: ListAuditSuppressions)

-- | Determines whether suppressions are listed in ascending order by
-- expiration date or not. If parameter isn\'t provided,
-- @ascendingOrder=true@.
listAuditSuppressions_ascendingOrder :: Lens.Lens' ListAuditSuppressions (Prelude.Maybe Prelude.Bool)
listAuditSuppressions_ascendingOrder :: (Maybe Bool -> f (Maybe Bool))
-> ListAuditSuppressions -> f ListAuditSuppressions
listAuditSuppressions_ascendingOrder = (ListAuditSuppressions -> Maybe Bool)
-> (ListAuditSuppressions -> Maybe Bool -> ListAuditSuppressions)
-> Lens
     ListAuditSuppressions
     ListAuditSuppressions
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuditSuppressions' {Maybe Bool
ascendingOrder :: Maybe Bool
$sel:ascendingOrder:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe Bool
ascendingOrder} -> Maybe Bool
ascendingOrder) (\s :: ListAuditSuppressions
s@ListAuditSuppressions' {} Maybe Bool
a -> ListAuditSuppressions
s {$sel:ascendingOrder:ListAuditSuppressions' :: Maybe Bool
ascendingOrder = Maybe Bool
a} :: ListAuditSuppressions)

-- | The maximum number of results to return at one time. The default is 25.
listAuditSuppressions_maxResults :: Lens.Lens' ListAuditSuppressions (Prelude.Maybe Prelude.Natural)
listAuditSuppressions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAuditSuppressions -> f ListAuditSuppressions
listAuditSuppressions_maxResults = (ListAuditSuppressions -> Maybe Natural)
-> (ListAuditSuppressions
    -> Maybe Natural -> ListAuditSuppressions)
-> Lens
     ListAuditSuppressions
     ListAuditSuppressions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuditSuppressions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAuditSuppressions
s@ListAuditSuppressions' {} Maybe Natural
a -> ListAuditSuppressions
s {$sel:maxResults:ListAuditSuppressions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAuditSuppressions)

-- | Undocumented member.
listAuditSuppressions_resourceIdentifier :: Lens.Lens' ListAuditSuppressions (Prelude.Maybe ResourceIdentifier)
listAuditSuppressions_resourceIdentifier :: (Maybe ResourceIdentifier -> f (Maybe ResourceIdentifier))
-> ListAuditSuppressions -> f ListAuditSuppressions
listAuditSuppressions_resourceIdentifier = (ListAuditSuppressions -> Maybe ResourceIdentifier)
-> (ListAuditSuppressions
    -> Maybe ResourceIdentifier -> ListAuditSuppressions)
-> Lens
     ListAuditSuppressions
     ListAuditSuppressions
     (Maybe ResourceIdentifier)
     (Maybe ResourceIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuditSuppressions' {Maybe ResourceIdentifier
resourceIdentifier :: Maybe ResourceIdentifier
$sel:resourceIdentifier:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe ResourceIdentifier
resourceIdentifier} -> Maybe ResourceIdentifier
resourceIdentifier) (\s :: ListAuditSuppressions
s@ListAuditSuppressions' {} Maybe ResourceIdentifier
a -> ListAuditSuppressions
s {$sel:resourceIdentifier:ListAuditSuppressions' :: Maybe ResourceIdentifier
resourceIdentifier = Maybe ResourceIdentifier
a} :: ListAuditSuppressions)

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

instance Prelude.NFData ListAuditSuppressions

instance Core.ToHeaders ListAuditSuppressions where
  toHeaders :: ListAuditSuppressions -> ResponseHeaders
toHeaders = ResponseHeaders -> ListAuditSuppressions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON ListAuditSuppressions where
  toJSON :: ListAuditSuppressions -> Value
toJSON ListAuditSuppressions' {Maybe Bool
Maybe Natural
Maybe Text
Maybe ResourceIdentifier
resourceIdentifier :: Maybe ResourceIdentifier
maxResults :: Maybe Natural
ascendingOrder :: Maybe Bool
nextToken :: Maybe Text
checkName :: Maybe Text
$sel:resourceIdentifier:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe ResourceIdentifier
$sel:maxResults:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe Natural
$sel:ascendingOrder:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe Bool
$sel:nextToken:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe Text
$sel:checkName:ListAuditSuppressions' :: ListAuditSuppressions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"checkName" 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
checkName,
            (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
"ascendingOrder" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
ascendingOrder,
            (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,
            (Text
"resourceIdentifier" Text -> ResourceIdentifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ResourceIdentifier -> Pair)
-> Maybe ResourceIdentifier -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceIdentifier
resourceIdentifier
          ]
      )

instance Core.ToPath ListAuditSuppressions where
  toPath :: ListAuditSuppressions -> ByteString
toPath = ByteString -> ListAuditSuppressions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/audit/suppressions/list"

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

-- | /See:/ 'newListAuditSuppressionsResponse' smart constructor.
data ListAuditSuppressionsResponse = ListAuditSuppressionsResponse'
  { -- | A token that can be used to retrieve the next set of results, or @null@
    -- if there are no additional results.
    ListAuditSuppressionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | List of audit suppressions.
    ListAuditSuppressionsResponse -> Maybe [AuditSuppression]
suppressions :: Prelude.Maybe [AuditSuppression],
    -- | The response's http status code.
    ListAuditSuppressionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAuditSuppressionsResponse
-> ListAuditSuppressionsResponse -> Bool
(ListAuditSuppressionsResponse
 -> ListAuditSuppressionsResponse -> Bool)
-> (ListAuditSuppressionsResponse
    -> ListAuditSuppressionsResponse -> Bool)
-> Eq ListAuditSuppressionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAuditSuppressionsResponse
-> ListAuditSuppressionsResponse -> Bool
$c/= :: ListAuditSuppressionsResponse
-> ListAuditSuppressionsResponse -> Bool
== :: ListAuditSuppressionsResponse
-> ListAuditSuppressionsResponse -> Bool
$c== :: ListAuditSuppressionsResponse
-> ListAuditSuppressionsResponse -> Bool
Prelude.Eq, ReadPrec [ListAuditSuppressionsResponse]
ReadPrec ListAuditSuppressionsResponse
Int -> ReadS ListAuditSuppressionsResponse
ReadS [ListAuditSuppressionsResponse]
(Int -> ReadS ListAuditSuppressionsResponse)
-> ReadS [ListAuditSuppressionsResponse]
-> ReadPrec ListAuditSuppressionsResponse
-> ReadPrec [ListAuditSuppressionsResponse]
-> Read ListAuditSuppressionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAuditSuppressionsResponse]
$creadListPrec :: ReadPrec [ListAuditSuppressionsResponse]
readPrec :: ReadPrec ListAuditSuppressionsResponse
$creadPrec :: ReadPrec ListAuditSuppressionsResponse
readList :: ReadS [ListAuditSuppressionsResponse]
$creadList :: ReadS [ListAuditSuppressionsResponse]
readsPrec :: Int -> ReadS ListAuditSuppressionsResponse
$creadsPrec :: Int -> ReadS ListAuditSuppressionsResponse
Prelude.Read, Int -> ListAuditSuppressionsResponse -> ShowS
[ListAuditSuppressionsResponse] -> ShowS
ListAuditSuppressionsResponse -> String
(Int -> ListAuditSuppressionsResponse -> ShowS)
-> (ListAuditSuppressionsResponse -> String)
-> ([ListAuditSuppressionsResponse] -> ShowS)
-> Show ListAuditSuppressionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAuditSuppressionsResponse] -> ShowS
$cshowList :: [ListAuditSuppressionsResponse] -> ShowS
show :: ListAuditSuppressionsResponse -> String
$cshow :: ListAuditSuppressionsResponse -> String
showsPrec :: Int -> ListAuditSuppressionsResponse -> ShowS
$cshowsPrec :: Int -> ListAuditSuppressionsResponse -> ShowS
Prelude.Show, (forall x.
 ListAuditSuppressionsResponse
 -> Rep ListAuditSuppressionsResponse x)
-> (forall x.
    Rep ListAuditSuppressionsResponse x
    -> ListAuditSuppressionsResponse)
-> Generic ListAuditSuppressionsResponse
forall x.
Rep ListAuditSuppressionsResponse x
-> ListAuditSuppressionsResponse
forall x.
ListAuditSuppressionsResponse
-> Rep ListAuditSuppressionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAuditSuppressionsResponse x
-> ListAuditSuppressionsResponse
$cfrom :: forall x.
ListAuditSuppressionsResponse
-> Rep ListAuditSuppressionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAuditSuppressionsResponse' 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', 'listAuditSuppressionsResponse_nextToken' - A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
--
-- 'suppressions', 'listAuditSuppressionsResponse_suppressions' - List of audit suppressions.
--
-- 'httpStatus', 'listAuditSuppressionsResponse_httpStatus' - The response's http status code.
newListAuditSuppressionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAuditSuppressionsResponse
newListAuditSuppressionsResponse :: Int -> ListAuditSuppressionsResponse
newListAuditSuppressionsResponse Int
pHttpStatus_ =
  ListAuditSuppressionsResponse' :: Maybe Text
-> Maybe [AuditSuppression] -> Int -> ListAuditSuppressionsResponse
ListAuditSuppressionsResponse'
    { $sel:nextToken:ListAuditSuppressionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:suppressions:ListAuditSuppressionsResponse' :: Maybe [AuditSuppression]
suppressions = Maybe [AuditSuppression]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAuditSuppressionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token that can be used to retrieve the next set of results, or @null@
-- if there are no additional results.
listAuditSuppressionsResponse_nextToken :: Lens.Lens' ListAuditSuppressionsResponse (Prelude.Maybe Prelude.Text)
listAuditSuppressionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAuditSuppressionsResponse -> f ListAuditSuppressionsResponse
listAuditSuppressionsResponse_nextToken = (ListAuditSuppressionsResponse -> Maybe Text)
-> (ListAuditSuppressionsResponse
    -> Maybe Text -> ListAuditSuppressionsResponse)
-> Lens' ListAuditSuppressionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuditSuppressionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAuditSuppressionsResponse' :: ListAuditSuppressionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAuditSuppressionsResponse
s@ListAuditSuppressionsResponse' {} Maybe Text
a -> ListAuditSuppressionsResponse
s {$sel:nextToken:ListAuditSuppressionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAuditSuppressionsResponse)

-- | List of audit suppressions.
listAuditSuppressionsResponse_suppressions :: Lens.Lens' ListAuditSuppressionsResponse (Prelude.Maybe [AuditSuppression])
listAuditSuppressionsResponse_suppressions :: (Maybe [AuditSuppression] -> f (Maybe [AuditSuppression]))
-> ListAuditSuppressionsResponse -> f ListAuditSuppressionsResponse
listAuditSuppressionsResponse_suppressions = (ListAuditSuppressionsResponse -> Maybe [AuditSuppression])
-> (ListAuditSuppressionsResponse
    -> Maybe [AuditSuppression] -> ListAuditSuppressionsResponse)
-> Lens' ListAuditSuppressionsResponse (Maybe [AuditSuppression])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAuditSuppressionsResponse' {Maybe [AuditSuppression]
suppressions :: Maybe [AuditSuppression]
$sel:suppressions:ListAuditSuppressionsResponse' :: ListAuditSuppressionsResponse -> Maybe [AuditSuppression]
suppressions} -> Maybe [AuditSuppression]
suppressions) (\s :: ListAuditSuppressionsResponse
s@ListAuditSuppressionsResponse' {} Maybe [AuditSuppression]
a -> ListAuditSuppressionsResponse
s {$sel:suppressions:ListAuditSuppressionsResponse' :: Maybe [AuditSuppression]
suppressions = Maybe [AuditSuppression]
a} :: ListAuditSuppressionsResponse) ((Maybe [AuditSuppression] -> f (Maybe [AuditSuppression]))
 -> ListAuditSuppressionsResponse
 -> f ListAuditSuppressionsResponse)
-> ((Maybe [AuditSuppression] -> f (Maybe [AuditSuppression]))
    -> Maybe [AuditSuppression] -> f (Maybe [AuditSuppression]))
-> (Maybe [AuditSuppression] -> f (Maybe [AuditSuppression]))
-> ListAuditSuppressionsResponse
-> f ListAuditSuppressionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AuditSuppression]
  [AuditSuppression]
  [AuditSuppression]
  [AuditSuppression]
-> Iso
     (Maybe [AuditSuppression])
     (Maybe [AuditSuppression])
     (Maybe [AuditSuppression])
     (Maybe [AuditSuppression])
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
  [AuditSuppression]
  [AuditSuppression]
  [AuditSuppression]
  [AuditSuppression]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListAuditSuppressionsResponse