{-# 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.Route53RecoveryReadiness.ListRules
-- 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 collection of rules that are applied as part of Readiness
-- Checks.
--
-- This operation returns paginated results.
module Amazonka.Route53RecoveryReadiness.ListRules
  ( -- * Creating a Request
    ListRules (..),
    newListRules,

    -- * Request Lenses
    listRules_resourceType,
    listRules_nextToken,
    listRules_maxResults,

    -- * Destructuring the Response
    ListRulesResponse (..),
    newListRulesResponse,

    -- * Response Lenses
    listRulesResponse_rules,
    listRulesResponse_nextToken,
    listRulesResponse_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.Route53RecoveryReadiness.Types

-- | /See:/ 'newListRules' smart constructor.
data ListRules = ListRules'
  { -- | Filter parameter which specifies the rules to return given a resource
    -- type.
    ListRules -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
    -- | A token used to resume pagination from the end of a previous request.
    ListRules -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Upper bound on number of records to return.
    ListRules -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListRules -> ListRules -> Bool
(ListRules -> ListRules -> Bool)
-> (ListRules -> ListRules -> Bool) -> Eq ListRules
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRules -> ListRules -> Bool
$c/= :: ListRules -> ListRules -> Bool
== :: ListRules -> ListRules -> Bool
$c== :: ListRules -> ListRules -> Bool
Prelude.Eq, ReadPrec [ListRules]
ReadPrec ListRules
Int -> ReadS ListRules
ReadS [ListRules]
(Int -> ReadS ListRules)
-> ReadS [ListRules]
-> ReadPrec ListRules
-> ReadPrec [ListRules]
-> Read ListRules
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRules]
$creadListPrec :: ReadPrec [ListRules]
readPrec :: ReadPrec ListRules
$creadPrec :: ReadPrec ListRules
readList :: ReadS [ListRules]
$creadList :: ReadS [ListRules]
readsPrec :: Int -> ReadS ListRules
$creadsPrec :: Int -> ReadS ListRules
Prelude.Read, Int -> ListRules -> ShowS
[ListRules] -> ShowS
ListRules -> String
(Int -> ListRules -> ShowS)
-> (ListRules -> String)
-> ([ListRules] -> ShowS)
-> Show ListRules
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRules] -> ShowS
$cshowList :: [ListRules] -> ShowS
show :: ListRules -> String
$cshow :: ListRules -> String
showsPrec :: Int -> ListRules -> ShowS
$cshowsPrec :: Int -> ListRules -> ShowS
Prelude.Show, (forall x. ListRules -> Rep ListRules x)
-> (forall x. Rep ListRules x -> ListRules) -> Generic ListRules
forall x. Rep ListRules x -> ListRules
forall x. ListRules -> Rep ListRules x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRules x -> ListRules
$cfrom :: forall x. ListRules -> Rep ListRules x
Prelude.Generic)

-- |
-- Create a value of 'ListRules' 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:
--
-- 'resourceType', 'listRules_resourceType' - Filter parameter which specifies the rules to return given a resource
-- type.
--
-- 'nextToken', 'listRules_nextToken' - A token used to resume pagination from the end of a previous request.
--
-- 'maxResults', 'listRules_maxResults' - Upper bound on number of records to return.
newListRules ::
  ListRules
newListRules :: ListRules
newListRules =
  ListRules' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListRules
