{-# 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.AccessAnalyzer.ListArchiveRules
-- 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)
--
-- Retrieves a list of archive rules created for the specified analyzer.
--
-- This operation returns paginated results.
module Amazonka.AccessAnalyzer.ListArchiveRules
  ( -- * Creating a Request
    ListArchiveRules (..),
    newListArchiveRules,

    -- * Request Lenses
    listArchiveRules_nextToken,
    listArchiveRules_maxResults,
    listArchiveRules_analyzerName,

    -- * Destructuring the Response
    ListArchiveRulesResponse (..),
    newListArchiveRulesResponse,

    -- * Response Lenses
    listArchiveRulesResponse_nextToken,
    listArchiveRulesResponse_httpStatus,
    listArchiveRulesResponse_archiveRules,
  )
where

import Amazonka.AccessAnalyzer.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

-- | Retrieves a list of archive rules created for the specified analyzer.
--
-- /See:/ 'newListArchiveRules' smart constructor.
data ListArchiveRules = ListArchiveRules'
  { -- | A token used for pagination of results returned.
    ListArchiveRules -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in the request.
    ListArchiveRules -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The name of the analyzer to retrieve rules from.
    ListArchiveRules -> Text
analyzerName :: Prelude.Text
  }
  deriving (ListArchiveRules -> ListArchiveRules -> Bool
(ListArchiveRules -> ListArchiveRules -> Bool)
-> (ListArchiveRules -> ListArchiveRules -> Bool)
-> Eq ListArchiveRules
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListArchiveRules -> ListArchiveRules -> Bool
$c/= :: ListArchiveRules -> ListArchiveRules -> Bool
== :: ListArchiveRules -> ListArchiveRules -> Bool
$c== :: ListArchiveRules -> ListArchiveRules -> Bool
Prelude.Eq, ReadPrec [ListArchiveRules]
ReadPrec ListArchiveRules
Int -> ReadS ListArchiveRules
ReadS [ListArchiveRules]
(Int -> ReadS ListArchiveRules)
-> ReadS [ListArchiveRules]
-> ReadPrec ListArchiveRules
-> ReadPrec [ListArchiveRules]
-> Read ListArchiveRules
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListArchiveRules]
$creadListPrec :: ReadPrec [ListArchiveRules]
readPrec :: ReadPrec ListArchiveRules
$creadPrec :: ReadPrec ListArchiveRules
readList :: ReadS [ListArchiveRules]
$creadList :: ReadS [ListArchiveRules]
readsPrec :: Int -> ReadS ListArchiveRules
$creadsPrec :: Int -> ReadS ListArchiveRules
Prelude.Read, Int -> ListArchiveRules -> ShowS
[ListArchiveRules] -> ShowS
ListArchiveRules -> String
(Int -> ListArchiveRules -> ShowS)
-> (ListArchiveRules -> String)
-> ([ListArchiveRules] -> ShowS)
-> Show ListArchiveRules
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListArchiveRules] -> ShowS
$cshowList :: [ListArchiveRules] -> ShowS
show :: ListArchiveRules -> String
$cshow :: ListArchiveRules -> String
showsPrec :: Int -> ListArchiveRules -> ShowS
$cshowsPrec :: Int -> ListArchiveRules -> ShowS
Prelude.Show, (forall x. ListArchiveRules -> Rep ListArchiveRules x)
-> (forall x. Rep ListArchiveRules x -> ListArchiveRules)
-> Generic ListArchiveRules
forall x. Rep ListArchiveRules x -> ListArchiveRules
forall x. ListArchiveRules -> Rep ListArchiveRules x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListArchiveRules x -> ListArchiveRules
$cfrom :: forall x. ListArchiveRules -> Rep ListArchiveRules x
Prelude.Generic)

-- |
-- Create a value of 'ListArchiveRules' 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', 'listArchiveRules_nextToken' - A token used for pagination of results returned.
--
-- 'maxResults', 'listArchiveRules_maxResults' - The maximum number of results to return in the request.
--
-- 'analyzerName', 'listArchiveRules_analyzerName' - The name of the analyzer to retrieve rules from.
newListArchiveRules ::
  -- | 'analyzerName'
  Prelude.Text ->
  ListArchiveRules
newListArchiveRules :: Text -> ListArchiveRules
newListArchiveRules Text
pAnalyzerName_ =
  ListArchiveRules' :: Maybe Text -> Maybe Int -> Text -> ListArchiveRules
ListArchiveRules'
    { $sel:nextToken:ListArchiveRules' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListArchiveRules' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:analyzerName:ListArchiveRules' :: Text
analyzerName = Text
pAnalyzerName_
    }

-- | A token used for pagination of results returned.
listArchiveRules_nextToken :: Lens.Lens' ListArchiveRules (Prelude.Maybe Prelude.Text)
listArchiveRules_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListArchiveRules -> f ListArchiveRules
listArchiveRules_nextToken = (ListArchiveRules -> Maybe Text)
-> (ListArchiveRules -> Maybe Text -> ListArchiveRules)
-> Lens ListArchiveRules ListArchiveRules (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArchiveRules' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListArchiveRules' :: ListArchiveRules -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListArchiveRules
s@ListArchiveRules' {} Maybe Text
a -> ListArchiveRules
s {$sel:nextToken:ListArchiveRules' :: Maybe Text
nextToken = Maybe Text
a} :: ListArchiveRules)

-- | The maximum number of results to return in the request.
listArchiveRules_maxResults :: Lens.Lens' ListArchiveRules (Prelude.Maybe Prelude.Int)
listArchiveRules_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListArchiveRules -> f ListArchiveRules
listArchiveRules_maxResults = (ListArchiveRules -> Maybe Int)
-> (ListArchiveRules -> Maybe Int -> ListArchiveRules)
-> Lens ListArchiveRules ListArchiveRules (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArchiveRules' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListArchiveRules' :: ListArchiveRules -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListArchiveRules
s@ListArchiveRules' {} Maybe Int
a -> ListArchiveRules
s {$sel:maxResults:ListArchiveRules' :: Maybe Int
maxResults = Maybe Int
a} :: ListArchiveRules)

-- | The name of the analyzer to retrieve rules from.
listArchiveRules_analyzerName :: Lens.Lens' ListArchiveRules Prelude.Text
listArchiveRules_analyzerName :: (Text -> f Text) -> ListArchiveRules -> f ListArchiveRules
listArchiveRules_analyzerName = (ListArchiveRules -> Text)
-> (ListArchiveRules -> Text -> ListArchiveRules)
-> Lens ListArchiveRules ListArchiveRules Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArchiveRules' {Text
analyzerName :: Text
$sel:analyzerName:ListArchiveRules' :: ListArchiveRules -> Text
analyzerName} -> Text
analyzerName) (\s :: ListArchiveRules
s@ListArchiveRules' {} Text
a -> ListArchiveRules
s {$sel:analyzerName:ListArchiveRules' :: Text
analyzerName = Text
a} :: ListArchiveRules)

instance Core.AWSPager ListArchiveRules where
  page :: ListArchiveRules
-> AWSResponse ListArchiveRules -> Maybe ListArchiveRules
page ListArchiveRules
rq AWSResponse ListArchiveRules
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListArchiveRules
ListArchiveRulesResponse
rs
            ListArchiveRulesResponse
-> Getting (First Text) ListArchiveRulesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListArchiveRulesResponse
-> Const (First Text) ListArchiveRulesResponse
Lens' ListArchiveRulesResponse (Maybe Text)
listArchiveRulesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListArchiveRulesResponse
 -> Const (First Text) ListArchiveRulesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListArchiveRulesResponse 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 ListArchiveRules
forall a. Maybe a
Prelude.Nothing
    | [ArchiveRuleSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListArchiveRules
ListArchiveRulesResponse
rs ListArchiveRulesResponse
-> Getting
     [ArchiveRuleSummary] ListArchiveRulesResponse [ArchiveRuleSummary]
-> [ArchiveRuleSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [ArchiveRuleSummary] ListArchiveRulesResponse [ArchiveRuleSummary]
Lens' ListArchiveRulesResponse [ArchiveRuleSummary]
listArchiveRulesResponse_archiveRules) =
      Maybe ListArchiveRules
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListArchiveRules -> Maybe ListArchiveRules
forall a. a -> Maybe a
Prelude.Just (ListArchiveRules -> Maybe ListArchiveRules)
-> ListArchiveRules -> Maybe ListArchiveRules
forall a b. (a -> b) -> a -> b
Prelude.$
        ListArchiveRules
rq
          ListArchiveRules
-> (ListArchiveRules -> ListArchiveRules) -> ListArchiveRules
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListArchiveRules -> Identity ListArchiveRules
Lens ListArchiveRules ListArchiveRules (Maybe Text) (Maybe Text)
listArchiveRules_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListArchiveRules -> Identity ListArchiveRules)
-> Maybe Text -> ListArchiveRules -> ListArchiveRules
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListArchiveRules
ListArchiveRulesResponse
rs
          ListArchiveRulesResponse
-> Getting (First Text) ListArchiveRulesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListArchiveRulesResponse
-> Const (First Text) ListArchiveRulesResponse
Lens' ListArchiveRulesResponse (Maybe Text)
listArchiveRulesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListArchiveRulesResponse
 -> Const (First Text) ListArchiveRulesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListArchiveRulesResponse 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 ListArchiveRules where
  type
    AWSResponse ListArchiveRules =
      ListArchiveRulesResponse
  request :: ListArchiveRules -> Request ListArchiveRules