ListRules'
    { $sel:resourceType:ListRules' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRules' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRules' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Filter parameter which specifies the rules to return given a resource
-- type.
listRules_resourceType :: Lens.Lens' ListRules (Prelude.Maybe Prelude.Text)
listRules_resourceType :: (Maybe Text -> f (Maybe Text)) -> ListRules -> f ListRules
listRules_resourceType = (ListRules -> Maybe Text)
-> (ListRules -> Maybe Text -> ListRules)
-> Lens ListRules ListRules (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRules' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:ListRules' :: ListRules -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: ListRules
s@ListRules' {} Maybe Text
a -> ListRules
s {$sel:resourceType:ListRules' :: Maybe Text
resourceType = Maybe Text
a} :: ListRules)

-- | A token used to resume pagination from the end of a previous request.
listRules_nextToken :: Lens.Lens' ListRules (Prelude.Maybe Prelude.Text)
listRules_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListRules -> f ListRules
listRules_nextToken = (ListRules -> Maybe Text)
-> (ListRules -> Maybe Text -> ListRules)
-> Lens ListRules ListRules (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRules' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRules' :: ListRules -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRules
s@ListRules' {} Maybe Text
a -> ListRules
s {$sel:nextToken:ListRules' :: Maybe Text
nextToken = Maybe Text
a} :: ListRules)

-- | Upper bound on number of records to return.
listRules_maxResults :: Lens.Lens' ListRules (Prelude.Maybe Prelude.Natural)
listRules_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListRules -> f ListRules
listRules_maxResults = (ListRules -> Maybe Natural)
-> (ListRules -> Maybe Natural -> ListRules)
-> Lens ListRules ListRules (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRules' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRules' :: ListRules -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRules
s@ListRules' {} Maybe Natural
a -> ListRules
s {$sel:maxResults:ListRules' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRules)

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

instance Prelude.NFData ListRules

instance Core.ToHeaders ListRules where
  toHeaders :: ListRules -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListRules -> 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 ListRules where
  toPath :: ListRules -> ByteString
toPath = ByteString -> ListRules -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/rules"

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

-- | /See:/ 'newListRulesResponse' smart constructor.
data ListRulesResponse = ListRulesResponse'
  { -- | A list of rules
    ListRulesResponse -> Maybe [ListRulesOutput]
rules :: Prelude.Maybe [ListRulesOutput],
    -- | A token that can be used to resume pagination from the end of the
    -- collection.
    ListRulesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRulesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListRulesResponse -> ListRulesResponse -> Bool
(ListRulesResponse -> ListRulesResponse -> Bool)
-> (ListRulesResponse -> ListRulesResponse -> Bool)
-> Eq ListRulesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRulesResponse -> ListRulesResponse -> Bool
$c/= :: ListRulesResponse -> ListRulesResponse -> Bool
== :: ListRulesResponse -> ListRulesResponse -> Bool
$c== :: ListRulesResponse -> ListRulesResponse -> Bool
Prelude.Eq, ReadPrec [ListRulesResponse]
ReadPrec ListRulesResponse
Int -> ReadS ListRulesResponse
ReadS [ListRulesResponse]
(Int -> ReadS ListRulesResponse)
-> ReadS [ListRulesResponse]
-> ReadPrec ListRulesResponse
-> ReadPrec [ListRulesResponse]
-> Read ListRulesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRulesResponse]
$creadListPrec :: ReadPrec [ListRulesResponse]
readPrec :: ReadPrec ListRulesResponse
$creadPrec :: ReadPrec ListRulesResponse
readList :: ReadS [ListRulesResponse]
$creadList :: ReadS [ListRulesResponse]
readsPrec :: Int -> ReadS ListRulesResponse
$creadsPrec :: Int -> ReadS ListRulesResponse
Prelude.Read, Int -> ListRulesResponse -> ShowS
[ListRulesResponse] -> ShowS
ListRulesResponse -> String
(Int -> ListRulesResponse -> ShowS)
-> (ListRulesResponse -> String)
-> ([ListRulesResponse] -> ShowS)
-> Show ListRulesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRulesResponse] -> ShowS
$cshowList :: [ListRulesResponse] -> ShowS
show :: ListRulesResponse -> String
$cshow :: ListRulesResponse -> String
showsPrec :: Int -> ListRulesResponse -> ShowS
$cshowsPrec :: Int -> ListRulesResponse -> ShowS
Prelude.Show, (forall x. ListRulesResponse -> Rep ListRulesResponse x)
-> (forall x. Rep ListRulesResponse x -> ListRulesResponse)
-> Generic ListRulesResponse
forall x. Rep ListRulesResponse x -> ListRulesResponse
forall x. ListRulesResponse -> Rep ListRulesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRulesResponse x -> ListRulesResponse
$cfrom :: forall x. ListRulesResponse -> Rep ListRulesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRulesResponse' 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:
--
-- 'rules', 'listRulesResponse_rules' - A list of rules
--
-- 'nextToken', 'listRulesResponse_nextToken' - A token that can be used to resume pagination from the end of the
-- collection.
--
-- 'httpStatus', 'listRulesResponse_httpStatus' - The response's http status code.
newListRulesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRulesResponse
newListRulesResponse :: Int -> ListRulesResponse
newListRulesResponse Int
pHttpStatus_ =
  ListRulesResponse' :: Maybe [ListRulesOutput] -> Maybe Text -> Int -> ListRulesResponse
ListRulesResponse'
    { $sel:rules:ListRulesResponse' :: Maybe [ListRulesOutput]
rules = Maybe [ListRulesOutput]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListRulesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRulesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of rules
listRulesResponse_rules :: Lens.Lens' ListRulesResponse (Prelude.Maybe [ListRulesOutput])
listRulesResponse_rules :: (Maybe [ListRulesOutput] -> f (Maybe [ListRulesOutput]))
-> ListRulesResponse -> f ListRulesResponse
listRulesResponse_rules = (ListRulesResponse -> Maybe [ListRulesOutput])
-> (ListRulesResponse
    -> Maybe [ListRulesOutput] -> ListRulesResponse)
-> Lens' ListRulesResponse (Maybe [ListRulesOutput])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesResponse' {Maybe [ListRulesOutput]
rules :: Maybe [ListRulesOutput]
$sel:rules:ListRulesResponse' :: ListRulesResponse -> Maybe [ListRulesOutput]
rules} -> Maybe [ListRulesOutput]
rules) (\s :: ListRulesResponse
s@ListRulesResponse' {} Maybe [ListRulesOutput]
a -> ListRulesResponse
s {$sel:rules:ListRulesResponse' :: Maybe [ListRulesOutput]
rules = Maybe [ListRulesOutput]
a} :: ListRulesResponse) ((Maybe [ListRulesOutput] -> f (Maybe [ListRulesOutput]))
 -> ListRulesResponse -> f ListRulesResponse)
-> ((Maybe [ListRulesOutput] -> f (Maybe [ListRulesOutput]))
    -> Maybe [ListRulesOutput] -> f (Maybe [ListRulesOutput]))
-> (Maybe [ListRulesOutput] -> f (Maybe [ListRulesOutput]))
-> ListRulesResponse
-> f ListRulesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ListRulesOutput]
  [ListRulesOutput]
  [ListRulesOutput]
  [ListRulesOutput]
-> Iso
     (Maybe [ListRulesOutput])
     (Maybe [ListRulesOutput])
     (Maybe [ListRulesOutput])
     (Maybe [ListRulesOutput])
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
  [ListRulesOutput]
  [ListRulesOutput]
  [ListRulesOutput]
  [ListRulesOutput]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token that can be used to resume pagination from the end of the
-- collection.
listRulesResponse_nextToken :: Lens.Lens' ListRulesResponse (Prelude.Maybe Prelude.Text)
listRulesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRulesResponse -> f ListRulesResponse
listRulesResponse_nextToken = (ListRulesResponse -> Maybe Text)
-> (ListRulesResponse -> Maybe Text -> ListRulesResponse)
-> Lens' ListRulesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRulesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRulesResponse' :: ListRulesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRulesResponse
s@ListRulesResponse' {} Maybe Text
a -> ListRulesResponse
s {$sel:nextToken:ListRulesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRulesResponse)

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

instance Prelude.NFData ListRulesResponse