request = Service -> ListArchiveRules -> Request ListArchiveRules
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListArchiveRules
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListArchiveRules)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListArchiveRules))
-> Logger
-> Service
-> Proxy ListArchiveRules
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListArchiveRules)))
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
-> Int -> [ArchiveRuleSummary] -> ListArchiveRulesResponse
ListArchiveRulesResponse'
            (Maybe Text
 -> Int -> [ArchiveRuleSummary] -> ListArchiveRulesResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [ArchiveRuleSummary] -> ListArchiveRulesResponse)
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 (Int -> [ArchiveRuleSummary] -> ListArchiveRulesResponse)
-> Either String Int
-> Either String ([ArchiveRuleSummary] -> ListArchiveRulesResponse)
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))
            Either String ([ArchiveRuleSummary] -> ListArchiveRulesResponse)
-> Either String [ArchiveRuleSummary]
-> Either String ListArchiveRulesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [ArchiveRuleSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"archiveRules" Either String (Maybe [ArchiveRuleSummary])
-> [ArchiveRuleSummary] -> Either String [ArchiveRuleSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [ArchiveRuleSummary]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListArchiveRules

instance Prelude.NFData ListArchiveRules

instance Core.ToHeaders ListArchiveRules where
  toHeaders :: ListArchiveRules -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListArchiveRules -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListArchiveRules where
  toPath :: ListArchiveRules -> ByteString
toPath ListArchiveRules' {Maybe Int
Maybe Text
Text
analyzerName :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:analyzerName:ListArchiveRules' :: ListArchiveRules -> Text
$sel:maxResults:ListArchiveRules' :: ListArchiveRules -> Maybe Int
$sel:nextToken:ListArchiveRules' :: ListArchiveRules -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/analyzer/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
analyzerName,
        ByteString
"/archive-rule"
      ]

instance Core.ToQuery ListArchiveRules where
  toQuery :: ListArchiveRules -> QueryString
toQuery ListArchiveRules' {Maybe Int
Maybe Text
Text
analyzerName :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:analyzerName:ListArchiveRules' :: ListArchiveRules -> Text
$sel:maxResults:ListArchiveRules' :: ListArchiveRules -> Maybe Int
$sel:nextToken:ListArchiveRules' :: ListArchiveRules -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxResults
      ]

-- | The response to the request.
--
-- /See:/ 'newListArchiveRulesResponse' smart constructor.
data ListArchiveRulesResponse = ListArchiveRulesResponse'
  { -- | A token used for pagination of results returned.
    ListArchiveRulesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListArchiveRulesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of archive rules created for the specified analyzer.
    ListArchiveRulesResponse -> [ArchiveRuleSummary]
archiveRules :: [ArchiveRuleSummary]
  }
  deriving (ListArchiveRulesResponse -> ListArchiveRulesResponse -> Bool
(ListArchiveRulesResponse -> ListArchiveRulesResponse -> Bool)
-> (ListArchiveRulesResponse -> ListArchiveRulesResponse -> Bool)
-> Eq ListArchiveRulesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListArchiveRulesResponse -> ListArchiveRulesResponse -> Bool
$c/= :: ListArchiveRulesResponse -> ListArchiveRulesResponse -> Bool
== :: ListArchiveRulesResponse -> ListArchiveRulesResponse -> Bool
$c== :: ListArchiveRulesResponse -> ListArchiveRulesResponse -> Bool
Prelude.Eq, ReadPrec [ListArchiveRulesResponse]
ReadPrec ListArchiveRulesResponse
Int -> ReadS ListArchiveRulesResponse
ReadS [ListArchiveRulesResponse]
(Int -> ReadS ListArchiveRulesResponse)
-> ReadS [ListArchiveRulesResponse]
-> ReadPrec ListArchiveRulesResponse
-> ReadPrec [ListArchiveRulesResponse]
-> Read ListArchiveRulesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListArchiveRulesResponse]
$creadListPrec :: ReadPrec [ListArchiveRulesResponse]
readPrec :: ReadPrec ListArchiveRulesResponse
$creadPrec :: ReadPrec ListArchiveRulesResponse
readList :: ReadS [ListArchiveRulesResponse]
$creadList :: ReadS [ListArchiveRulesResponse]
readsPrec :: Int -> ReadS ListArchiveRulesResponse
$creadsPrec :: Int -> ReadS ListArchiveRulesResponse
Prelude.Read, Int -> ListArchiveRulesResponse -> ShowS
[ListArchiveRulesResponse] -> ShowS
ListArchiveRulesResponse -> String
(Int -> ListArchiveRulesResponse -> ShowS)
-> (ListArchiveRulesResponse -> String)
-> ([ListArchiveRulesResponse] -> ShowS)
-> Show ListArchiveRulesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListArchiveRulesResponse] -> ShowS
$cshowList :: [ListArchiveRulesResponse] -> ShowS
show :: ListArchiveRulesResponse -> String
$cshow :: ListArchiveRulesResponse -> String
showsPrec :: Int -> ListArchiveRulesResponse -> ShowS
$cshowsPrec :: Int -> ListArchiveRulesResponse -> ShowS
Prelude.Show, (forall x.
 ListArchiveRulesResponse -> Rep ListArchiveRulesResponse x)
-> (forall x.
    Rep ListArchiveRulesResponse x -> ListArchiveRulesResponse)
-> Generic ListArchiveRulesResponse
forall x.
Rep ListArchiveRulesResponse x -> ListArchiveRulesResponse
forall x.
ListArchiveRulesResponse -> Rep ListArchiveRulesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListArchiveRulesResponse x -> ListArchiveRulesResponse
$cfrom :: forall x.
ListArchiveRulesResponse -> Rep ListArchiveRulesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListArchiveRulesResponse' 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', 'listArchiveRulesResponse_nextToken' - A token used for pagination of results returned.
--
-- 'httpStatus', 'listArchiveRulesResponse_httpStatus' - The response's http status code.
--
-- 'archiveRules', 'listArchiveRulesResponse_archiveRules' - A list of archive rules created for the specified analyzer.
newListArchiveRulesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListArchiveRulesResponse
newListArchiveRulesResponse :: Int -> ListArchiveRulesResponse
newListArchiveRulesResponse Int
pHttpStatus_ =
  ListArchiveRulesResponse' :: Maybe Text
-> Int -> [ArchiveRuleSummary] -> ListArchiveRulesResponse
ListArchiveRulesResponse'
    { $sel:nextToken:ListArchiveRulesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListArchiveRulesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:archiveRules:ListArchiveRulesResponse' :: [ArchiveRuleSummary]
archiveRules = [ArchiveRuleSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token used for pagination of results returned.
listArchiveRulesResponse_nextToken :: Lens.Lens' ListArchiveRulesResponse (Prelude.Maybe Prelude.Text)
listArchiveRulesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListArchiveRulesResponse -> f ListArchiveRulesResponse
listArchiveRulesResponse_nextToken = (ListArchiveRulesResponse -> Maybe Text)
-> (ListArchiveRulesResponse
    -> Maybe Text -> ListArchiveRulesResponse)
-> Lens' ListArchiveRulesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArchiveRulesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListArchiveRulesResponse' :: ListArchiveRulesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListArchiveRulesResponse
s@ListArchiveRulesResponse' {} Maybe Text
a -> ListArchiveRulesResponse
s {$sel:nextToken:ListArchiveRulesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListArchiveRulesResponse)

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

-- | A list of archive rules created for the specified analyzer.
listArchiveRulesResponse_archiveRules :: Lens.Lens' ListArchiveRulesResponse [ArchiveRuleSummary]
listArchiveRulesResponse_archiveRules :: ([ArchiveRuleSummary] -> f [ArchiveRuleSummary])
-> ListArchiveRulesResponse -> f ListArchiveRulesResponse
listArchiveRulesResponse_archiveRules = (ListArchiveRulesResponse -> [ArchiveRuleSummary])
-> (ListArchiveRulesResponse
    -> [ArchiveRuleSummary] -> ListArchiveRulesResponse)
-> Lens' ListArchiveRulesResponse [ArchiveRuleSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListArchiveRulesResponse' {[ArchiveRuleSummary]
archiveRules :: [ArchiveRuleSummary]
$sel:archiveRules:ListArchiveRulesResponse' :: ListArchiveRulesResponse -> [ArchiveRuleSummary]
archiveRules} -> [ArchiveRuleSummary]
archiveRules) (\s :: ListArchiveRulesResponse
s@ListArchiveRulesResponse' {} [ArchiveRuleSummary]
a -> ListArchiveRulesResponse
s {$sel:archiveRules:ListArchiveRulesResponse' :: [ArchiveRuleSummary]
archiveRules = [ArchiveRuleSummary]
a} :: ListArchiveRulesResponse) (([ArchiveRuleSummary] -> f [ArchiveRuleSummary])
 -> ListArchiveRulesResponse -> f ListArchiveRulesResponse)
-> (([ArchiveRuleSummary] -> f [ArchiveRuleSummary])
    -> [ArchiveRuleSummary] -> f [ArchiveRuleSummary])
-> ([ArchiveRuleSummary] -> f [ArchiveRuleSummary])
-> ListArchiveRulesResponse
-> f ListArchiveRulesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ArchiveRuleSummary] -> f [ArchiveRuleSummary])
-> [ArchiveRuleSummary] -> f [ArchiveRuleSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListArchiveRulesResponse